Live data from Hacker News

We put a distributed database in the browser and made a game of it

tigerbeetle.com

11–20 of 64 posts

Re: We put a distributed database in the browser and made a game of it

#11
post #3

I thought tigerbeetle distributes the db on web clients? I skimmed through the docs and cannot find how to design a web app with tigerbeetle like the game https://sim.tigerbeetle.com/

Hey! I'm not completely sure I follow the question. But the game is built a little differently from how you'd typically run TigerBeetle in production. In production you'd run a cluster of replicas (see https://docs.tigerbeetle.com/deploy/hardware#cluster-of-repl... ) and then you'd have your application connect to the cluster using one of our client libraries. The game is more a reflection of how we do simulation tes…

I have a very interactive app with limited data use <10MB. Right now its a lots of different API calls to sync state between server and multiple clients. But if I have a distributed sync protocol (that works), I can replicate the state on each cient and server by tunneling the sync protocol to the server and back. I have reduced a lots of api complexity. My react UI just subscribes to the data changes in the synced DB. Similar concept impelmented pouchdb & couchdb but its a bit outdated.

Re: We put a distributed database in the browser and made a game of it

#12
post #10

This is a sweet idea and a nice, game-esque implementation. It could definitely use some onboarding. There's nothing to give the "player" a hint as to what they should do. What is my goal? Am I trying to defeat the communication of the nodes, or help them? If it's the former, why did I seem to win the first level after doing nothing? I started by trying to mash some keys. Eventually I saw that there were tools in the…

Well the point is that the replication protocol is going to fix all issues no matter what, so you could say that the only winning move is to enjoy watching TigerBeetle move forward impervious of scripted nor human-inputted issues.

In other words, you're going to 'win' no matter what :^)

Re: We put a distributed database in the browser and made a game of it

#13
post #10

This is a sweet idea and a nice, game-esque implementation. It could definitely use some onboarding. There's nothing to give the "player" a hint as to what they should do. What is my goal? Am I trying to defeat the communication of the nodes, or help them? If it's the former, why did I seem to win the first level after doing nothing? I started by trying to mash some keys. Eventually I saw that there were tools in the…

Well the point is that the replication protocol is going to fix all issues no matter what, so you could say that the only winning move is to enjoy watching TigerBeetle move forward impervious of scripted nor human-inputted issues. In other words, you're going to 'win' no matter what :^)

That makes sense: it's not a game at all, but a simulation pretending to be one.

Re: We put a distributed database in the browser and made a game of it

#14
post #13

Earlier quoted context omitted.

Well the point is that the replication protocol is going to fix all issues no matter what, so you could say that the only winning move is to enjoy watching TigerBeetle move forward impervious of scripted nor human-inputted issues. In other words, you're going to 'win' no matter what :^)

That makes sense: it's not a game at all, but a simulation pretending to be one.

never played "walking simulators" then? plenty of games don't feature traditional win-lose mechanics.

Re: We put a distributed database in the browser and made a game of it

#15
> Sure, we’re not yet injecting storage faults, but then formal proofs for protocols like Raft and Paxos assume that disks are perfect, and depend on this for correctness? After all, you can always run your database over RAID, right? Right? > If your distributed database was designed before 2018, you probably couldn’t have done much. The research didn’t exist.

I'm trying to understand this part but something seems off. It seems to imply that those proofs do not apply to the real world because disks are not perfect, but neither is RAM. The hardware for both RAM and disks has an inherent error rate which can be brought down to arbitrary levels by using error correction codes (e.g ECC RAM).

I'm assuming that the TigerBeetle correctness proofs are predicated on perfect RAM even though in reality there is a small probability of errors. This tells me that there is an error rate which they consider negligible. If that's the case what is the difference between:

* TigerBeetle's storage approach

* Paxos or Raft with enough error correction on disk writes that the probability of errors equals that of ECC RAM which is considered negligible

I've probably made a logical error in my reasoning but I can't see it. Can someone enlighten me?

Re: We put a distributed database in the browser and made a game of it

#17
post #3

I thought tigerbeetle distributes the db on web clients? I skimmed through the docs and cannot find how to design a web app with tigerbeetle like the game https://sim.tigerbeetle.com/

Hey! I'm not completely sure I follow the question. But the game is built a little differently from how you'd typically run TigerBeetle in production. In production you'd run a cluster of replicas (see https://docs.tigerbeetle.com/deploy/hardware#cluster-of-repl... ) and then you'd have your application connect to the cluster using one of our client libraries. The game is more a reflection of how we do simulation tes…

What did you use to make the graphics? Thats very cool.

Re: We put a distributed database in the browser and made a game of it

#18
post #16

This is pretty cool from a database perspective but I'm really interested in what they used to write this 'game.'

It's covered a little bit in the Evolution section (add #evolution to the URL and hit enter).

If that doesn't answer everything (it's not a long section, granted) Fabio (captainhorst) is on HN answering questions in this thread already so feel free to ask!

Re: We put a distributed database in the browser and made a game of it

#19
post #17

Earlier quoted context omitted.

Hey! I'm not completely sure I follow the question. But the game is built a little differently from how you'd typically run TigerBeetle in production. In production you'd run a cluster of replicas (see https://docs.tigerbeetle.com/deploy/hardware#cluster-of-repl... ) and then you'd have your application connect to the cluster using one of our client libraries. The game is more a reflection of how we do simulation tes…

What did you use to make the graphics? Thats very cool.

They're handmade by Joy Machs! We credit him in the post. :) https://twitter.com/joymachs

Re: We put a distributed database in the browser and made a game of it

#20

It's very confusing that y'all are calling this a "game". There's nothing to play, it's just a simulation to watch.

There are tools in the upper right corner. You can pick one and use it on a beetle. ;) This introduces various faults in the simulation that the database has to recover from. Minor spoiler: there's another tiny game hidden at the end of the third level.

That adds some interactivity, but I still wouldn't call this a game yet. Games generally have some sort of challenge you must overcome. This is more like a highly polished interactive simulation of a distributed db. Still really cool and well done.
Post reply on HN