Glauber Costa, co-founder and CEO of Turso, joins us to discuss libSQL, Limbo, and how theyâre rewriting SQLite in Rust. We discuss their efforts with libSQL, the challenge of SQLite being in the public domain but not being open for contribution, their choice to rewrite everything with Limbo, how this all plays into the future of the Turso platform, how they test Limbo with Deterministic Simulation Testing (DST), and their plan to replace SQLite.
Glauber Costa: Oh, happy to do that. And the story - in a sense, itâs still the same story, so I think you hit the nail on the head there. Itâs just really how it started. I donât feel this is a completely different thing, what weâre doing now. The story there is that we were using SQLite in our company. Pekka is my co-founder. We founded a company⌠If you happen to stumble upon it, Iâll just mention it here by a name; itâs called ChiselStrike. And it was in the API space, we were doing a bunch of things, and we were using SQLite very heavily in that company. And the reasons we were using SQLite were reasons I think that a lot of your audience will understand and relate to. Look, you would just do npm install, the name of the package, and then everythingâs there. Your database is there, everything is there, everything works, you donât have to install anything⌠So SQLite for us always had this appeal of a database that is just always working, and then you can build stuff around it, and itâs just always there. So there was always something that was very appealing to us. However, we also stumbled upon this thing a little bit about SQLite not being open source. So let me address that.
SQLite is a public domain software, which is technically a difference that doesnât matter. I think only a lawyer would be concerned with what is the difference between public domain and open source. For all intents and purposes, itâs the same difference between like the BSD license and the MIT license. Itâs minor. Nobody cares. I donât care, and I think nobody else does either. But SQLite is, according to their own website, by the way - this is something that they put in big, bold letters in their website - open source. Again, Iâm not claiming that theyâre wrong to say that. Itâs all good. Open source, but not open contribution.
So when people think of an open source project, there are two things that come to your mind. The first one is the code is open. And SQLite is that. But you also think about â instinctively, âWell, the code is going to be on GitHub somehow, and then if I find an issue, I can go contribute to this project⌠And I have some source of ownership to the code. Itâs not just that I can see the code, I can also modify the code.â So thatâs usually classically one of the tenets of open source. Now, SQLite is not like that. The maintainers of SQLite, the creators of SQLite do not take contributions. This is not something that weâre saying, this is something that theyâre saying.
[07:57] And yes, I mean, I think it happened in the past that people managed to contribute to SQLite in very special occasions, but itâs not a project that is designed to take contributions from other people. So that is how SQLite is.
We started running into a couple of, hurdles with SQLite. Part of that is that we wanted to deploy our SQLite databases to the edge. We wanted to deploy it in a way that was replicated, we wanted to do things like read replicas, and we wanted to put it to run on call for workers, and all things like that. And we considered this a good thing for our project. And technically, we knew we could do it. And for context here, Pekka and I, weâve been working together.
Pekka is my co-founder. Weâve been working together for 15 years now. We met each other when we were both working on the Linux Kernel. Pekka was one of the maintainers. Each one of us worked in Linux for almost 10 years, the first five without knowing each other; I think we knew off each other, but we never met. And in the last five years, very closely to each other, where we developed a good friendship. After that, we actually joined a startup that also became a database company. We spent eight years doing that. So we felt technically like SQLite, all things considered, is pretty simple, given the scope of things that we used to do. So technically, we can make the changes that we believe we can. And so letâs just come up with our own version.
And we saw at the time a lot of people dancing around the subject. Thatâs what we saw. So there were some projects like LightFS that were super-interesting projects. Dqlite⌠We saw lots of people trying to get SQLite to work as a distributed system. The problem that we saw with all of those projects is that they were all, again, dancing around the subject that SQLite cannot be changed, so weâre going to create layers and layers and layers around SQLite to help with that. And for us, it was â technically, this is actually a pretty simple problem. You just have to change SQLite here, here, and here, and youâre good to go.
And I think the last piece of the puzzle, or maybe the two last pieces of the puzzle - number one is that we were very concerned with whoâs going to want to run our SQLite plus patches, because SQLite is a very trusted project⌠So you make random modifications to SQLite, and everybody starts distrusting what youâre doing. So we knew that - look, the solution to this problem is that we should just create an open contribution version of SQLite, because now itâs not like SQLite plus Fink, itâs its own project, and then people come to trust this one project. And with that, the diagnosis that we had at the time was like âHey, SQLite is great code-wise. The thing that is holding it back in our reading is exactly the fact that it cannot take advantage of the dynamism, of the creativity of a truly open source community. So letâs create that.â
And the last piece of the puzzle is that at the time, we were actually discussing âHow do we do this?â And one of the options was maybe we should just rewrite SQLite. And we had a lot of experience in our previous company, Scylla⌠Scylla was a re-implementation of Apache Cassandra and C++, fully compatible. And maybe we over-indexed in the fears that we had going that route. We said, âHey, the problem with Scylla is that it took a long time for us to put in the market. SQLite is much smaller, so maybe we can do it.â But maybe because we had just come from an experience where we wrote a database, we figured that forking was a better strategy.
So at the time, our decision, after much deliberation was âWeâre not going to rewrite SQLite. We are going to fork it instead.â The main advantage is that you have something tomorrow, because you start from a codebase that is already working. And then weâre going to start making changes to that.
[11:59] So that was LibSQL. LibSQL was essentially at the time â and the story of Limbo, if I had to tell the sanitized version in which the fork never existed, it would be the same up until this point, because all of those things, all of that, itâs still valid. Itâs just that at the time, a year and a half ago, we decided that forking was the best alternative. And now - and Iâm happy to go into the why, but now we decided to try âOkay, what if we had done that, one of those options that we considered? What if we just rewrote it?â And then when we put it out there, the results were â Iâve never seen anything like that before. So thatâs the story.