wizeline / project-lab

Proposal Hunt / Project Lab experimental repo
MIT License
5 stars 0 forks source link

Consider switching to postgresql #298

Closed jackbravo closed 2 years ago

jackbravo commented 2 years ago

There are two main things to consider:

  1. We have been running into database disk image is malformed errors on production. Seems like this is a reported error on the prisma library, but we don't know if indeed it is a prisma issue or something else.
  2. Seems like prisma could be very slow with SQLite, this is reported here. Postgres is better maintained on prisma, for example, their full text features were first implemented for postgres, then for MySQL, sqlite is still pending..

We may consider switching our main database to postgres, since we are using prisma, most code wouldn't need any change. Mainly our deployment code.

Consider this code along with #297. Specially since both issues (corrupt database and slow sync) could be solved by #297.

jackbravo commented 2 years ago

This article gives great advice on how to implement some of the features we have with our current sqlite implementation, but in postgres, using prisma as well. It would leave us without custom SQL files, so clean migrations:

https://www.claritician.com/how-to-implement-full-text-search-in-prisma-with-postgresql