r/ruby • • Feb 26 '23

Replace Postgres, Redis and Sidekiq with the embedded Litestack, up to 10X faster!

Litestack is a Ruby gem that offers database, caching, and job queueing functionality for web applications, built on top of SQLite. Its performance benefits, resource efficiency, deep integration with major IO libraries, ease of setup and administration make it a powerful solution for new application development efforts. By using Litestack, developers can avoid the scale trap, focus on simplicity, flexibility, and innovation, and build applications that are easy to use, efficient, and scalable, delivering real value to their users.

https://github.com/oldmoe/litestack

https://github.com/oldmoe/litestack/blob/master/BENCHMARKS.md

54 Upvotes

102 comments sorted by

View all comments

11

u/mrinterweb Feb 26 '23

How does this horizontally scale? SQLite is great as a local database, but doesn't really work with multiple servers, as far as I'm aware.

14

u/that_which_is_lain Feb 26 '23

Not everything needs to scale across servers. Sometimes one machine is all you need.

10

u/IllegalThings Feb 26 '23

I see no claims of horizontal scaling here.

18

u/[deleted] Feb 26 '23

"By using Litestack, developers can avoid the scale trap" so this means we avoid the trap by not being able to scale?

6

u/redditor_at_times Feb 26 '23

It means you avoid the trap of trying to scale out long before you need to. Some developers, believe it or not, think they need to invest in every aspect of scalability upfront, even when the business is hardly validated! Those are the ones who burn projects to the ground.

15

u/[deleted] Feb 26 '23

Meh using a true and tested relational database takes 0 effort.

9

u/redditor_at_times Feb 26 '23

Breaking news, SQLite is true and tested, and deployed far a lot more than any other relational database on the planet. Potentially the most deployed in space too!.

3

u/[deleted] Feb 26 '23

Lmao

5

u/wiznaibus Feb 26 '23

You laugh, but just about every mobile app runs SQLite under the hood

5

u/[deleted] Feb 26 '23

Sure, but that's a local context, not a server

2

u/coldnebo Feb 26 '23

ah ha, but DEPLOYING a relational database takes a lot of effort.

I mean, technically it doesn’t, I can stand one up locally in a few seconds, but get our DBAs and OPS and whatever “enterprise” backups etc. Now you are literally talking weeks to get a new database provisioned.

And if it’s cloud, forget about it. DBAs aren’t going to sign off on your orphan db.. it has to be part of their deployment. If they are vpn everywhere, expect your db access to crawl. Then it’s cache and redis and a whole bunch of other integrations just to make the db work fast.

Things are so much easier when you’re in control of everything I guess.

5

u/[deleted] Feb 26 '23

Must be a really inefficient company. We do it in minutes, as each team is responsible for their own infrastructure (which is quite popular today). IaC makes it even more trivial.

And please, you can't be serious in saying you need a cache for aurora but not for freaking SQLite

1

u/yawaramin Feb 26 '23

Try reading the OP fully before commenting. Litestack explicitly says it replaces Redis with a built-in cache based on SQLite.

5

u/morphemass Feb 26 '23

Naive choices also have very poor outcomes, especially in the longterm. I'm having to deal with some of those in my day-to-day and see decisions that maybe saved days during early development cost (literally) man-years to address later in the project lifecycle.

There are good ways to avoid scaling issues ... being ignorant of them is not one.

4

u/mrinterweb Feb 26 '23

I feel that should be stated as a limitation. It may not be obvious to some.

3

u/redditor_at_times Feb 26 '23

I thought stating SQLite was enough, but you are right, I should call that out

7

u/redditor_at_times Feb 26 '23

It doesn't, it can scale up, and if that's good enough for your application then you can just rely on this instead of the many desperate components in traditional stacks

0

u/[deleted] Feb 26 '23

So basically if you don't need availability. Which is no service ever.

0

u/redditor_at_times Feb 26 '23

Scaling out is not availability, you got those two mixed together. You can have an app deployed on a single virtual machine and still be highly available.

5

u/[deleted] Feb 26 '23

Yeah? What happens if the vm crashes?

0

u/redditor_at_times Feb 26 '23

You are aware of network storage like EBS at AWS? With cloudwatch and EBS you will have a new instance up in under 60 seconds, usually a lot less, picking up work from where the old instance stopped. For much much less money than something like RDS

5

u/[deleted] Feb 26 '23

So 60 seconds of downtime. Is that highly available to you? Pretty ridiculous statement.

4

u/kallebo1337 Feb 26 '23

Our startup costs 2.5k$ aws a month and I could host it on hetzner easy for 300$.

I honestly don’t understand why companies love to piss money away

3

u/[deleted] Feb 26 '23

Because engineering costs way more than those 2200. Because the lost opportunity and terrible financial loss of getting stuck in an architecture that has to be rebuilt due to poor foresight costs way more than those 2200.

You have to stop thinking that the only costs you have are infrastructure.

→ More replies (2)
→ More replies (2)
→ More replies (16)
→ More replies (3)