How to configure SQLite for an application deployed on Heroku?

  • Well, you're a humorist, monsieur. In the course, that as soon as dyno falls asleep, its file system will fly away from nowhere along with the base? - D-side

1 answer 1

In an amicable way . SQLite is not a server accessible over the network, but a library for working with some locally accessible file.

Heroku, the classic 12-factor cloud, operates on ephemeral file systems . The cloud reserves the right to recreate the file system from time to time and your file with the SQLite database, thus, will periodically disappear. Together with all the data.

This is done to make the application easier to scale: so that you can easily raise another copy of your application, connect to the same databases via the network and ... almost double the number of requests serviced in parallel. That's just when SQLite starts to refer to more than one client, the light presentation begins.

So you have a hard choice: either to abandon SQLite , or to abandon Heroku .


... or somehow force the application to store the database file in external storage, but it can be even easier to raise a normal RDBMS with network access.