TigerBeetle is a most interesting database

amplifypartners.com

259 points by todsacerdoti 7 hours ago


blenderob - 4 hours ago

As nice as TigerBeetle is, do keep in mind that this article is written by an investment company that has invested in TigerBeetle: https://www.amplifypartners.com/blog-posts/our-investment-in...

sgarland - 5 hours ago

While I am a fan of TigerBeetle’s general stance on correctness, coding practices, and their desire to hyper-specialize, I have some critiques on the post.

I think the paragraph about multi-node is a bit misleading. Contrary to what cloud native folk will tell you, a single beefy DB, well-tuned and with a connection pooler, can serve a dizzying amount of QPS just fine. At a former employer, during a maintenance period, I once accidentally had all traffic pointed to our single MySQL 8 RDS instance, instead of sharing it between its read replicas. That was somewhere around 80-90K QPS, and it didn’t care at all. It wasn’t even a giant instance - r6i.12xlarge - we just had a decent schema, mostly sane queries, and good tuning on both ProxySQL and MySQL. At peak, that writer and two .8xlarge read replicas handled 120K QPS without blinking.

A DB hosted on a server with node-local NVMe (you know, what used to be normal) will likely hit CPU limits before you saturate its I/O capabilities.

For redundancy, all RDBMS designed for networked activity have some form of failover / hot standby capability.

My other mild criticism is in the discussion on TigerBeetle’s consensus: yes, it seems quite clever and has no other dependencies, but it’s also not trying to deal with large rows. When you can fit 8,190 transactions into a 1 MiB packet that takes a single trip to be delivered, you can probably manage what would be impossible for a traditional RDBMS.

None of this should be taken as belittling their accomplishment; I remain extremely impressed by their product.

dangoodmanUT - 5 hours ago

I really like the work Joran and his team have done around DST, distributed systems awareness, and performance practices. I especially love the craziness around no dependencies (well, could you consider an underlying OS a dependecy?).

But I've always felt the way they treat normal OLTP (they call OLGP) seems unfair. For example, comparisons using clear sub-optimal interactive SQL transactions for financial workloads, like locking rows rather than using condition checks at commit time, because "that's how OLTP was intended to be used when it was designed ~50(?) years ago".

In their cited https://tigerbeetle.com/#performance the lowest the slider can go is 1% contention. Do you think Stripe has 1% contention directly on an OLTP DB? Definitely not.

You can build systems that _expect contention_, and elegantly handle it at REALLY high throughput. These systems protect the DB from contention, so you can continue to scale. From talking to folks working on these systems, I roughly know the kinds of transactional (financial) throughput of DBs like Stripe's and other systems - they have _many_ more zeros behind them than their performance comparison page proposes they could possibly have at even 0.01% contention.

Their marketing largely ignores this fact, and treats everyone like they just slam the DB with junior engineer-designed interactive transactions. Most developers (I hope) are smarter than that if they're working at a payments company. There's even the title "payments engineer" for the kind of person that's thinks about scaling contention and correctness all day.

TigerBeetle is great, but I find the pattern of being quite misleading about other OLTPs off putting.

wiradikusuma - 6 hours ago

We were considering TigerBeetle, but found blockers:

* We use Cloudflare Workers. TigerBeetle client app is not supported. It might work using Cloudflare Containers, but then the reason we use Cloudflare is for the Workers. --> https://github.com/tigerbeetle/tigerbeetle/issues/3177

* TigerBeetle doesn't support any auth. It means the containing server (e.g. a VPS) must restrict by IP. Problem is, serverless doesn't have fixed IP. --> https://github.com/tigerbeetle/tigerbeetle/issues/3073

justinclift - 6 hours ago

> In less than a decade, the world has become at least three orders of magnitude more transactional. And yet the SQL databases we still use to power this are 20-30 years old. Can they hold up?

Errr yes. Without much sweat really.

Just because something started ~30 years ago doesn't mean it hasn't updated with the times, and doesn't mean it was built on bad foundations.

websiteapi - 6 hours ago

All of these apply to FoundationDB as well.

- Slow code writing.

- DST

- No dependencies

- Distributed by default in prod

- Clock fault tolerance with optimistic locking

- Jepsen claimed that FDB has more rigorous testing than they could do.

- New programming language, Flow, for testing.

You probably could solve the same problems with FDB, but TigerBeetle I imagine is more optimized for its use case (I would hope...).

AFAIK - the only reason FDB isn't massively popular is because no one has bothered to write good layers on top. I do know of a few folks writing a SQS, DynamoDB and SQLite layers.

vrnvu - 4 hours ago

I've been applying a lot of principles and suggestions from TigerBeetle style lately, mainly in Rust and Go and I can’t recommend it enough.

- single entry point, near-zero deps

- ci locally and tested, one command to runs tests, coverage, lint etc

- property/snapshot/swarm testing, I love writing simulations now and letting the assertions crash

- fast/slow split + everything is deterministic with a seed

- explicit upper bounds + pool of resources. I still dynamically allocate but it makes code simpler to reason about

Thanks to the TB team for the videos and docs they been putting out lately.

flir - 6 hours ago

> They keep assertions enabled in production.

Never understood why we turn those off. An assert failing in prod is an assert that I desperately want to know about.

(That "never understood" was rhetorical).

SchwKatze - 6 hours ago

Pretty much agree, I honestly think that TB team should invest some more effort on evangelizing the double-entry model for non-financial scenarios, like managing stocks, booking a show ticket etc. The 1000x API improvement has been done, now people must know how to use it

ksec - 5 hours ago

>Most teams write code fast. TigerBeetle tries to write code slow. Most teams treat testing as a necessary evil. TigerBeetle is built entirely on Deterministic Simulation Testing (DST). Most teams build their software on top of loads of other software. TigerBeetle has zero dependencies.

I believe that was more like the norm 25+ years ago. Before Google and Facebook brought in the move fast and break things mentality across software industry.

I hope TigerBeetle gets more recognition. Worth reading its Jepsen report as well. https://news.ycombinator.com/item?id=44199592

theYipster - 3 hours ago

Looking at the Zig vs. Rust angle — an interesting takeaway from the article is that Zig makes it considerably easier to build statically allocated applications than Rust.

For all of Rust’s talk about “safety”, assuming the above assertion is true, than perhaps Zig is a better choice to augment or replace C in embedded, safety-critical software engineering, where static memory allocation is a core principle.

BrentOzar - 6 hours ago

Because I'm sure other people will ask - no, it does not support SQL.

kamranjon - 4 hours ago

I’m somewhat confused by the distributed story for tiger beetle. In the docs here: https://docs.tigerbeetle.com/concepts/performance/#single-th...

It says: “TigerBeetle uses a single core by design and uses a single leader node to process events. Adding more nodes can therefore increase reliability, but not throughput.”

How does this work with multi-region? Does this mean that regardless of where in the world your users might live, they need to make a request to the leader node for a write to occur?

Is distribution purely for redundancy?

sunshine-o - 34 minutes ago

Anybody know of simple way/tool (local, single node) to have strict Debit/Credit consistency ?

Is there an extension for sqlite or simple command line tool that do that?

I know about the ledger cli tool but it a bit much since it is a full fledge double-entry accounting system.

mtlynch - 4 hours ago

It's worth noting that the breathless worship of everything about TigerBeetle in this post is likely related to the fact that the author is an investor in TigerBeetle.[0]

[0] https://www.amplifypartners.com/portfolio/company

novoreorx - 4 hours ago

Why hasn't anyone mentioned the game they made? It looks fantastic. The concept of letting players try to crash a system to demonstrate its robustness is brilliant.

xnzm1001 - 5 hours ago

I work at a bank with old old monstrous sql queries. I thought I can make a use of tigerbeetle to simplify the system. But sadly, I just couldn't figure out how to make it work. Transaction requires lot of business logics but I couldn't convert that to make it work with combination of RDBMS + tigerbeetle. I wish there were some realworld example that I can get insight using tigerbeetle.

initramfs - 5 hours ago

this has such great marketing zingers, I probably didn't know I needed TigerBeetle for something. I don't know yet, but I promise you, I'll find something to use it for.

fjfaase - 5 hours ago

I wonder if the 'debits and credits' example is still realistic. Is it not that banks record all individual money transfers and keep them on record for years (often due to national laws that require this). Then the balance on a certain account is a simply a selection/view on the set of all transactions. For efficiency reasons you may want to store the result in some table. If there is a limit on withdrawals on a certain account, you do need to calculate the balance first and then a transaction mechanism is needed to assure that there are not several money transfer that individually do not surpass the limit but together do.

myflash13 - 3 hours ago

Sounds awesome but can I use it like a regular database for my Laravel/Rails/Django app?

mkleczek - 3 hours ago

While TigerBeetle way is very interesting I find lack of multicore processing support (or any kind of horizontal scaling) a blocker in terms real world deployment.

It is just too risky as there is a hard limit to scalability and while it might look it is high enough for foreseeable future, what am I supposed to do once I reach this limit? Financial database has to be planned with at least 15-20 years of growth in mind.

danielbarla - 4 hours ago

TigerBeetle is plenty interesting, though if half of SpacetimeDB's [1] [2] claims are true, it's even more interesting for me. (The title of this post has "_a_ most interesting database", while the article has "_the_", hence this comment)

[1] - https://spacetimedb.com/ [2] - https://www.youtube.com/watch?v=kzDnA_EVhTU&

itunpredictable - 7 hours ago

hope you all like this post as much as I enjoyed writing it!

gregorvand - 4 hours ago

We did an episode with Joran on SEDaily which addresses some of the points raised in the discussions

https://softwareengineeringdaily.com/2024/09/12/building-a-f...

ducklord - 5 hours ago

What does TigerBeetle stand on the CAP theorem? Sounds like it's AP?

pbowyer - 6 hours ago

> And yet some of the most popular OLTP databases in the world today are still highly dependent on a single node architecture.

Which databases? SQLite is the one I can think of, but it's designed for that use-case. Others start as single node but will replicate to other nodes, either as master-slave or master-master.

- 5 hours ago
[deleted]
gwbas1c - 2 hours ago

OMG as I read this I became hyper-skeptical by the end.

Some points:

In general, in very tangible terms, what are the real benefits for choosing TigerBeetle over another distributed database? What are the target use cases? Most of the article is pontificating about academic details in a way that's putting the cart before the horse. (IE, all these details don't matter when a traditional database with traditional backups is "good enough" and comes with no technology risk.)

Who's using TigerBeetle? For what kind of applications?

https://news.ycombinator.com/item?id=45436926 states, "TigerBeetle doesn't support any auth". Poor security is an unprofessional oversight. For all the ambitious things TFA describes, it's shocking that they overlooked "secure by design."

The above-linked post is the only top-level post in this thread that claims real-world experience with TigerBeetle.

But, here are some quotes from the article that don't pass scrutiny:

> Traditional databases assume that if disks fail, they do so predictably with a nice error message. For example, even SQLite’s docs are clear that:

SQLite is a file on disk. It's not something that would work in the same space as TigerDB. Furthermore, this statement needs proof: Do you mean to say that Oracle, MSSQL, MariaDB, Postgress, ect, can't detect when a file is corrupted?

> All in all, you’re looking at 10-20 SQL queries back and forth, while holding row locks across the network roundtrip time, for each transaction.

These can often be solved with stored procedures. In this case, the problem lies somewhere between programmers implementing suboptimal solutions, and databases being too hard to work with.

> Instead of investing in the technology of 30 years ago – when the most popular relational databases today were built

Don't assume that because technology is old, that it's bad. New databases come with higher, not lower, risk.

> They say databases take a decade to build.

Prove it. No really, prove it.

> Biodigital jazz.

It seems like someone is getting so obsessed with the code that they're forgetting the purpose and use case.

---

IMO:

Figure out the niche where TigerBeetle excels and traditional databases fall flat. Is it because your query model is easier to program with? Is it because, in a particular situation, TigerBeetle is more performant or cheaper? Is there a niche where existing databases corrupt data more than is tolerable.

Once TigerBeetle excels in a niche, expand outward. (This is the basic plan in "Crossing the Chasm." https://en.wikipedia.org/wiki/Crossing_the_Chasm)

Otherwise, this smells like an academic exercise to experiment with different programming techniques, but with no tangible deliverable that has a demonstrated market.

porridgeraisin - 5 hours ago

TigerBeetle looks interesting. A whole networked database using statically allocated memory. I usually use that technique for small keyboard-shortcut triggered applications.

One question in case folks who work there see this:

This is the most technically impressive zig project I've seen so far. Do you have a blog post detailing your perspective on zig? i.e what design decisions of ziglang helped you in massive way, what were the warts, and in general any other thoughts too?

IshKebab - 5 hours ago

> Deterministic Simulation Testing (DST) feels like the most transformational technology that the fewest developers know about. It’s a novel testing technique made popular by the FoundationDB team

It's not novel. That's how hardware (ASIC) testing has been done forever. The novelty is applying it to software.

> TigerBeetle’s VOPR is the single largest DST cluster on the planet. It runs on 1,000 CPU cores

Only if you exclude hardware, otherwise basically every chip design company has a cluster bigger than this.

self_awareness - 5 hours ago

The most interesting database is the most boring one.

bell-cot - 6 hours ago

Consider re-titling it "A very cool & interesting article about a very boring & reliable database"?

Since "interesting" is the very last thing that anyone sane wants in their accounting/financial/critical-stuff database.

igtztorrero - 6 hours ago

I really liked this article. I met the new kid on the block, the DBMS neighborhood. I also didn't know that Zig programming language existed. So many new things. Congratulations to TigerBeetle! I'm going to tell my team about it and try it out on an interesting project.

oowoe - 4 hours ago

hiiiiiiiiiii owo pwp qwq

gayjew - 6 hours ago

[dead]

oowoe - 4 hours ago

hiiiiiiiiii owo qwq pwp