top | item 33895766

(no title)

fyresala | 3 years ago

You won't gain much by the combination of golang, sqlite and the cloud. You can't scale out and the cloud layer only makes sqlite slower. I can't see any reason not using RDS other than it's more expensive.

I would only say this is a quick way to run up an application with a cheap VPS for a beginner.

discuss

order

benbjohnson|3 years ago

Litestream/LiteFS author here. I agree that "cloud" is a bit ambiguous but Go & SQLite are quite powerful together and I don't think it's only for beginners. Both are fast and have low overhead. In addition to lower cost versus RDS, there's near-zero query latency which eliminates a lot of performance problems. You can comfortably run tens or hundreds of requests per second on minimal hardware (e.g. 256MB or 512MB instances). There's a lot of room for scaling up before you hit a performance ceiling.

ehutch79|3 years ago

Tens of requests a second?

tacitusarc|3 years ago

Do you mean tens or hundreds of thousands of requests per second?

ketralnis|3 years ago

This is a pretty strong claim without any numbers, to be honest. You were probably already running your single database instance so being limited to a single sqlite instance isn't terribly different. This does limit you to a single app server, which unless you're CPU bound is also fine. Even if you are, you can get a lot of cores in a single instance these days.

Most things will never need to be scaled up

aynyc|3 years ago

AFAIK, sqlite3 doesn't support multi-core, so you can only do vertical scaling. In cloud, people rather do horizontal scaling. That being said, I ran a django based webapp for internal users and we saw core being pegged by sqlite3 when the queries were complex. However, under normal usage, it was fine for about 100 concurrent users including machine API calls.

infamia|3 years ago

Once you need to graduate from one large server (which will take you a long way in many cases), there are tools like [rqlite](https://github.com/rqlite/rqlite) that can handle clustering. With WAL mode enabled, SQLite can handle a surprising amount of traffic that would fit a lot of use cases. If latency is important to you, it's going to be hard to beat SQLite for many workloads.

mariusor|3 years ago

It's a little weird that you consider bringing up an application on bare metal something for a beginner. :) I think manually handling the nitty-gritty of an OPS setup is a more senior task than clicking you way into setting up some AWS infrastructure.

iveqy|3 years ago

Depends on your application.

On the opposite I've seen many cases where sqlite3 scales better than postgres, depending on the scale and the application.

If you're doing horizontal scaling, sqlite3 is a very good alternative.

0cf8612b2e1e|3 years ago

> I can't see any reason not using RDS other than it's more expensive.

We don’t all operate with unlimited VC money.

randomdata|3 years ago

You gain low latency, which allows you to write your code to a 'pure' relational model (at least as close as SQL allows), without having to rely on code complicating hacks to deal with round-trip issues. Less complicated code can improve delivery time and reduce faults. While there are abstractions that can be used to help with those hacks, they come with their own tradeoffs. Pick your poison, as always.

Conceptually, RDS is little more than SQLite with a clever networking layer built on top. In context, your application is also just a clever networking layer, so the middleman doesn't necessarily add any value. Of course it depends on exactly what you are trying to do and what tradeoffs you are willing to accept. There is no free lunch.

simonw|3 years ago

At what point would you expect to need to scale out?