Lobsters - 03 Dec 2026
Page 1 of 2
Interview with Dov Alperin from Materialize on (streaming) databases
Dov Alperin is a developer at the streaming database company Materialize. He joined after three years at Fly.io, where he started working at the year he finished high school.
This article is part of a series interviewing developers (not founders, not executives) working on software infrastructure to understand their work, how they got here, the projects they're proud of, the incidents they've learned from, and what they're curious about.
Dov (LinkedIn, Twitter) is a developer at the streaming database company, Materialize, where he has worked since 2025. Before that he spent three years at Fly.io, which he started working at the year he finished high school.
What was your first computer? First program you remember writing?#
An old HP Compaq 6910p Notebook PC (I went to my parents' house and dug this out of my childhood room to identify it) that my dad's job didn't correctly decommission.
Later my first my laptop was a mid-2012 13-inch Retina MacBook Pro issued to me as assistive technology for a learning disability I struggled with growing up. It similarly was never correctly decommissioned, and in fact you can pry it from my cold dead hands. I owe a lot to that machine and still have an emotional attachment to it; in many ways that box is where it all really started for me.
The first program I remember writing was in elementary school on my Mom's Mac. I had gotten it in my head with a friend that we wanted to build a robot for the science fair. My father did some research, cobbled together some parts from some guide or kit or another, and we built a little robot named Major Tom. My Dad, in spite of not being a programmer, felt strongly that if we were going to learn to program the little microcontroller at Major Tom's heart we would do it the right way. My friend and I took turns typing the code in line by line, at first from some guide, and later tinkering once I had caught the programming bug.
You started contracting at Fly.io in May 2022, the same year you finished high school. How does a high schooler end up writing code for an infrastructure company?#
In high school I started a small (read: just me) consulting/webdev shop. A bunch of local businesses, non-profits, one small-ish real estate company. A bunch of PHP, a bunch of WordPress, JavaScript etc.
During my last year of high school I had been looking for a new place to host mostly stateless apps for customers and my own projects. As an avid HN reader at the time (and still today, we all have our vices alright?), I was introduced to Fly, and I really liked the whole ethos.
After playing with it for a bit I went looking for a way to manage my Fly apps through IaC. I found several threads on the community forum similarly bemoaning the lack of Terraform support. I figured "how hard can it be" (this is a dangerous, if not fairly productive form of hubris) and started building one and posting about it on the community forum.
Joshua Sierles who did a lot of early DevRel at Fly reached out to me to talk about it, and pointed me to the (then) unreleased Fly Machines API docs which he thought I would find interesting. His third message included "On the side note of sponsored work - would you be interested in doing some more Golang work for Fly?" This, like being issued my first real laptop, is likely among one of the more consequential turning points of my life and work.
It's my recollection that I didn't tell them I was still in high school until after I had negotiated a rate. Sort of a last-minute "hey before we sign there is something you should know... y'all ok with this?" Thankfully they were.
That's hilarious. So you already had a great job, why'd you stick through university?#
I haven't actually finished yet! Don't jinx it!
In all seriousness, I spent my first two years of college being a full time student and a full time employee at a startup and it was really hard. I didn't sleep much. In retrospect I should have realized earlier that something had to give.
I switched to part time in a program at RIT called the School of Individualized Study (SOIS). I'm still working through my degree there. They allow me to count my work experience towards credits which is huge.
The why of it all is a little harder to put my finger on and my conviction is pretty variable day by day, but if I had to point to a reason behind it it'd be "because I want to". I came so far, half a college degree worth of working super hard to be able to have both the job and the degree. I didn't want to give it up entirely, especially since I have the unique opportunity of SOIS to make finishing possible. Now I get to take classes that interest me or fill in gaps I feel I'm missing. And then eventually I'll have the degree, which is always nice to have especially if I wanted to do something like a PhD in the future.
What did you work on at Fly.io?#
A bunch of stuff! I sort of split it into three acts.
My first real project was working with Shaun Davis on postgres-flex. The goal was to build a robust, production-ready Postgres setup users could deploy into their own Fly application. It replaced our Stolon-based setup with repmgr from EDB for replication and failover, PgBouncer for pooling, and some glue code written in Go that let replicas coordinate and be configured via Consul.
After that I spent a year working on our Machines/volumes infrastructure. Machines are Fly's microVM product. My biggest contribution there was building Fly's first implementation of rebalancing Machines across physical hosts. Flyd, our custom orchestrator that replaced Nomad, pinned machines to physical hosts. That meant if you tried to start a stopped machine on a host that was oversubscribed, or a host was failing and needed to come down for maintenance, you were out of luck. I built the first version of JIT rebalancing on start, and laid the groundwork for operator tooling to drain hosts.
My last ~year at Fly I spent on networking, mainly our proxy/routing software, fly-proxy. I shipped a feature called "virtual services": load-balanced services that aren't tied to individual machines. You could put multiple pools of machines behind one service and route between them by request path or split traffic by percentage.
This was a big effort and I was super proud of it. It was built as an internal platform primitive, and things like the (now defunct) managed Kubernetes service, and by extension the managed Postgres offering's network layer, were built on it.
I also worked on splitting fly-proxy and our state layer, Corrosion, into regional clusters to limit the damage from failures.
What's hard about running Postgres for other people?#
Other people. Kidding, but only sort of.
For a while we spent a bunch of time unsure whether to offer managed or unmanaged Postgres. pg-flex, we decided, was unmanaged meaning that we wrote the software but once customers deployed it into their account it was their responsibility. But we still offered convenient ways to deploy and upgrade built-in to the Fly CLI. In retrospect this was confusing and bad expectation setting and made everyone unhappy.
As the eventual mea culpa we sent out said "We set RDS expectations with something that was essentially just a bunch of scripts and flyctl Go code. When we couldn't meet managed database expectations, users were deeply disappointed." Fly ended up building a managed Postgres offering. It's good! I use it to this day.
I'm realizing now I've answered a slightly different question than the one that was asked, oh well. There are a lot of hard things about operating Postgres as a service but this anecdote is one I come back to relatively often because we spent a lot of time trying to solve a product question as a technical one.
Can you tell us about a time you took down production? What happened, how bad was it, and what did you learn?#
Oh man. Shortly into my tenure at Materialize I shipped a change to how the storage engine performs compaction.
Without going into obscene detail, the way compaction used to work is that it would make incremental progress, but wait to commit that progress until the full compaction run was done. This led to potentially wasteful work. If a node dies while having done 99% of the work of compacting two large batches, all that work would be wasted. The idea was to commit the incremental steps.
Various edge cases and bugs later it became clear (only once it was in production) that the code that applied incremental batches could confuse them for whole batches, thus losing data. This is the cardinal sin of a storage engine. A massive incident ensues tracking down which environments hit the edge case and were affected/etc.
I beat myself up pretty hard about that one for a while. Intellectually I am a fervent subscriber to the takes long drag theory of incident response, but when it's your mistake as the inciting incident it still stings.
On a technical level this incident has definitely reshaped parts of my brain in terms of how to articulate checkable invariants before you start building something (for example the storage engine will now not take a breath without checking it doesn't change a batch's sum-of-diffs). And it's also given me the QA bug of making sure that however you are validating your system sufficiently covers all possible (within reason) production configurations.
You then joined Materialize in March 2025. What drew you to building a streaming database?#
PlanetScale had a product called Boost, a really cool idea where you could "boost" a query and they would assemble a dataflow of your query downstream of Vitess replication streams, and using Noria style up-queries. The whole idea of somehow "magically" computing changes to a SQL view on push was instantly fascinating to me. So I read the Noria paper, which led me to the Timely and Differential Dataflow papers, which led me to knowing about Materialize, at which point the incremental computation and view maintenance bug had totally taken hold of me.
Slightly later on I met Frank and we had a long conversation where I ~~harassed~~ asked him lots and lots of questions about some of the finer details of timely progress tracking. A few months after that I had the opportunity to interview at Materialize and I took it. The opportunity to work on the edge of the DB literature but also on a real product that people use and like (hopefully) has been really fulfilling.
For readers who haven't used it, what problem does Materialize solve? Why not a cron job that reruns a query?#
Most folks who deploy software at scale have data that is constantly changing in a bunch of different operational data stores: Postgres, MySQL, Kafka, SQL Server, CSVs in S3 (yes, really), whatever. But they also want the ability to run arbitrarily complicated SQL (joins, aggregations, recursion) over that data. And preferably they'd also like that data to be correct and up to date. It is traditionally hard to get a system that meets all three of these requirements.
Materialize aims to achieve all three. You hook Materialize into your various data sources, and then you write your SQL views against the data. It computes the result, then keeps it current as the results change. Crucially it only updates the part of the data affected by each change rather than starting over. In a traditional RDBMS if you have a billion rows, and you change one you have to rerun your whole query to get an updated result; we avoid that.
Running a query on a cron job totally succeeds at allowing you to write arbitrary SQL (there are plenty of batch engines which will do this) and make sure it's correct but it trades off freshness. The other non-obvious thing it trades is consistency. We guarantee in Materialize that all views are always transactionally consistent. This is much harder to do with various cron jobs running different queries at different times.
What have you been working on at Materialize recently?#
In order to efficiently maintain arbitrary queries we often need to build a bunch of intermediate state. For instance given a join R R.id = S.id S we need to store R and S "arranged by" id, which is to say (basically) R and S indexed by id. The implementation of arrangements can mostly be thought about as a Weird LSMT (TM). There are a few other kinds of intermediate state in Materialize but this is the big one.
Arrangements are a concept from Differential Dataflow, and in many ways the architecture of today's Materialize can be largely thought of as a SQL to DD compiler. TD and DD lets you write data parallel computation but was designed to assume that once the data is in the system, it's in memory. At best a cache line away, at worst a memory access. This has a number of appealing properties: memory is fast, you don't have to worry about async scheduling/IO, the abstractions are pretty clear and direct.
That said, I'm not sure if you are familiar with the price of RAM right now but it's not getting any cheaper, which is a tough spot to be in for customers who want to put larger and larger workloads onto Materialize. The goal of a truly "out-of-core" Materialize (name borrowed from out-of-core algorithms) has been around for a while. First with a custom allocator called lgalloc which is backed by memory-mapped files, then with good ol' OS swap. But finally we have been working to design, build, and deploy a real buffer manager to spill to disk in a principled way.
This requires rethinking a number of details throughout the timely->differential->materialize stack and also involves a lot of work to reorient various parts of mz to use larger "columnar" allocations rather than tons of tiny Row allocs.
I've been doing this work with the incomparable Moritz Hoffman, and we've been writing about it on the Materialize Blog. I'm hoping to release more technical details soon as well.
What's it like being compatible with Postgres without being Postgres?#
With the benefit of hindsight, I think supporting the Postgres wire protocol was obviously correct, but we could loosen our commitment to adopting Postgres semantics so directly. Postgres error and expression evaluation semantics are wildly underspecified. For example, the Postgres docs explicitly leave evaluation order undefined, so whether a query errors can depend on whichever plan the optimizer spits out. That's a little weird in the base case, but less tolerable when the query doesn't just go away and is instead a view you need to maintain long term.
And in the ways that Postgres semantics are at least predictable, they often don't map well to a "streaming" worldview. I think everyone largely agrees that we should try and formalize some semantics in Materialize, even where it might break strict Postgres compat, but there are only so many hours in a day/days in a year. We'll get there eventually. Also, the answer to this question is probably a whole separate blog post, and we should write one.
Since you've worked on Materialize's Iceberg sink; who's asking for it, and what is hardest about getting streaming data into Iceberg?#
Materialize is decidedly for operational data, questions like "what's goin' on right now", we aren't great at questions like "maintain this view for the last five years of data." But Materialize has done all the work of crunching through the raw data to turn it into data products, and customers wanted a way to send the output of those computations into analytical systems for historical and analytical purposes.
Iceberg has clearly won as the lingua franca of data interop between systems and so was the obvious choice for us when thinking about this problem. The big issue we had implementing Iceberg support was a bit of an impedance mismatch between the goals of the Iceberg spec and Materialize. Materialize wants to keep information constantly up to date, whereas Iceberg is not made for that. If you commit to Iceberg once a second that means writing multiple files to S3 per second which readers and compactors have to deal with (and evidently don't entirely love).
We ended up allowing the user to specify a "commit interval", allowing them to configure the tradeoff between freshness and read performance.
The other big problem was consistency. Correctness is one of the big selling points of Materialize and whenever we build a new source or sink we go to great lengths to make sure we can offer strong guarantees at the bounds of our system.
What would you change about Iceberg if you could?#
I think the Iceberg goal of the data in the bucket being fully self-describing is noble. But I think that focus and desire to avoid leaning on some external database led to some unfortunate ergonomic decisions like: "you have to rewrite the whole manifest every time you want to append to the table." And after all of that, most Iceberg catalog deployments require a relational datastore anyway!
That said, the Iceberg team is great, and the v4 single-file-commit work is heading in the right direction. But honestly, I'd be hard pressed to do a better job than DuckLake for how I think something like this should work.
How do you debug a wrong answer in a streaming system?#
One nice thing about Materialize is that we encourage users to de-compose their logic into smaller views which can depend on each other and be reused. If you have some weird behavior in a leaf node, you can walk the directed graph backwards looking for the source of the error/confusing behavior/performance issue.
We've also built strong introspection into the product itself which allows us to dig into details about specific dataflows at runtime, and we've built user facing tools on top of it like EXPLAIN ANALYZE.
Incremental view maintenance gets hard with joins, aggregates, and late or out-of-order data. Which query shapes are still hard to keep up to date, and what does Materialize do about them?#
We have all sorts of cool tricks up our sleeves. Sharing arrangements across queries to avoid duplicate work. Delta Joins to handle multi-way joins by building one dataflow path per input. Various bits of join lowering to allow for more efficient reuse. Hierarchical reductions allow us to maintain MINs and MAXes with logarithmically bounded amounts of work by splitting each group into small hash-based subgroups, reducing them and feeding the results into coarser rounds. We have various monotonic specializations for things like top-Ks. We support recursion.
And late data isn't a special case for us either; every piece of data has a timestamp and we only report results once the inputs are complete through that time.
How does working on a database compare to working on a cloud platform? Which bugs are harder to find?#
Next page | More Lobsters | Headlines
Original: https://theconsensus.dev/p/2026/12/02/interview-with-dov-alperin-of-materialize.html?focus=1