Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sqlite with embedded Postgres #1351

Open
oxisto opened this issue Feb 20, 2024 · 0 comments
Open

Replace sqlite with embedded Postgres #1351

oxisto opened this issue Feb 20, 2024 · 0 comments

Comments

@oxisto
Copy link
Member

oxisto commented Feb 20, 2024

Instead of having basically two database systems sqlite and Postgres, we could possibly get rid of sqlite with https://github.com/fergusstrange/embedded-postgres.

In the past we sometimes had issues that unit tests and the "real" application would behave differently because one is running with sqlite, the other with a real Postgres DB.

We basically have two use cases for sqlite/embedded Postgres:

  • Unit tests of our services that need persistence. Not all of the unit tests need that, so we probably would need some kind of util function to "enable" it for a particular test file. I would imagine that embedded Postgres is a little bit slower than sqlite
  • The "demo" mode. In this mode we are currently using an in-memory sqlite database, just to demonstrate things, such as showing the UI, etc. This could easily be done with an embedded Postgres

Con:

  • Not sure about the file size?
  • Speed?

Pro:

  • We probably could get rid of a few dependencies, since our non-CGO sqlite dependencies includes a lot of transitive dependencies that basically include the whole C standard library transcoded into Go, such as modernc.org/libc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant