Skip to content
0:00 / 0:00

#apachesamza#apachekafka#martinkleppmann

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

Strange Loop Conference

88K subscribers • 107 videos on Hallway • Conference channel

YouTube
  • Recommended by 9 people: 9 on Hacker News.
  • A classic. People kept recommending it from 2015 to 2025.
  • Presented by Martin Kleppmann
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

205K views12 years ago9 recommendations

Databases and dataDistributed systemsDatabase internalsKafka and stream processingConcurrency and parallelism

Martin Kleppmann proposes treating databases as stream-processed logs of immutable facts rather than shared mutable state.

Databases are global, shared, mutable state. That's the way it has been since the 1960s, and no amount of NoSQL has changed that. However, most self-respecting developers have got rid of mutable global variables in their code long ago. So why do we tolerate databases as they are? A more promising model, used in some systems, is to think of a database as an always-growing collection of immutable facts. You can query it at some point in time — but that's still old, imperative style thinking. A more fruitful approach is to take the streams of facts as they come in, and functionally process them in real-time. This talk introduces Apache Samza, a distributed stream processing framework developed at LinkedIn. At first it looks like yet another tool for computing real-time analytics, but it's more than that. Really it's a surreptitious attempt to take the database architecture we know, and turn it inside out. At its core is a distributed, durable commit log, implemented by Apache Kafka. Layered on top are simple but powerful tools for joining streams and managing large amounts of data reliably. What we have to gain from turning the database inside out? Simpler code, better scalability, better robustness, lower latency, and more flexibility for doing interesting things with data. After this talk, you'll see the architecture of your own applications in a completely new light. Speaker: Martin Kleppmann @martinkl Martin is committer on Apache Samza (a distributed stream processing framework), software engineer at LinkedIn, and author at O'Reilly (currently writing a book on designing data-intensive applications). He invented the infamous "LinkedIn Intro" email proxy. Previously he co-founded and sold two startups, Rapportive and Go Test It. He is based in Cambridge, UK.

Why it's here

9 people recommend this

What people say. Highly recommended as a mind-expanding talk that fundamentally changes how engineers think about databases, caching, and event streams.

btownon Hacker News • Recommends

On “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: link to this video . Also highly recommended.

lbradstreeton Hacker News • Recommends

On “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” link to this video

btownon Hacker News • Recommends

On “Ask HN: What overlooked class of tools should a self-taught programmer look into”

…cing 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 link to this video 1 link…

chamomealon Hacker News • Recommends

On “Replacing a cache service with a database”

…ink 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: link to this video And this interview has some interesting insights on the problems that caching faces at super large scale systems (twitter specifically): link…

chamomealon Hacker News • Recommends

On “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. link to 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 i…

felipesabinoon Hacker News • Recommends

On “Real-Time Full-Text Search with Luwak and Samza”

Samza's author really opened my mind related to how useful stream process is to high performance data processing 1 and I think Samza's only bummer (for me, personally, today) is it's lack of support for non-JMV languages 2 1 link to this video 2 link

pramodliv1on Hacker News • Recommends

On “GraphQL-enabled event sourcing engine”

If you want a more modern and concrete example, the "Turning your database inside out" talk by Martin Kleppmann is pretty good too: link to this video

z1mm32m4non Hacker News • Recommends

On “Alan Kay on the misunderstanding of OOP (1998)”

…e of truth for what happens upon any given message. And for Apache Samza, I think this video1 does a nice job of talking about stream processing as a programming architecture. There's a connection to be made between processing streams of information and processing messages between modules, and that video goes a good way towards exposing it. 1: link to this video "Turning the database inside out with Apache Samza"…

je42on Hacker News • Recommends

On “Kafka Is Not a Database”

Indeed. Known the tools and apply the one that has least cons and most pros ;). Also, a good starter to for knowing how to use a Streaming Store like Kafka as DB is the video Database inside-out. link to this video

dmitryminkovskyon Hacker News • Recommends

On “The Reactive Monolith – How to Move from CRUD to Event Sourcing”

I second this wholeheartedly because this happened to me. I'm the kind of person who learns by my making my own mistakes (as opposed to learning from others', which is what smart people do)—and boy, did I learn a lot from the mistake of trying to build a general purpose application with event sourcing. Theoretically, event sourcing is the way all applications should be built. I was first taken by this methodology by Martin Kleppmann's talk "Turning the Database Inside Out" (2014)0. Looking back, I think I had always subconsciously felt like there was something wrong with mutating state in place. You lose information. You lose accountability. After all, "accountants don't use erasers," and…

avinasshon Hacker News • Recommends

On “Ask HN: Append-Only SQL Schema?”

I think you would love this talk by Martin Kleppmann - Turning the database inside out with Apache Samza: link to this video He basically explores similar idea, you have a log to persist and materialised views to query.

u/liberalogicain r/haskell • Mentions

Turning the database inside out I recently stumbled upon this post and this video about systems architecture. Even though the video is old and not strictly related to Haskell, i find it relevant for this channel and for the Haskell community in general. Sometimes we spend time catching up with systems which are old in their design anyway, while being creative is one of the things that pushes a community forward. I use CouchDB every day in hard development conditions at eHealth Africa and it helped us enormously with its essential and robust design, which i believe is inspired by the concepts presented in the video. Maybe the next revolutionary database will be written in Haskell? ;)

atrilumenon Hacker News • Mentions

On “Mostly Adequate Guide to Functional Programming in JavaScript”

Immutability is useful everywhere in the stack, even the database. See "Turning the database inside out with Apache Samza" by Martin Kleppmann: link to this video

rapindon Hacker News • Mentions

On “Reactive GraphQL”

The idea of changefeeds / subscription cursors has been around for a while now, especially in Meteor. I doubt it'll be that crazy to add reactivity to graphql queries when compared to what Meteor is already doing w/ subscriptions and DDP. RethinkDB for example has changefeeds built in and is tackling this problem as well. See: link Data as a stream is pretty interesting too: link to this video

ZenoArrowon Hacker News • Mentions

On “Andl, a relational language that is not SQL, is coming to Postgres”

> "The trouble with this is that the database is the hardest part to scale." Probably depends on the plan followed for data replication, as some approaches seem to make it easier to add new DB nodes as you scale. I've not tried it myself, but I think Apache Samza has some promising ideas in this area: link to this video

ZenoArrowon Hacker News • Mentions

On “Bottled Water – Real-Time Integration of PostgreSQL and Kafka”

Previous discussion: link IIRC this works closely with Samza. There's a decent video by the author knocking around somewhere. EDIT: This is the video I was thinking of: link to this video