Short answer
No — at least not in the way you’re imagining.
SQLite needs a real, POSIX-style filesystem that supports locking and very fast random I/O. Backblaze B2/S3 (like AWS S3, GCS, etc.) is object storage, not block storage, so it can’t satisfy SQLite’s requirements. If you try to “mount” the bucket with s3fs or similar, you’ll hit three deal-breakers:
- No guaranteed file locking → two writers or even one writer + one reader can corrupt the DB.
- Latency → every 4 KB page read/write becomes an HTTP round-trip (~tens of ms). Your app will crawl.
- Eventual consistency → even basic “rename” operations that SQLite relies on may not be atomic.
Read-only trick?
If your DB is 100 % read-only you could:
• Download it at container start‐up (e.g., with b2 download-file-by-name)
• Keep it on the pod/VM’s local disk, open it with SQLite in read-only mode
• Periodically refresh the file if you publish a new version
…but the instant you need a single write, you’re back in dangerous territory.
Recommended patterns
| Scenario | What to use instead |
|---|
| Need multiple writers / real production DB | Postgres, MySQL, MariaDB, Aurora, Cloud SQL, Supabase, PlanetScale, etc. |
| Mostly reads, occasional writes by one process | Still use Postgres/MySQL, or host SQLite on a block device (EBS, DigitalOcean Vol, Linode Vol, Hetzner Cloud Vol, etc.) |
| Local-first dev, production cloud DB | Use SQLAlchemy; point to sqlite:///local.db locally, switch URI to Postgres in prod. |
| Static data (seed data, catalogue) | Bake it into the Docker image or cache the JSON/CSV in Redis/Memcached. |
If you really must keep SQLite
- Run your Flask app on a single server/VM with an attached block volume (NVMe, SSD, EBS gp3, etc.).
- Use Backblaze B2 only as a backup target: nightly
b2 upload-file db.sqlite3.
- Restore by downloading the file and placing it back on the local disk; never run the DB directly out of the bucket.
Why object storage ≠ filesystem (quick technical notes)
• S3/B2 is object storage: whole‐file PUT/GET, no partial updates, no in-place modification.
• SQLite’s WAL mode writes 4 KB pages thousands of times per second and uses flock() / fcntl() locks.
• Even FUSE layers such as s3fs, goofys, rclone mount, etc., can’t magic away the underlying API limitations.
Bottom line
Host SQLite on block storage (local disk, EBS, etc.), or switch to a server-grade DB. Use Backblaze B2 only for backups, not for live SQLite files.