What if we could run Postgres as a single file, and take advantage of the best SQLite has to offer?
Today I am announcing pg-micro, a crazy experiment I've been undertaking to make this happen.
pg-micro is different than other approaches because it is fully local, and expected to be fast: there is no concurrency limitation and no statement translation.
Here's how it works: we use the actual postgres parser to parse the statement, but compile that to the Turso AST. The Turso AST is then compiled do bytecode, and from there everything executes natively, as it'd do in SQLite. This makes it a perfect target to run in any environment.
There is traditionally a mismatch between Postgres and SQLite in terms of functionality. But @tursodatabase has been hard at work to close this gap: things like MVCC and a rich, strict type system are present in Turso. There are PRs for things like lateral joins, etc. This means that the gap can be closed until it theoretically reaches zero.
What you could do with it? Just imagine for example a primitive like Durable Objects by @Cloudflare, but with a postgres interface? Or imagine you could use the same pattern of local databases for agents that SQLite gives you, totally ephemeral and free, but with a Postgres interface? Or even that you could execute remote postgres in platforms like @vercel but with the unmatched density of the Turso Cloud?
Expect lots not to work at this point. But as usual, this is done in the full spirit of OSS, so PRs welcome!
To get started: npx pg-micro
finished today the slides for my talk for TokioConf "I want it, you want it, we want it: Let's rewrite it in Rust!"
Slides coming up great and hoping this meme will resonate.
Come to the conf in Portland, Apr 21st!
🚨 BREAKING:
Buffett is openly uneasy with the direction of US policy
He says governments ALWAYS debase their currency
In addition Berkshire is shifting $348B into JPY
FUCK FUCK FUCK
If he’s hedging the dollar, you should rethink your exposure!
@QuinnyPig I'm guessing they have useful information but aren't able to show you what it is as the app went through a super-helpful internal security review.
I'm immediately hiring a Scala developer at @zivergetech. 👀
You should be able to start soon and probably be located in Eastern Europe. ⏲️
You'll own microservices end-to-end, and ship production code with Scala effect systems. 🚀
@therealdanvega We already lean heavily on the spring nullability annotations (including NonNullApi and NonNullFields in package-info files all over the place). It will be interesting to see how this translates to spring boot 4 and to see what improvements it brings
@ktosopl Yeah, havent tried it but the boss poly shifter is supposed to be really good (and it's blue!) but that guitar is quite nice. Difficult choices :)
Rare opportunity: My company is recruiting some Scala+ZIO software engineers in Australia 🇦🇺
Come work with me 🙂
Send me DMs or apply to the job offers
- https://t.co/DKpxBzibye
- https://t.co/p1CfisBnIe
- https://t.co/Cz76XkuI1G
@glcst@mitchellh Yes, it feels like we are in a transition phase right now and that eventually either the LLMs will get better at using functions and paradigms already in the codebase (and thus maintain code quality) or developers will stop caring as much about it. I hope it's the first one!
@jussisaur It's certainly nice not to have to hand-optimise queries for the database you are using and let the database query optimiser handle some of the common query patterns. Is this unnesting approach something you might look to include in turso in the future?
The buffer pool of tursodb is now backed by Arenas that are registered with io_uring for `Fixed` opcode support. Now the pool can return contiguous buffers used for checkpointing and pwritev calls with 10s-100s of iovecs can be coalesced down to a single IORING_OP_WRITE_FIXED
Okay, I just wrapped up some small projects and I’m ready to go back to work full time! Anyone need some Scala or maybe some technical writing?
(There’s a reason I didn’t go into sales or marketing. 😂)