Database on github (sqlite3)

Hi everybody,

I have a created a website with Streamlit is being deployed with render.com.

The website also includes a sqlite3 database which get updated with new data coming from website users.
Hence, I am wondering whether each time I deploy the website from Render, I loose all the data that are stored in the database. If yes, how can I solve this problem?

Thanks in advance!

Filesystem storage for services is ephemeral by default and will be cleared on every deploy. If you would like data to persist across deploys, you can attach a Render disk to your service.

First, let me thank you for the super prompt reply.
Great! Though I knew of this possibility, I has completely removed it from my mind.
Just one more question:
→ What is the difference between Render Disk and Render Database, other than the possibility to store other type of files on Disk?

A Render disk acts just like a filesystem where you can store and retrieve files. A Render database is a managed PostgreSQL instance that you interact with via SQL. Since you are using SQLite, it will be largely the same experience as a PostgreSQL instance. However, there are a couple of restrictions when using a Render disk as a database:

  • You will only be able to connect a single service to your disk-based SQLite instance, since Render disks do not support multiple connected services. A PostgreSQL instance allows you to connect many clients simultaneously.
  • Zero downtime deploys are not supported for services with a disk attached. Usually, there is a couple seconds of unavailability as the disk is detached from the old service and attached to the newly deployed service.
  • You can scale the performance of your database independently of your service vs. a SQLite database where performance is tied to the service. However, Render disks use SSDs so you should see good performance with a SQLite database until you reach a reasonably high scale.

If none of these tradeoffs are a deal breaker for you, then disks are generally a better, lower-cost option. You can always migrate to a database later if needed.

2 Likes

Thanks again for such a concise reply.
I tried to attach a Disk for my existing app, but I was unsuccessful.

What should be the mount path of the Disk for an existing web app?

1 Like

Hi,

how can I download sqlite file from render.com disk? I’m connected via ssh but I can’t find the file.

Thanks,
magnus

Hi Magnus,

Thanks for reaching out.

If you’ve been saving a SQLite file to a Render Disk, there will be a mount path specified in the disk settings, is the file not present at that mount path? It will be a path from the root of the filesystem, not from the root of your project.

Kind regards

Alan

Hi, I am new to the service and have a similar issue. I could ssh in my project and find my file. But when I try to scp, it says permission denied. And I use the ed25519 type key. How can I solve this?

1 Like