The TigerBeetle team writes about its financial transactions database, written in Zig, covering testing, design, and coding style.
Commenters praise its TigerStyle guide and its testing approach, and the founder explains how transaction contention hurts SQL row locks.
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…
This is very much alive for internal tools, but the importance of design from a product perspective has proven important, which is why you don’t see much in products anymore.
This is revisionist history. Desktop environments had become so complex and fragmented that just writing HTML & CSS seemed incredibly appealing. "the importance of design from a product perspective has proven important" is unsubstantiated, and is justification after the fact.
Those are just buzzwords, what exactly do you mean by this?
A focus on information vs a focus on 'engagement'. Knowledge vs addiction. Feeling better after using a computer as opposed to feeling worse.
SQL is alive and well, granted newer programmers don’t learn it as early as they should
Unfortunate use of words on my behalf, see: https://news.ycombinator.com/item?id=38243753
static memory allocation
The tigerbeetle database is all statically allocated and (as I understand) makes no memory allocations as a response to use requests. They seem to be having great success with this approach.
https://tigerbeetle.com/blog/a-database-without-dynamic-memory/
Another buzz term. Software is constantly designed and the design of software is constantly discussed. What exactly do you mean by this? Who forgot what?
I don't feel like this is a buzz term. Agile or whatever one wants to call sprint based work flows means no serious design gets up front anymore, and so we constantly try and code our way out of anemic or non-existent…
I believe TypeScript and Rust are both strong examples of languages that do this (for different reasons and in different ways).
It's also possible for a language to raise the ceiling of software quality, and Zig is an excellent example.
I'm thinking of "floors" and "ceilings" as the outer bounds of what happens in real, everyday life within particular software ecosystems in terms of software quality. By "quality" I mean all of capabilities, performance, and absence of problems.
It takes a team of great engineers (and management willing to take a risk) to benefit from a raised ceiling. TigerBeetle[0] is an example of what happens when you pair a great team, great research, and a high-ceiling language.
[0] https://tigerbeetle.com/
> Bun has had an extremely high amount of crashes/memory bugs due to them using Zig
This just sounds like they are not good at using Zig. I have been daily driving ghostty on linux for a fairly long time now and I have never seen these kinds of issues. I have also used ghostty on macos for a bit and didn't have any problems there either.
Zig is really good for writing stable and reliable code. There is also a database written in Zig that seems to be fairly successful [0].
I also wrote zig for some time and compiler/toolchain was really pleasant to use. I wrote more segfaults in Rust ffi code than all segfaults I had in Zig in total while I was writing Zig.
[0] https://tigerbeetle.com/
The test simulator/game starts at ~17:50
For those jumping to the comments wondering if it's worth watching: TigerBeetle[0] is a database for managing financial transactions. They extend the testing practices of FoundationDB (now spun out into Antithesis[1]), going a layer deeper to test for data integrity when there is disk io corruption (~20:30)
In the demo, they have created a game-like simulation that runs in the browser. You can watch Joran "attack" database nodes and simulate corruption. The entire presentation is impressive and the simulator is very entertaining.
[0] https://tigerbeetle.com
[1] https://antithesis.com
Read TigerBeetle's own
* A Database Without Dynamic Memory Allocation[1]
* A Programmer-Friendly I/O Abstraction Over io_uring and kqueue[2]
* Writing High-Performance Clients for Tigerbeetle[3]
[1]: https://tigerbeetle.com/blog/2022-10-12-a-database-without-dynamic-memory/
[2]: https://tigerbeetle.com/blog/2022-11-23-a-friendly-abstraction-over-iouring-and-kqueue/
[3]: https://tigerbeetle.com/blog/2023-02-21-writing-high-performance-clients-for-tigerbeetle/