text
stringlengths
0
2.02k
So there are people working on this... Hopefully we'll get there. And they keep bringing up Fauna. So Evan, welcome to the show. Tell me, is this the problem that Fauna is working on, or are people misspeaking?"
**Evan Weaver:** They're not misspeaking. It's one of several problems we're working on. At Fauna historically we've had the "boil the ocean" kind of attitude. The problem we're working on is the problem of the imperfection of the operational database. Edge latency is definitely a big part of that.
**Jerod Santo:** Okay. The imperfection of the operational database... I love that phrase. Can you unpack it and tell us what it means?
**Evan Weaver:** Yeah, so the genesis of Fauna really came from me and my co-founder's experience at Twitter. I was employee 15. I ran what we called the software infrastructure team there from 2008 through the end of 2011. And that was the early days of NoSQL. MySQL and Postgres were big. We started with a MySQL clust...
\[04:20\] We didn't go to Twitter as distributed systems experts, we didn't go as DBAs. We went there as essentially Rails developers. We were frustrated that we couldn't find any off-the-shelf data system that could meet Twitter's needs, delivering a real-time type product at global scale to a consumer audience.
We looked at Mongo, we looked at Cassandra and invested quite a bit in Cassandra open source, and quite a few other solutions, and ended up building a whole bunch of custom stuff in-house... But we never quite got to the general-purpose data platform that we wanted to have. That dream never died for us. People who work...
Fauna is essentially a database as an API, trying to get rid of everything about the operational experience, everything about the metaphor, the physical computer that interferes with your ability to access your data. One of those things is latency variants based on the physical location of the client.
**Jerod Santo:** So my dream as a developer is I have objects in my code - if I'm coding object-oriented - which represent data and logic... And those objects are always there, and they're available, and I can use them, and I can set them aside and pick them back up again... And that's it. I don't have to write to the ...
**Evan Weaver:** A little bit of both. The concept you're describing is sort of the tablespace concept, Lynda being one of the very early example in the '80s, where you would have a giant, globally-available heap, and you could change those records. So it turns out that's not enough in the real-world for data access. P...
So effectively, you can write business logic which runs collocated in the database next to the data, it has that transparent access, like you're talking about... So sort of our goal now -- and this works in Fauna today; people do it all the time, they really like it... Our goal now is to make that experience more seaml...
**Jerod Santo:** \[07:57\] Nor do I have to think about the geographic location of said server, or any of those problems, when we talk about specifically that edge database, or that edge access layer for my data... And if I'm running a Lambda function that happens to be in Singapore, having my data collocated there - t...
**Evan Weaver:** Yeah. Fauna offers global and regional deployments. People don't necessarily want all their data available everywhere for compliance and performance reasons... But you know, we ensure that whatever topology you choose for your database, all your clients will access the nearest region within that topolo...
**Jerod Santo:** So here's a really simple question that probably has a really complicated answer... How do you accomplish this?
**Evan Weaver:** We do quite a few unique things in the database world, in particular for the transactional algorithm. We grew up a little bit on NoSQL; we were experienced with Mongo and Cassandra, and those kind of things... In that era where people said "You have to scale, because if you don't scale, your business w...
That wasn't really acceptable at Twitter at the time, but we had to tolerate it anyway. It's not acceptable in particular for developer productivity, for the general application, or for higher-risk data than arguably tweets usually are. Your usual suspects - ticket reservations, banking, crypto, that kind of thing. You...
That led us when we were prototyping Fauna to pick up an algorithm called Calvin. At the time - this was about four years ago - there were really only two serious algorithms available in the industry for doing multi-region strict serializability for read-write transactions... And strict serializability is the optimal l...
The first algorithm in the industry is the Google Spanner algorithm, and that relies on access to physical atomic clocks to sequence your transactions. Those are hard to get; not as hard as they used to be, but still not generally available. It also relies on bounded latency for accessing as atomic clocks... Because it...
And also, it can be potentially slow, because for a lot of transactions you have to multiple roundtrips to multiple shards, to drop locks into the records and then clean them up once you've made some writes to that data.
We felt, based on our Twitter experience -- Twitter was a global system; there wasn't natural partitioning in the user base the way there was for Facebook when Facebook rolled out school by school in the early days, and you couldn't actually communicate with people outside of your cluster. Twitter was never like that. ...
\[11:53\] We wanted a data system which would support that kind of global access and would still give you an optimal latency experience... And that led us to pick up Calvin, which came out of Dr. Abadi's lab at Yale. Dr. Abadi is one of our advisors now. And that algorithm is a unique algorithm. It's a single-phase tra...
There are a couple key things that have led people in the industry to kind of reject that algorithm originally. The first was that the paper was very opaque, and kind of scary. There's a lot of sections where things are left as an exercise to the reader, there's handwaving about putting locks everywhere, which sounds s...
But in Calvin, if you submit the transaction as a pure function over the current state of the data, so not like begin transaction, do stuff database-side, do stuff application-side, then commit transaction. But if you submit it only as a work that can happen in the database as a single expression, then Calvin will orde...
**Jerod Santo:** Anybody else out there that you know has grabbed Calvin and run with it like you guys have?
**Evan Weaver:** Yeah, there's Yandex... After we did our work, Yandex eventually released a system that they had built internally initially, which does SQL with a Calvin-inspired system... Then also, Facebook has an internal system which shares some similarities that also popped up somewhat concurrently, maybe a littl...
**Jerod Santo:** Well, I was googling Calvin while you were talking about it and I've found a nice blog post on -- I think it's called Fauna.com, called "Spanner vs. Calvin: Distributed consistency at scale" by Daniel Abadi, back in 2017. We will link that one up for people who want that comparison... Because I haven't...
**Evan Weaver:** For a while we had a serious technical marketing challenge here, because if you remember the NoSQL vendors, like Datastax and those guys, they would bang on forever about how distributed transactions were literally impossible, and you should just abandon hope of enforcing transactional consistency in y...
\[15:56\] At the same time, you have the Postgres crowd, you have the Redis crowd saying "Well, you don't need scale. Just get a really big server, do everything with a really big lock. Locks will get faster over time. Moore's Law will never end." It did end, but putting that aside, it theoretically could start up agai...
So Google sort of paved the way and convinced people with specialized hardware and a ton of gruntwork you could actually get something which was better than the primary/secondary replication system for transactional data. But then we had to extend that and prove, through our blogs, through the Jepsen report, that kind ...
**Adam Stacoviak:** For the uninitiated, can you break down what the CAP theorem is?
**Evan Weaver:** So the CAP theorem says that you can't have consistency, availability or partition tolerance all at the same time. Basically, you've got a bunch of nodes on the network, you want them to be perfectly synchronized - well, if you lose your network link, then either they become unsynchronized because they...
The P is kind of weird, because you can't be partition-tolerant. Saying you're partition-tolerant means you have a perfect network that can never partition, which is not the real world. But people read this as a theory; it's in the name, the CAP theorem. It's not a physical limitation on how data can replicate... And i...
So probably the best way to describe Fauna is big C, small A, big P. So we'll never give up consistency; worse come to worst, consistency will be maintained, while availability is sacrificed. So in practice, availability is essentially never sacrificed, because the algorithms are fault-tolerant. They can route to other...
**Jerod Santo:** That's interesting, you have kind of two angles of routing around, from two perspectives. When you combine those from the client-side routing, like the network routing of the client to the database network side, you're saying that you basically can just minimize those to where it's rarely a problem.
**Evan Weaver:** Yeah. A key thing about making this work is making sure that every step of the communication process knows how correct it is. One of the unique things about Fauna is that Fauna is natively temporal. So all data has a versioned timestamp, and you can look back in history for audit purposes, or show a ch...
**Adam Stacoviak:** \[20:16\] Any chance you're a Silicon Valley fan, Evan? The show Silicon Valley...
**Evan Weaver:** I saw a couple of episodes... It was pretty close to home in terms of my Twitter experience, so I don't think I've found it as humorous as others... There were some early Twitter engineers who can summon a --
**Jerod Santo:** A little painful to watch?
**Adam Stacoviak:** Jerod loves it when I bring it up, because he's not a big fan, or he hasn't gone (I guess) all the seasons, and I -- it's just so close to home, really... Because this is a big thing that they did, they solved for at least, with this algorithm that was essentially the plot theory of the whole show.....
**Evan Weaver:** Yeah, that's accurate. It's not enough to say the database is available or not either. It's a much more nuanced real-world question, like "Is it fast enough? What level of correctness did you explicitly request? In what period of time do you want your data to be searched from? That kind of thing.
The history of operational databases, I think, is a little -- like, database development lags other infrastructure software development, because it's harder. It's one thing if your compute node or something craps out and you have to start up a new one. You lost a couple of requests, but that's basically it. If your dat...
So what we ended up with was -- you know, the RDBMS is basically designed to be put in a closet, in a physical office building and accessed from PCs. That was sort of the Microsoft Access model, the SQL server model, the Oracle model. You'd run these rich clients on desktops, which would have a relatively reliable netw...
**Adam Stacoviak:** Refrigerators even. My washing machine in the other room has got Wi-Fi access, you know? I've got it on a WLAN, of course, because I don't want anybody hacking my house through my LG model L -- I'm just kidding around. Giving access key essentially to my network, but... It's on a WLAN, but the point...
**Evan Weaver:** Yeah, and they move. Think about a corporate deployment in like a store, or something... Like Hertz. Hertz knows which cars and which team members, and who's running from which site, most of the time; the data doesn't move around at high frequency, but when you have people playing mobile games, and doi...
\[24:26\] But you still have to think about what it is, like, "How much capacity do I need?" And no one knows how much capacity they need. So you either provision way too much and you pay for all this wasted capacity, wasted resources, you literally waste electricity keeping those things on... Or you don't deploy enoug...
All these problems are problems of the metaphor, the physical machine. And if you use something like Stripe, for example -- you know, you never think about "Which Stripe node am I gonna deploy, so I can accept credit cards?" The concept doesn't make sense. And we want that concept to disappear for data too, so that it ...
**Break:** \[25:23\]
**Jerod Santo:** So when you say Fauna is an API - I think we all at this point know what that means in terms of how I'm then using it. It also has a database layer. It brings me a little bit of apprehension, because it's kind of like, I get access to an API, and then I get my access removed to an API... And my data is...
But open up with Fauna is an API, unpack it some more, and then let us know what that all means. What does that end up meaning for me as a user?
**Evan Weaver:** Yeah, the API experience really is the web experience. This idea that you can use standard interfaces to access data from anywhere. You don't care where you are, and you don't care where the server you're talking to is. You don't have to go over a secure link, you don't have to be within a special netw...
\[27:51\] We want the database to be just like using any other web service. You're right, that comes with some downsides; in particular, operational transparency is not a given when you're not deploying your own server. You don't have any administrative access to the underlying hardware, you can't go inspect the VM, yo...