Loving @tursodatabase these days. By using their embedded replicas I reduced average load times on one of my web apps from 5.03 seconds to only 58ms !!! #buildInPublic
Turso Embedded Replicas are fast. But that's only one of the many benefits of this new architecture.
Here’s a dirty secret about all databases: when you fire a slow query, it’s not just your query that gets slow. It gets slow for everybody. This is a phenomenon that exists whether you’re using a SQL or a NoSQL database, and it’s common with shared resources. Ever heard of how one home can bring down the property values of all homes around it? Similar issue.
That is why you’ll typically have so many layers, both in software and organizationally, to make sure that access to the database is carefully controlled. Those layers of people and processes slow organizations down. Thankfully, Turso offers a way to resolve these organizational issues, allowing your teams to move faster without disrupting operations, while delivering low latencies.
Turso is a client-server database built on SQLite. Usually, you interact with Turso on a local file, as you would with SQLite, but then run it in production over our HTTP-based protocol.
But there’s a mode of operation that allows you to achieve the same microsecond-level latencies that you can achieve with local SQLite, while keeping all the production benefits of a Turso database: Embedded Replicas.
Periodically, the replica will reach out to the main database, and sync the changes to a SQLite file. You can sync to as many files as you want, and then can be anywhere you want, including multiple servers and mobile devices. This works well regardless of the size of the database, since only the new changes are replicated.
One of the top reasons developers use Turso’s Embedded Replicas is because once the data is replicated locally, there is no more network latency involved in reading the data. From milliseconds, your queries will go to microseconds. And in aggregate, for any API that is doing multiple queries, that means that can be the difference between multi-second responses and millisecond responses.
Loving @tursodatabase these days. By using their embedded replicas I reduced average load times on one of my web apps from 5.03 seconds to only 58ms !!! #buildInPublic
However, that is another big benefit of Embedded Replicas, that has the potential to transform how your organization uses databases
The cost to keep a replica in sync depends only on the amount of bytes transferred. But once the data is transferred, there is no more impact on the main database. All queries are local to the application server issuing them.
You can write the slowest, most inefficient query in the world. Nobody else will suffer. Another advantage of this model is that performance issues, if any, occur in a system the developer understands and does not need to ask for help to debug. They happen right there, on their server, in a way that they can profile using tools they are already familiar with.
The result is that everything in this equation is faster:
Developers all want software that runs faster, and organizations want software that is delivered faster. Access to the database is often heavily mediated, since it is a shared resource. The risk of queries going awry and disrupting everyone is too high.
Turso tackles both problems at once. It replicates your data back to a SQLite file, allowing developers to each operate independently in a copy of the database.
Try Turso Embedded Replicas today for free at turso.tech