Live data from Hacker News

Why I Built Litestream

litestream.io

71–80 of 178 posts

Re: Why I Built Litestream

#71

On the GitHub repo ( https://github.com/benbjohnson/litestream ), it saids: "Litestream only communicates with SQLite through the SQLite API so it will not corrupt your database." Does that mean I can use an in memory SQLite DB and have it replicated too? That would have some amazing potentials.

Unfortunately, no. Litestream uses the SQLite API for locking and state but reads the WAL file from disk.

Re: Why I Built Litestream

#72
Embedded databases where the db is a single file are the bomb.

We build several products in Java using H2 as our database. What a pleasure. Full SQL support, zero configuration/installation/etc.

Just copy data-files/dbs around using normal file tools.

Just start up one process and your app is ready.

Re: Why I Built Litestream

#73

Awesome! I built a side-business that runs completely on Crystal + SQLite. Very light, fast service and makes ~$200k/mo. I just cp my sqlite file to S3 every 2 hours. From my app, i have a page[1] where i can load any snapshot database saved on S3. I can backup at anytime too with a click, which i do before deployment. [1]: https://i.imgur.com/Ls1Tnxc.png

OT: Love the name! I've leaned into my name and make all my side hustles Crave {product} (ie, "Crave Training"), so I guess I'll cross cookies off my potential list lol.

Re: Why I Built Litestream

#74
post #26

Earlier quoted context omitted.

You make $200k/m delivering cookies in two cities? That’s incredible! Always amazed by these niche businesses that make bank

we only have a single kitchen and it seems just above 200k is our ceiling for a single location. Expanding soon. we took down our revenue from indiehackers but somebody took a screenshot and posted on twitter of the stripe verified revenue. https://pbs.twimg.com/media/EXbNBVUX0AAotOo?format=jpg&name=...

That growth curve is impressive. If you keep that rate it won't be a side business for long.

Re: Why I Built Litestream

#75

I've been building a web service on a cheapo DigitalOcean box lately, so I'm excited to see explorations in this space, especially with an eye towards staying cheap! I'd probably only use this particular tool if it could hook up to Backblaze B2 instead of S3, since life's too short to ever have to engage with the hell that is AWS for a hobby project, but since B2's API-compatible it seems like a feature that could be…

I haven't tried Backblaze B2 but I agree with you on engaging in AWS hell. Litestream should work with any S3-compatible API. I've added an issue to add guides for B2 & Minio[1]. Regarding Postgres vs SQLite, I've found that I can use much simpler SQL calls with embedded databases when I don't need to worry about N+1 query performance issues. That makes many of the query features moot. That being said, there is a JSO…

I've used json1 in SQLite for a bunch of different things and it's great - super-fast, has all of the features that I need. Since it's part of SQLite core I trust it as having the same level of reliability as the rest of SQLite.

Re: Why I Built Litestream

#76
post #24

> “But nobody writes production applications with SQLite, right?" We've been doing it for 5 years now. Basic tricks we employ are: Use PRAGMA user_version for purposes of managing automatic migrations, a. la. Entity Framework. This means you can actually do one better than Microsoft's approach, because you don't need a special unicorn table to store migration info. A simple integer compared with your latest integer a…

>We can afford to lose the last few minutes of work without anyone getting yelled at. Some modern virtualization technologies do help a lot in this regard. Running bare metal you need to be a little more careful.

How does virtualization help with data loss? I would expect that a VM can't have guarantees better than the underlying physical hardware provides.

Re: Why I Built Litestream

#77

Awesome! I built a side-business that runs completely on Crystal + SQLite. Very light, fast service and makes ~$200k/mo. I just cp my sqlite file to S3 every 2 hours. From my app, i have a page[1] where i can load any snapshot database saved on S3. I can backup at anytime too with a click, which i do before deployment. [1]: https://i.imgur.com/Ls1Tnxc.png

What crystal web framework do you use?

none. I had built a Crystal web framework that i retired[1]. I created something else that I use that's faster than the popular ones. Not open sourced.

Funnily, been into F# the past few months and built a web framework for that too. Still in progress[2].

[1]: https://github.com/samueleaton/raze

[2]: https://wiz.run/

Re: Why I Built Litestream

#78

Earlier quoted context omitted.

Also got this gem from the Crave Cookies website: "The software is built "from scratch" like the cookies and is part of Crave's success story. No other food company has the software Crave has for managing deliveries." You should definitely do a write-up on Not Invented Here syndrom. And we sometimes "reinventing" the wheel, in moderation and for core components, really is the best solution.

Most of the time it's a matter of distilling to simplicity. No so much building a better mousetrap, as much as needing only a mousetrap instead of an Animal Processor 5000.

Good observation.

Re: Why I Built Litestream

#80

"Litestream is a tool that runs in a separate process and continuously replicates a SQLite database to Amazon S3." Why Amazon S3? Was it a huge invention by people at Amazon, and even if so, does it assign credit where it is deserved? Is Amazon helping the open web? I don't think so.

"Why Amazon S3?" Because it's extremely cheap, durable and easy to read/write?

I mean, why not just call it "cloud storage"? That would leave it open for the bajillion of them, of which S3 is no longer special.

https://rclone.org/

Post reply on HN