DEV Community

John Mitchell
John Mitchell

Posted on

Re: using Sqlite for Dev and Postgres for Production

Using Sqlite locally, Postgres in production. New feature is slow -- will this persist in production, or is it a Sqlite thing?

-- Reddit /r/django thread

The slowness will almost definitely persist when deploying to Postgres. Use a tool to measure performance. Two million objects is no big deal.

Consider switching to Postgres on local development. Any "drift" between production and local is a risk. We did the "sqlite for dev, Postgres for prod" thing and sometimes bugs would only appear in production, which made them much harder to track down. Sqlite has loose flexible typing. This can be disabled, if you want to keep Sqlite local. This will mitigate the risk somewhat and it's an easy change.

Other people on Reddit are like "Sqlite is a toy", I strongly disagree. It's 10x faster than Postgres - with limitations - and usable for 90% of use cases. The fact you're using two different databases for dev and prod is a risk, but not critical.

Source: I'm a Dev/DevOps consultant.

Top comments (0)