Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting SQLite DB on Azure Storage?

I need to host an SQLite database on Azure that will be shared among several web apps. My only options seem to be Azure Blob or File Storage (since they got rid of the "Azure Websites" that provided dedicated storage shared among web instances). However, there does not appear to be any way to map an Azure Storage share to a drive that the Web App will recognize, and thus no way to generate a path that SQLite can use. And obviously, SQLite can't use REST APIs to access the DB without tremendous hacking in the SQLite VFS.

So I'm wondering if anyone has successfully hosted an SQLite DB on Azure Storage such that it was accessible to a Web App?

like image 856
Peter Moore Avatar asked Apr 21 '17 15:04

Peter Moore


People also ask

Can you use SQLite on Azure?

Select all tables from the source SQLite database using the check boxes, and map them to the target tables in Azure SQL. Once the job has run, you have successfully migrated your data from SQLite to Azure SQL!

Can SQLite be shared?

Yes SQLite can support multiple users at once. It does however lock the whole database when writing, so if you have lots of concurrent writes it is not the database you want (usually the time the database is locked is a few milliseconds - so for most uses this does not matter).

How do I connect to a SQLite database?

Select SQLite from the list. Give a Connection name for your own internal reference. For Database , click Choose a File and then select the database file on your local machine to which you want to connect. Hit Connect and you're all set!


1 Answers

Azure Web Apps (formerly known as Web Sites) still exists, and still has durable, shared storage across your web app instances.

You cannot use a blob to hold SQLite, as it is not compatible with file I/O (it has a REST API for access). And you cannot simply attach an Azure File Storage volume (you can use one, via API, but cannot mount it to an Azure Web App instance).

Nothing's changed with Web Apps: just place your SQLite database in a directory underneath your app's root directory.

like image 73
David Makogon Avatar answered Sep 18 '22 10:09

David Makogon