4 ms·
As far as I know Cloudflare Pages Functions with Durable Objects or D1 is the only edge infrastructure that can do this currently. D1 uses SQL as it is built on
by Comevius 4y ago
As far as I know Cloudflare Pages Functions with Durable Objects or D1 is the only edge infrastructure that can do this currently. D1 uses SQL as it is built on SQLite, and Durable Objects is used for coordination, but also has a transactional storage API.
D1 is closed beta, Pages Functions is open beta, but limited to 100,000 requests. You don't need Pages Functions if you have an SPA, it's more of an MPA thing where Workers is used as a server for SSR. It let's you push more work to the server like in the good old days, except the server is a JavaScript runtime running on the edge. Durable Objects is the interesting part, because it gives you the data locality, but also strong consistency.
Not shilling for Cloudflare, I just think that their stuff is cool and the rest of the industry is definitely playing catch-up to them. You can argue that most of us don't need the scale and it's true, but I would also argue that we can use the performance and the developer convenience, and by that I also mean time, which is by far the most important resource. Their runtime is also open-source, which makes you feel less tethered to them.
https://blog.cloudflare.com/workerd-open-source-workers-runtime/ https://blog.cloudflare.com/workerd-open-source-workers-runt...
- pier25 4y agoThere are a number of distributed databases in the market. Fauna, GC Spanner, Cockroach, etc. I love the CF stuff. I've been using Workers for a couple of years, even right now in production for streaming audio and other duties. But Workers are not a generalist solution for building complete applications.
- ZephyrBlu 4y agoIt looks like Cloudflare is moving towards that with functions in Pages, which allows you to call Workers within your Pages app. https://blog.cloudflare.com/cloudflare-pages-goes-full-stack/ https://blog.cloudflare.com/cloudflare-pages-goes-full-stack...
- Comevius 4y agoExactly my point, and I'm working on a complicated web app on top of Pages Functions and Durable Objects. The idea is that you can provide dynamic functionality without or with less client-side JavaScript, which is what SSR is about, and at the same time you can also build things like an authentication server, which traditionally requires an actual server, but can be done with just Workers and Durable Objects.
- dinvlad 4y agoToo bad distributed DBs are very expensive atm. Their multi-region offerings are only good for companies who can spend thousands on a database each month. I’m actually thinking that with GDPR and similar regional lock-in laws, the future might well be “distributed but independent” DBs, and then both the compliance and the performance problems are solved using more traditional architectures.
- fragile_frogs 4y agoyugabyte looks quite interesting in that space. From what I can tell their OSS product allows for "Row-level geo-partitioning" https://docs.yugabyte.com/preview/explore/multi-region-deployments/row-level-geo-partitioning/ https://docs.yugabyte.com/preview/explore/multi-region-deplo... I haven't used it for anything yet, so I don't know how well it works.
- diroussel 4y agoCloud flare made a blog post about this. I tried to find it but I couldn’t. The general idea was that in a post GDPR world as more and more countries put legal limits on the movement of data about their citizens, it gets harder and harder to serve these users with classic web tech. However, they say, that cloudflare workers and durable objects the user data is kept in region and thus you have a clean scalable architecture without legal worries about data jurisdiction.
- anderspitman 4y agoCheck out fly.io as well. They've been adding some SQLite stuff. They also have the added benefit that you can run just about any docker image, not just functions.
- cadbox1 4y agoI'm building an app using fly.io and SQLite and it's pretty interesting. this indie-stack shows how to use the remix framework, fly.io, SQLite and Prisma together. https://github.com/remix-run/indie-stack https://github.com/remix-run/indie-stack I think fly.io will only expand their SQLite features with the creator of Litestream onboard. Exciting stuff! https://fly.io/blog/all-in-on-sqlite-litestream/ https://fly.io/blog/all-in-on-sqlite-litestream/