Deploying a Rust CDN with LiteFS | Distributed SQLite Across Regions

Deploying a Rust CDN with LiteFS | Distributed SQLite Across Regions

2023-09-07
In this live coding stream, I work on deploying a Rust CDN (content delivery network) using LiteFS to distribute an SQLite database across regions. We start by deploying an origin server to Paris using Fly.io. Then we deploy the CDN cache itself to regions in New Jersey and London, and connect it to the origin server in Paris. We implement LiteFS, a distributed filesystem, to replicate our SQLite database manifest across nodes. This allows each CDN node to know what content is cached in other regions. I run into some challenges getting write forwarding to work properly on replica regions, so this will be a focus for next time. Overall we make good progress on getting the CDN deployed and caching content, with the database manifest replicated globally. Next up is improving write support and being able to populate the cache from the origin when needed. This is a fun dive into deploying a globally distributed Rust web service, using technologies like Fly.io, LiteFS, SQLite and more. If you're interested in Rust web development and distributed systems, check out the video! Links: https://github.com/coreyja/caje https://fly.io/docs/litefs/ https://fly.io/ Part 1: https://youtu.be/4DKm8lEYQ6o Part 2: https://youtu.be/oTS7LB2ChK8 Part 3: https://youtu.be/lC7UnaqNxoY Part 4: https://youtu.be/4bOl1QKaJaU Part 5: https://youtu.be/wgt5AF9rv3s Part 6: https://youtu.be/vK4dKghjPPQ

coreyja weekly

My weekly newsletter tailored at developers who are eager to grow with me!
Every week will be unique, but expect topics focusing around Web Development and Rust