Why SQLite is so great for the edge
blog.turso.tech
Why SQLite is so great for the edge
1–10 of 148 posts
Re: Why SQLite is so great for the edge
#2Re: Why SQLite is so great for the edge
#3Postgres can run locally, communicating via a Unix socket. You should try benchmarking this before stating that it's so much slower than SQLite.
Re: Why SQLite is so great for the edge
#4> It’s borderline impossible to compare it against networked database management systems like MySQL or Postgres, because SQLite is a library that operates on a local file — it bypasses all the costs incurred by the network, layers of serialization and deserialization, authentication, authorization, and more. Postgres can run locally, communicating via a Unix socket. You should try benchmarking this before stating tha…
Re: Why SQLite is so great for the edge
#5> It’s borderline impossible to compare it against networked database management systems like MySQL or Postgres, because SQLite is a library that operates on a local file — it bypasses all the costs incurred by the network, layers of serialization and deserialization, authentication, authorization, and more. Postgres can run locally, communicating via a Unix socket. You should try benchmarking this before stating tha…
kernel (filesystem) -> app with SQLite library
kernel (filesystem) -> Postgres -> kernel -> app with Postgres client
If Postgres reads data from own cache (not from disk) the chain will be one step shorter: Postgres -> kernel -> client, but the same true for SQLite own cache.If mmap is used (make sense for small data sets cached in RAM) then reading data by SQLite can be zero-copy [1].
Benchmark result highly depends on a use case - neither is better for all use cases but at least for some use cases SQLite is faster.
Re: Why SQLite is so great for the edge
#6SQLite could scale to even quite large customers with this.
Another really compelling architecture is a DB per user, with partial/selective sync between the nodes. If you then couple this with a "local first" design, the "edge" just becomes an other local deployment that the users db can sync against. Collaborative apps, where the users have their own documents but can also share/fork them would align well with this.
I believe starting with "local first" and using the edge for sync and "online only" modes is going to become the default for a significant number of apps moving forward. SQLite with CRDT based syncing and merge conflict resolution is the way to do this. There are a couple of exciting projects working on this:
Re: Why SQLite is so great for the edge
#7Re: Why SQLite is so great for the edge
#8I want to hear "What's not great using SQLite compare to PostgreSQL" instead .
Re: Why SQLite is so great for the edge
#9Re: Why SQLite is so great for the edge
#10I want to hear "What's not great using SQLite compare to PostgreSQL" instead .