Better HN
topnewbestaskshowjobs
Log inSign up

cloutiertyler

272 karma · joined Sep 17, 2014 (12y ago) · 105 submissions

Submissions

comment 2mo ago · link · parent

Yep, that’s exactly what it is.

comment 2mo ago · link · parent

Hardly your fault! It’s the responsibility of the person writing the article to do the technical diligence. Nevertheless did want to address it.

comment 2mo ago · link · parent

You don’t need CockroachDB for high availability though.

comment 2mo ago · link · parent

It wouldn’t. SpacetimeDB Cloud is not single node. And before you say it’s not open source, neither is CRDB.

comment 2mo ago · link · parent

I'm not sure I follow. SpacetimeDB Cloud has the same exact behavior as CRDB in terms of tolerating single node failure and loss of availability.

comment 2mo ago · link · parent

The SpacetimeDB Cloud version runs with distributed replication, so it continues to be available on the other nodes.

On the SpacetimeDB Standalone (single node) version, you lose your data, same as you would with Postgres or Sqlite.

comment 2mo ago · link · parent

Is it really not more expensive? I haven't operated a large scale Spanner cluster, but the numbers would suggest it's quite a bit more expensive. I suppose it's workload dependent is what you're saying?

comment 2mo ago · link · parent

I concede that we do have a big lock. But that is only because we did the alternative first and it performed worse, which is what OPs article is about.

Reposting what I posted below regarding the strn.cat article:

I'm a cofounder of SpacetimeDB (and the author of OPs article). The https://strn.cat/posts/spacetime/ article has several substantial errors. I've spoken with Vicent directly about them.

Most notably, almost the entire commentary about durability is incorrect. SpacetimeDB does not acknowledge anything before data is fully persisted to disk, even though he claims it does. Clients CAN chose to listen before that, but you can do the same thing in Postgres if you want.

There is no 50 ms delay to writing to disk. The article is mostly nonsense.

Ask Claude yourself: https://github.com/clockworklabs/SpacetimeDB

He spent 15 minutes looking at our code (by his own admission), having never written a database storage engine before AFAIK, and made a pronouncement that SpacetimeDB wasn't a good database. Crazy stuff.

comment 2mo ago · link · parent

> which is guaranteeing that single node failures can be tolerated with zero data loss or loss of availability

We solve this with distributed state machine replication. You don't need multiple writers to solve the single node failure problem. You only need multiple writers for a write throughput scaling problem.

They're separate problems.

comment 2mo ago · link · parent

Hear hear

comment 2mo ago · link · parent

I don't have the whole story for you, but the key is that SpacetimeDB transactions are not interactive. The TigerBeetle team talks about this a lot as well.

The TL;DR is that because you're not holding locks across the network (as is the case in Postgres), your server code can complete transactions in single digit microseconds, rather than milliseconds. And the practical effect is you can do many more transactions per second as a result.

comment 2mo ago · link · parent

I am the author of OPs article (SpacetimeDB cofounder). These are all fair caveats/criticisms.

> The benchmarks are completely meaningless for that use case.

I wouldn't say completely meaningless, but it isn't a game benchmark that's true. We feel very comfortable that it's the most performant backend for persistent games though. We were trying to show it's also more performant for web use cases.

> 90% (or more) just waiting on timers to finish

This is not correct. It's mostly processing player movement transactions. We do about 50 million an hour.

comment 2mo ago · link · parent

We originally did MVCC and it was actually worse performance (in our implementation, I grant), but that's what OPs article is about. We spent a lot of money finding out that a lock is more performant.

Calling it a "hashtable" is something that only someone who hasn't built a DB engine would do. It's incredibly naive. It discounts the complexity of execution, atomicity, durability, constraint validation, migrations, query planning, incremental query evaluation, down to zero. It really makes it sound like he has absolutely no idea what he's talking about.

Besides, it's a btree (heh).

comment 2mo ago · link · parent

I know people aren't going to put more than a few minutes into verification, so that's why I suggested it. I'm not really sure what else to do. It really is all there in the code.

comment 2mo ago · link · parent

Yes, I mean we do not expose any data external to the database that is not written persistently to disk (by default). In our case that means:

- Returning it as a result to a SQL query - Sending it to clients as part of a subscription - Or a return value to the caller

comment 2mo ago · link · parent

I'm aware of his work on git, and that is not a database storage engine.

comment 2mo ago · link · parent

I'm a cofounder of SpacetimeDB (and the author of OPs article). The https://strn.cat/posts/spacetime/ article has several substantial errors. I've spoken with Vicent directly about them.

Most notably, almost the entire commentary about durability is incorrect. SpacetimeDB does not acknowledge anything before data is fully persisted to disk, even though he claims it does. Clients CAN chose to listen before that, but you can do the same thing in Postgres if you want.

There is no 50 ms delay to writing to disk. The article is mostly nonsense.

Ask Claude yourself: https://github.com/clockworklabs/SpacetimeDB

He spent 15 minutes looking at our code (by his own admission), having never written a database storage engine before AFAIK, and made a pronouncement that SpacetimeDB wasn't a good database. Crazy stuff.

comment 3mo ago · link · parent

You're just describing OLTP transactions, which is exactly what OLTP benchmarks are designed to test.

comment 3mo ago · link · parent

Vicent claimed our database wasn't ACID. I would not say the tone of it is especially even handed, and the technical accuracy of it borders on libel.

comment 3mo ago · link · parent

I'm publishing a post this week about it.

comment 3mo ago · link · parent

That was indeed our reasoning. SpacetimeDB is largely prerequisite for the game we had to build.

comment 3mo ago · link · parent

Yes, of course it did. This article makes factually wrong claims about the database I've spent 6+ years building.

Your comment was about whether SpacetimeDB was "just a hashmap behind a RwLock" and the blog post I linked addresses that question. Namely, it does have a RwLock, but that is by design and produces better results than the alternative.

comment 3mo ago · link · parent

I don't really have a deep technical explanation blog post out, but we should definitely publish one.

I can say that your last paragraph is essentially correct though. It works exactly that way.

comment 3mo ago · link · parent

On the contrary, even the writer of this blog post told me that BitCraft is "a very enjoyable game"!

comment 3mo ago · link · parent

Extraordinary claims perhaps, but correct ones nevertheless: https://spacetimedb.com/blog/benchmarking.

The article says that we don't provide strong durability guarantees. Pure ipse dixit. And IIRC he's already cleaned it up a little.

The shamelessness with which people published bogus claims about SpacetimeDB after this was really really astonishing. And so many were quick to dismiss the overall results based on some handwaving arguments. I wasn't prepared for it.

We should have held off on publishing until we had a deep technical blog on the subject.

If you haven't read https://spacetimedb.com/blog/benchmarking you should give it a read.

It seems like an odd choice perhaps, but I had the numbers to prove that it was simply measurably worse overall performance for most OLTP workloads.

IIRC, we don't let pure reads read the committed state while a transaction is underway. We can certainly do that in the future, but we're so far out ahead of typical database performance for most OLTP workloads we haven't even bothered.

comment 3mo ago · link · parent

As a SpacetimeDB dev, I absolutely agree. However, these benchmarks are more than fair. Please read our full technical writeup on the benchmarks: https://spacetimedb.com/blog/benchmarking

comment 3mo ago · link · parent

Since we're asking clankers:

https://chatgpt.com/c/6a886e34-c784-83ea-8298-2d8215f5994a

https://claude.ai/share/658d00e4-550a-470e-b4a3-7a71a06222cb

> In particular, these statements should not be relied on:

> readers wait “up to 0.5 ms” because of parking_lot;

> all reducers/views are Wasmtime/WASM;

> reads normally happen through Views;

> external side effects are merely something reducer authors must avoid;

> durable/confirmed reads are an unusual opt-in intended only > for non-ephemeral data;

> 50 ms is the normal/current durability delay;

> SpacetimeDB has no meaningful replication;

> the benchmark numbers themselves are simply “not true.”

comment 3mo ago · link · parent

I would encourage you to read our technical blog post in reply to this article: https://spacetimedb.com/blog/benchmarking

comment 3mo ago · link · parent

I would encourage you to read our technical write up in reply to this article: https://spacetimedb.com/blog/benchmarking

comment 3mo ago · link · parent

I think you mean it sounds as good as the article says it is. SpacetimeDB is single threaded by design, just like TigerBeetle by the way. The reason we changed from MVCC to single threaded design is that it's simply faster for almost all workloads. Measurably so! With MVCC we were doing more bookkeeping than actual work and perpetually causing cache coherency issues.

"Technically sloppy" is an understatement. The article just gets several things plan incorrect about the durability guarantees, etc.

1234