Having built a SQLite-compatible database from scratch in Rust, cloud database provider Turso is attempting something more ambitious: a Postgres-compatible implementation on the same foundation."I don't think there is anything fundamentally wrong with Postgres. If there was something wrong with Postgres, we wouldn't rewrite it," Turso CEO Glauber Costa told The Register. But, like SQLite, Postgres could be freshened up for the cloud-native era.Turso has grander ambitions than putting another notch on the Rustbelt. Its SQLite reimplementation, originally codenamed Limbo and later renamed Turso, uses a virtual machine architecture that the company believes can support multiple database frontends.
This month, Turso-the-company launched the Postgres effort and suggested that the same architecture could eventually support frontends for systems such as MySQL and Redis. "Turso is becoming the LLVM of databases. One modern, reliable core; many database frontends compiled down onto it," Costa wrote, announcing the release.
From fork to rewriteCosta and fellow co-founder Pekka Enberg got the idea for Turso while studying the architecture of SQLite itself. Both had just left technical engineering jobs at ScyllaDB to start a San Francisco startup called ChiselStrike. They needed an online database, and SQLite was an obvious choice, but it needed updating to work as a cloud service. Software developer D. Richard Hipp created SQLite in 2000 as a compact, standalone transactional SQL engine. Hipp has steadfastly kept the scope of SQLite minimal, refusing outside contributors or bloating it with additional features (much like Andrew Tanenbaum kept tight control on Minix, inspiring a young Linus Torvalds to create a much more ambitious Linux).ChiselStrike forked SQLite as libSQL to give the company's developers the ability to modify the database system. It also provided a much-requested avenue for outside contributors to add their own features. At first, contributors added features without making many changes to SQLite's core – not exactly a weekend job, even for an ambitious hacker. More fundamental work, such as introducing a richer type system, would require ChiselStrike to tackle the engine itself. The company therefore launched a complete rewrite, initially codenamed Limbo.By then, ChiselStrike had already pivoted to a SQLite-based cloud service and renamed itself Turso. Limbo later became an official company project, adopted the Turso name – after the mythical Finnish sea creature Iku-Turso – and became the planned foundation for its future database engines.Behind the SQLWhile rewriting SQLite, the duo focused on its virtual machine architecture and concluded that the same approach could be expanded into a more general database execution engine. The software compiles SQL queries into its own bytecode language, called the Virtual Database Engine (VDBE).







