Live data from Hacker News

D1: Our SQL database

blog.cloudflare.com

151–160 of 241 posts

Re: D1: Our SQL database

#151

Love the Northwind Traders reference! However, for a demo, I suggest a slightly larger and more complex data set, [data-generator-retail]( https://www.npmjs.com/package/data-generator-retail ). The demo is also a bit buggy: orders are duplicated as many times as there are products, but clicking on the various lines of the same order leads to the same record, where the user can only see the first product... I also thi…

Fixed the orders table. Good catch.

Re: D1: Our SQL database

#152

Big fan of Cloudflare but I wish they would stick to descriptive product names. Good: Workers, KV, Durable Objects, Cron Triggers Bad: Spectrum, Zaraz, R2, D1

Naming is hard.

> Zaraz

That's the name of the company they acquired. Though, I do agree that more descriptive naming is nice.

E.g.

Zaraz = SafeXXS

D1 = LDS (light database system)

R2 = ObjectStore

Spectrum = Reverse Proxy

Re: D1: Our SQL database

#153

Earlier quoted context omitted.

> I'm guessing this is a single master database with multiple read replicas. That means it's not consistent Single master with read replicas is fully consistent if commits don't return until propagated to and acknowledged by replicas (the expense here being commit latency.)

You've basically described rqlite [1], which uses Raft to coordinate the changes to the Leader, and then across some number of Followers. The write won't be acked until a quorum has persisted the change, and committed to the underlying SQLite database. Disclaimer: I am the creator of rqlite. [1] https://github.com/rqlite/rqlite

rqlite also supports read-only nodes, so in theory you can have more nodes at the edge, just like D1 -- but these nodes won't participate in the distributed consensus process. Those nodes will keep up-to-date with changes, even catching up in the event of a temporary disconnection.

Re: D1: Our SQL database

#158

For a Cloudflare article, this one is surprisingly light on technical details. And for the product where it most matters. I'm guessing this is a single master database with multiple read replicas. That means it's not consistent anymore (the C in ACID). Obviously reads after a write will see stale data until the write propogates. I'm a bit curious how that replication works. Ship the whole db? Binary diffs of the mast…

I agree -- this blog post is light on details. To me the value Cloudflare believes they are offering is mostly ease-of-use, particularly setup. With minimal work you can have a stateful, relational store available to your code. But in terms of actual database functionality, they are not offering anything particularly novel. Of course, I might be missing something.

In fact, I don't see anything D1 is doing that is not already offered by something like rqlite[1], which is also a super-easy-to-use distributed database built on SQLite. Of course Cloudflare will run the database for you, which is a great help -- they take care of the uptime, monitoring, backups, etc. And that's important obviously, because in the real-world databases must be operated.

Disclaimer: I am the creator of rqlite.

[1] https://github.com/rqlite/rqlite

Re: D1: Our SQL database

#160

Any current or planned support for existing ORMs, such as Prisma or TypeOrm? Also, I wonder how hard it will be to migrate existing PostgreSQL databases and SQL statements. Of course, I understand if Cloudflare is focused on greenfield applications.

We are definitely interested in ORMs. Want to make it easy to use. I hope someone creates the next Rails using Workers. And having other models on top of our SQL offerings will be important. Get in contact and let us know what you'd like.

You might want to consider adding Deno [1] to the language examples: https://developers.cloudflare.com/workers/platform/languages...

Deno can compile to wasm, so it can plug in through that vertical. But it's just TS on the frontend.

I'm mainly a python programmer, but Deno's been the most alluring development in the JS ecosystem since typescript for me. Might be helpful to you all to capture some steam from source.

[1]: https://deno.land/

Post reply on HN