Question

Installing/using SQLite on App platform

Posted December 18, 2020 1.3k views
PHPDigitalOcean App PlatformSQLite

I’ve got a PHP app deployed to the App platform and would like to use a SQLite3 DB with it. I’m new to SQLite (and the App platform), but familiar with MySQL. My boss suggested using a SQLite database since it’s a real lightweight database.

Do I need to SQLite via a build script?

Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Line 4 should read “Do I need to install SQLite via a build script?”

👋 @brockcaldwell33

App Platform apps are deployed in containers which are ephemeral. In events such as new deployments, your app crashes, or there are cluster issues and we evacuate your app to another cluster all of the filesystem data will be gone. For this reason we do not recommend using SQLite on App Platform.

We do offer a low cost PostgreSQL dev database which can be upgraded to a more powerful, highly available production database when you’re ready which would be a great choice. Of course, any database hosted outside of App Platform (like MySQL) will also work.

  • I understand the risks :) but for a simple app this is really not such a big deal.

    Could you maybe let us know what would be the best way to do this? I’ve tried to add a Dockerfile installing sqlite, but somehow this did not work.