frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Litestream: Revamped

https://fly.io/blog/litestream-revamped/
222•usrme•5h ago

Comments

maxmcd•5h ago
Looks like the code is here: https://github.com/benbjohnson/litestream/tree/v0.5

Really nice to see this, I wrote this comment almost 2 years ago when I was a little miffed about trying to use litestream and litefs: https://news.ycombinator.com/item?id=37614193

I think this solves most of the issues? You can now freely run litestream on your DB and not worry about issues with multiple writers? I wonder how the handoff is handled.

The read replica FUSE layer sounds like a real nice thing to have.

edit: Ah, it works like this: https://github.com/benbjohnson/litestream/pull/617

> When another Litestream process starts up and sees an existing lease, it will continually retry the lease acquisition every second until it succeeds. This low retry interval allows for rolling restarts to come online quickly.

Sounds workable!

gavinray•5h ago
Just a heads-up, the link in the "Litestream is fully open source" callout is malformed and leads to:

https://http//litestream.io/

tptacek•3h ago
Thanks!
srameshc•5h ago
I have been following Ben for a long time but I never knew LiteFS was based on his work. I somehow settled eventually for rqlite for self managed distributed.

https://github.com/rqlite/rqlite

digianarchist•2h ago
Similar approach to LiteFS but rqlite embeds raft into the project instead of depending on consul.

https://youtu.be/8XbxQ1Epi5w?si=puJFLKoVs3OeYrhS

tptacek•2h ago
I don't think they're similar at all. LiteFS uses Consul to elect a leader for a single-write-leader multiple-replica configuration, the same way you'd do with Postgres. rqlite (as I understood it last time I looked) runs Raft directly; it gets quorums for every write.

One isn't better than the other. But LiteFS isn't a "distributed SQLite" in the sense you'd think of with rqlite. It's a system for getting read-only replicas, the same way you've been able to do with log shipping on n-tier databases for decades.

jasonthorsness•4h ago
What a coincidence, I was just researching Litestream today! I use Sqlite on my VPS and was thinking about adding this.

Am I understanding correctly that I will be able to restore a database to any point-in-time that is while the litestream process is running? Because auto-checkpointing could consume the WAL while it isn't running?

So for an extreme example if the process crashed for an hour between 2:00 and 3:00, I could restore to 1:55 or 3:05 but the information required to restore between 2:00 and 3:00 is lost?

benbjohnson•3h ago
Litestream saves WAL segments to a given time granularity. By default, it ships off WAL changes every second so you should be able to restore to any given second in your history (within your retention period).
fra•4h ago
Litestream has seen very little development lately and I was worried it was dead. Very glad to see Ben Johnson is continuing to push the project forward with some exciting new plans.
simonw•4h ago
This post is like they read my mind and implemented everything I wanted from a new Litestream. So exciting.
psanford•4h ago
This looks great! A few years ago I wrote a sqlite vfs for using dynamodb as a backing store[0] called DonutDB. With the recent addition of CAS to S3, I was thinking about making a new version of DonutDB backed by S3. I'm really glad lightstream supports this so I don't have to!

I can't wait to try this out.

[0]: https://github.com/psanford/donutdb

rawkode•4h ago
Amazing to see and hear about the progress. Always a pleasure when Ben works on something and shares it. Keep it up!
nico•4h ago
Very cool idea, I wonder if that works better than their Postgres instances

Recently, I deployed a little side project using a small postgres vm on fly.io After a couple of days, and only having about 500kb of data stored in that db, the postgres vm went into an unrecoverable fail loop, saying it ran out of memory, restarting, then immediately running out of memory again, so on and so forth

It took about 3-4hrs to recover the data jumping through a lot of hoops to be able to access the data, copy it to another volume and finally download it

I would've reached for support, but it seems like the only option available is just posting on their forum. I saw a couple of related posts, all with unsatisfactory answers unfortunately

To be fair, it was incredibly easy to get up and running with them. On the other hand, almost all the time I saved by that quick start, was wasted recovering the failing db, all the while my site was down

Ironically, I originally developed the project using sqlite, but then switched to postgres to deploy

yellow_lead•3h ago
It's strange to me that they still haven't offered a managed Postgres product. Other providers like Render or even Heroku seem to have realized that this is a core part of PaaS that customers want. Instead they focused on GPUs and LiteStream. When I evaluated different PaaS for the startup I work at, I had to go with Render. I couldn't even give Fly.io a try since I knew we needed Postgres.
biorach•3h ago
https://fly.io/docs/mpg/overview/
nico•3h ago
It think they are in beta. I wished they had a managed Redis though

For Postgres I ended up going with Neon (neon.tech), very happy with them so far. Super easy to setup and get up and running, also love being able to just easily see the data from their web interface

tptacek•3h ago
We're rolling out Managed Postgres, very slowly.
yellow_lead•1h ago
Looking forward to it!
sergiotapia•2h ago
Try Railway - nothing but good experiences with these dudes. Fairly priced and great dev UX.
tptacek•3h ago
This post has nothing to do with Fly.io's platform offerings. Litestream is completely uncoupled from Fly.io. Ben started it before he got here.
sosodev•2h ago
Clearly it does have something to do with fly.io considering fly is and has been pushing for litefs/stream as the ideal database solution for fly users. It seems reasonable that readers would compare it to other fly offerings.
tptacek•1h ago
We have... never done that? Like ever? LiteFS is interesting for some read-heavy use cases, especially for people who are doing especially edge-deployed things, but most people who use databases here use Postgres. We actually had a managed LiteFS product --- LiteFS Cloud --- and we sunset it, like over a year ago. We have a large team working on Managed Postgres. We do not have a big SQLite team.

People sometimes have a hard time with the idea that we write about things because they are interesting to us, and for no other reason. That's also 60-70% of why Ben does what he does on Litestream.

sosodev•1h ago
I’m sorry. I think that I, and probably others, have misinterpreted it. Between Ben’s writings on the fly blog and litefs cloud it seemed like that was the case. I didn’t realize it had been discontinued.
tptacek•1h ago
Neither LiteFS nor Litestream (obviously) have been discontinued. They're both open source projects, and were both carefully designed not to depend on Fly.io to work.
ignoramous•3h ago

  We have a sneaking suspicion that the robots that write LLM code are going to like SQLite too. We think what coding agents like Phoenix.new want is a way to try out code on live data, screw it up, and then rollback both the code and the state.
Prescient.

Agents would of course work well if they can go back in time to checkpoints and branch from there, exploring solutions parallely as needed.

Anyone who has experience with building workflows (Amazon SWF, Temporal, and the like) knows how difficult it is to maintain determinism in face of retries & re-drives in multi-tier setups (especially, those involving databases).

Replit recently announced their Agent's integration with Neon's time travel feature [0] for exactly the purpose outlined in TFA. Unlike Fly.io though, Replit is built on GCP and other 3p providers like Neon and it is unclear if both GCP & Databricks won't go all Oracle on them.

[0] https://blog.replit.com/safe-vibe-coding

mixmastamyk•3h ago
For something rather new there seems to be too many choices already. Please pick a strategy under one name, good defaults, and a couple of config options.
j0e1•3h ago
This is exciting! Especially glad that Litestream is still maintained. Is there a use-case for Litestream for more than backup? I am a fan of offline-first but it would be cool to have a way to synchronize on-device SQLite instances to a single central instance.
benbjohnson•3h ago
Backups & read replicas are the primary use cases. If you're interested in local-first, you can check out projects like cr-sqlite[1].

[1]: https://github.com/vlcn-io/cr-sqlite

j0e1•3h ago
Thank you Ben for the great work on this project! Also, I remember looking into this one and: https://github.com/vlcn-io/cr-sqlite/issues/444
dankebitte•2h ago
> read replicas

Can this be done with only Litestream, or is LiteVFS still in development? I looked into this last year but was put off by LiteFS's stated write performance penalty due to FUSE [1]; it's still marked as WIP [2] and hasn't seen updates for over a year.

[1] https://fly.io/docs/litefs/faq/#what-are-the-tradeoffs-of-us...

[2] https://github.com/superfly/litevfs

caleblloyd•3h ago
Is the backend pluggable? Could it be configured to write to any key value store with support for optimistic concurrency control?
benbjohnson•3h ago
We don't support plug-ins at the moment but there's several backends at the moment (S3, Azure Blob Storage, Google Cloud Storage, SFTP, etc)
nodesocket•3h ago
Is there a migration guide from stable to the branch 0.5? I’m running Litestream as a Docker sidecar alongside my Python app container and it’s been great and a nice comfort knowing my SQLite db is backed up to S3.
bradgessler•3h ago
I wish Fly would polish the developer experience on top of SQLite. They're close, but it's missing:

1. A built-in UI and CLI that manages SQLite from a volume. Getting the initial database on a Fly Machine requires more work than it should.

2. `fly console` doesn't work with SQLite because it spins up a separate machine, which isn't connected to the same volume where the SQLite data resides. Instead you have to know to run `fly ssh console —pty`, which effectively SSH's into the machine with the database.

The problem in general with SQLite web apps is they tend to be small apps, so you need a lot of them to make a decent amount of money hosting them.

hobo_mark•2h ago
If you wanted to use litestream to replicate many databases (ideally, one or more per user), which is one of the use cases described here (and elsewhere), how do you tell litestream to add new databases dynamically? The configuration file is static and I haven't found an API to tell it to track a new db at runtime.
mrkurt•2h ago
I would expect this problem to get solved. It's tricky to detect new sqlites, but not impossible.

In the meantime, it's pretty straightforward to use as a library.

oliwary•2h ago
Fantastic to see it's getting updated! I am a big fan of litestream, have been using it for a while together with pocketbase. It's like a cheat code for a cheap, reliable and safe backend.
thewisenerd•2h ago
ben, thanks for litestream!

we're using it on production for a write-heavy interal use-case (~12GB compressed) for more than a year now; and it's costing us a couple hundred pennies per month (azure).

excited to try the new changes when they land.

neom•2h ago
Is Litestream on a path to subsume LiteFS's capabilities? Re: PITR, would this be used to facilitate automated A/B testing of AI-generated code changes against live data subsets? I can imagine a lot of cool stuff in that direction. This is really cool Ben!
yowmamasita•1h ago
tangent: in modern SQLite, are writes still serialized? That's my main concern when choosing a tech stack for an app that might have thousands of writes happening on peak periods
simonw•1h ago
Yes they are, but if you benchmark thousands of writes a second you'll likely find that SQLite does just fine.

You might start running into problems at tens or hundreds of thousands of writes a second, though even then you may be OK on the right hardware.

malkia•1h ago
So fossil (which is built on top of sqlite) + this = SCM?
m3sta•12m ago
Is there anything like Livestream that can be just pip installed?

Veo 3 and Imagen 4, and a new tool for filmmaking called Flow

https://blog.google/technology/ai/generative-media-models-io-2025/
449•youssefarizk•7h ago•263 comments

The Value Isn't in the Code

https://jonayre.uk/blog/2022/10/30/the-real-value-isnt-in-the-code/
56•fragmede•2h ago•30 comments

Litestream: Revamped

https://fly.io/blog/litestream-revamped/
222•usrme•5h ago•44 comments

Gemma 3n preview: Mobile-first AI

https://developers.googleblog.com/en/introducing-gemma-3n/
216•meetpateltech•7h ago•81 comments

“ZLinq”, a Zero-Allocation LINQ Library for .NET

https://neuecc.medium.com/zlinq-a-zero-allocation-linq-library-for-net-1bb0a3e5c749
65•cempaka•3h ago•21 comments

Semantic search engine for ArXiv, biorxiv and medrxiv

https://arxivxplorer.com/
54•0101111101•3h ago•9 comments

The NSA Selector

https://github.com/wenzellabs/the_NSA_selector
174•anigbrowl•7h ago•55 comments

Deep Learning Is Applied Topology

https://theahura.substack.com/p/deep-learning-is-applied-topology
348•theahura•11h ago•155 comments

Red Programming Language

https://www.red-lang.org/p/about.html
104•hotpocket777•7h ago•48 comments

Magic of software; what makes a good engineer also makes a good engineering org

https://moxie.org/2024/09/23/a-good-engineer.html
39•kiyanwang•1d ago•6 comments

My favourite fonts to use with LaTeX (2022)

https://www.lfe.pt/latex/fonts/typography/2022/11/21/latex-fonts-part1.html
57•todsacerdoti•3d ago•18 comments

Show HN: 90s.dev – Game maker that runs on the web

https://90s.dev/blog/finally-releasing-90s-dev.html
227•90s_dev•10h ago•94 comments

Show HN: A Tiling Window Manager for Windows, Written in Janet

https://agent-kilo.github.io/jwno/
200•agentkilo•10h ago•68 comments

New stem cell model sheds light on human amniotic sac development

https://www.crick.ac.uk/news/2025-05-15_new-stem-cell-model-sheds-light-on-human-amniotic-sac-development
16•gmays•4d ago•1 comments

Robin: A multi-agent system for automating scientific discovery

https://arxiv.org/abs/2505.13400
113•nopinsight•9h ago•17 comments

AI's energy footprint

https://www.technologyreview.com/2025/05/20/1116327/ai-energy-usage-climate-footprint-big-tech/
110•pseudolus•15h ago•115 comments

The Dawn of Nvidia's Technology

https://blog.dshr.org/2025/05/the-dawn-of-nvidias-technology.html
125•wmf•8h ago•36 comments

Why does the U.S. always run a trade deficit?

https://libertystreeteconomics.newyorkfed.org/2025/05/why-does-the-u-s-always-run-a-trade-deficit/
177•jnord•13h ago•367 comments

LLM-D: Kubernetes-Native Distributed Inference at Scale

https://github.com/llm-d/llm-d
5•bbzjk7•1h ago•1 comments

The emoji problem (2022)

https://artofproblemsolving.com/community/c2532359h2760821_the_emoji_problem__part_i?srsltid=AfmBOor9TbMq_A7hGHSJGfoWaa2HNzducSYZu35d_LFlCSNLXpvt-pdS
314•mtsolitary•15h ago•58 comments

Show HN: A Simple Server to Match Long/Lat to a TimeZone

https://github.com/LittleGreenViper/LGV_TZ_Lookup
28•ChrisMarshallNY•3h ago•13 comments

Linguists find proof of sweeping language pattern once deemed a 'hoax'

https://www.scientificamerican.com/article/linguists-find-proof-of-sweeping-language-pattern-once-deemed-a-hoax/
63•bryanrasmussen•1d ago•47 comments

Ashby (YC W19) Is Hiring Engineering Managers

https://www.ashbyhq.com/careers?utm_source=hn&ashby_jid=933570bc-a3d6-4fcc-991d-dc399c53a58a
1•abhikp•8h ago

A disk is a bunch of bits (2023)

https://www.cyberdemon.org/2023/07/19/bunch-of-bits.html
26•rrampage•3d ago•5 comments

Show HN: Juvio – UV Kernel for Jupyter

https://github.com/OKUA1/juvio
93•okost1•9h ago•19 comments

Google AI Ultra

https://blog.google/products/google-one/google-ai-ultra/
243•mfiguiere•7h ago•258 comments

GPU-Driven Clustered Forward Renderer

https://logdahl.net/p/gpu-driven
88•logdahl•9h ago•22 comments

Show HN: Text to 3D simulation on a map (does history pretty well)

https://mused.com/map/
53•lukehollis•13h ago•45 comments

Launch HN: Opusense (YC X25) – AI assistant for construction inspectors on site

32•rcody•9h ago•14 comments

Gail Wellington, former Commodore executive, has died

https://www.legacy.com/us/obituaries/name/gail-wellington-obituary?id=58418580
70•erickhill•3d ago•22 comments