HackerTube

"Turning the database inside out with Apache Samza" by Martin Kleppmann

Strange Loop Conference9 HN recommenders · recommended in 9 months, 2015–2025
YouTube
talk · intermediate · evergreen · 2015–2025 on HN

Martin Kleppmann argues that databases are global shared mutable state and proposes treating them as an ever-growing log of immutable facts. Derived data such as caches, indexes and views is then built by stream processors like Apache Samza. The talk draws on…

Commenters repeatedly cite it as the talk that reframed how they think about caching, derived data and event sourcing.

12 comments from Hacker News

@chamomeal2025-08 · in “Replacing a cache service with a database”

Idk I think caching is a crucial part of many well-designed systems. There’s a lot of very cache-able data out there. If invalidating events are well defined or the data is fine being stale (week/month level dashboards, for example), that’s a fantastic reason to use a cache. I’d much rather just stuff those values in a cache than figure out any other more complicated solution. I also just think it’s a necessary evil of big systems. Sometimes you need derived data. You can even think about databases as a kind of cache: the “real” data is the stream of every event that ever updated data in the database! (Yes this stretching the meaning of cache lol) However I agree that caching is often an easy bandaid for a bad architecture. This talk on Apache Samza completely changed how I think about caching and derived data in general: ▶ this video And this interview has some interesting insights on the problems that caching faces at super large scale systems (twitter specifically): link

Strongly recommends View on HN
@chamomeal2025-08 · in “Replacing a cache service with a database”

Hey OP you may have seen this already, but in case you didn’t see my other comment, you should definitely check out this talk by Martin Kleppman. ▶ this video It details Apache samza, which I didn’t totally grasp but it seems similar to what you’re talking about here. He talks about how if you could essentially use an event stream as your source of truth instead of a database, and you had a sufficiently powerful stream processor, you could define views on that data by consuming stream events. The end result is kind of like an auto-updating cache with no invalidation issues or race conditions. Need a new view on the data? Just define it and run the entire event stream through it. Once the stream is processed, that source of data is perpetually accurate and up-to-date. I’m not a database guy and most of this stuff is over my head, but I loved this talk and I think you should check it out! It’s the first thing I thought of when I read your post.

Strongly recommends View on HN
@btown2019-05 · in “Ask HN: What overlooked class of tools should a self-taught programmer look into”

The talk on "Turning the database inside-out" [0][1] by the author, Martin Kleppmann, is a fantastic intro to these dynamics, and it's something I'll always recommend to both experienced and inexperienced data modelers and backend developers. It goes pedagogically through the way things are typically done in a relational database in such a clear way that word-for-word it's one of the best tutorials I've seen... but it also weaves a narrative of "how can this be done better/more scalably/more reliably/more flexibly-to-business-needs" in pointing to a streaming/event-sourcing architecture. You may or not need the latter right away, but it's a fantastic tool to have in your toolbox to be able to say "ah, this new requirement feels like it would benefit hugely from this architecture." Especially for OP who's starting to think about the "why" of messaging queues, this could be a fantastically valuable first step. [0] ▶ this video [1] link

Strongly recommends View on HN
@lbradstreet2018-05 · in “GCP and Confluent partner to deliver a managed Apache Kafka service”

Yes, I like to think of it as as the transaction log without any of the logic. If you’re interested, I can highly recommend Martin Kleppmann’s talk “Turning the database inside out” ▶ this video

Strongly recommends View on HN
@btown2015-04 · in “How Sift Science Rebuilt Its App on React and DropWizard”

Since this is taking off a bit: Here's an excellent talk that provides some context to the Confluent article, and takes us through the thought process of simplifying convoluted database-cache-user interactions by thinking in terms of streams of derived data: ▶ this video . Also highly recommended.

Strongly recommends View on HN