4 ms·
An Introduction to LiteStack for Ruby on Rails
- obiefernandez 3y agoThe article is actually a great introduction to interfacing a Rails app to Replicate AI!
- bradly 3y agoI agree. I didn't learn anything about using LiteStack in a Rails App, but I did enjoy the article and learned of a few new gems and services. The article is the first part of a series and so hopefully in the next part they get into the integration of LiteStack with the app.
- julianrubisch 3y agoThey will
- 3by7 3y agoVery compelling architecture for projects that don't require massive horizontal scaling. Those looking for replicas/backups can add Litestream https://litestream.io https://litestream.io
- kaycey2022 3y agoIs there any restriction on how many rails apps can be run on a 5$ digital ocean droplet?
- imacomputertoo 3y agoYes, memory. 4$ droplets have only 512mb. that's barely enough to run bundle install for one application. 6$ droplets give you 1GB and that's plenty for one app,
- ljm 3y agoYou might have some success if you run the build before deploying it (provided you use the same arch as the droplet). It's not going to give you a lot to work with and Puma's default config will take up most of it. A 1/2GB box could run the bare minimum if you host the database on it as well. For a small scale app or a hobby/toy project that's going to do just fine.
- deleted 3y ago[deleted]
- nurettin 3y agoYou can run any number of them if you turn swap on. It will just be very slow.
- hartator 3y agoSomething feels wrong to use Current.account in models.
- lobstrosity420 3y agoIt is in fact how it was designed to be used, you can read the reasoning here: https://dev.37signals.com/globals-callbacks-and-other-sacrileges/ https://dev.37signals.com/globals-callbacks-and-other-sacril...
- Toutouxc 3y agoThe reasoning being basically "fuck Ruby and consistent OOP practices, this is how we roll". I used to be fine with this, but the more I work with Rails, the more I feel like it's trying to make me a worse programmer. Business logic in controllers, service "objects" (not actually objects at all), the OOP abomination that are models with dozens of different behaviors and agendas inherited via concerns. In Rails you can always pick your poison, but you don't seem to be allowed not to be poisoned.
- lobstrosity420 3y ago> Maximalist positions are a thing in our industry. Take a technique, outline its drawbacks, extrapolate you can’t use it under any circumstance, and ban it forever. We are lucky that Rails embraces exactly the opposite mindset as one of its pillars.
- revscat 3y agoYou may want look into dry-transaction and railway oriented programming.
- arrowsmith 3y agoOr you could give it up and move to Phoenix; I've never looked back.
- angryasian 3y agoIt says people are using sqlite for production. How big can you grow your database before it becomes a problem ?
- nurettin 3y agoWith binary search and indexes, why should size be a problem?
- rco8786 3y agoAs big as your disk/SSD.
- bradgessler 3y ago281 terabytes Source: https://www.sqlite.org/limits.html https://www.sqlite.org/limits.html
- byroot 3y agoThe limiting factor isn't the size of the dataset, but the rate of writes.
- angryasian 3y agothats interesting I thought it would be faster than your avg database. I'll have to dig into it.
- melx 3y agoSomething else will be a problem...before size of sqlite is a problem.
- angryasian 3y agothanks, yeah I haven't dug deep enought to understand what those would be yet.
- stmblast 3y agoThis is neat! I like. It reminds me somewhat of Turso.
- rco8786 3y agoOh dang I love this. I also wish someone would take something like this and go full Phoenix with it.
- revscat 3y agoPhoenix?
- lemper 3y agoRuby off Rails inspired framework for Elixir.
- lastairnomad 3y agoPhoenix already doesn't need Redis for asynchronous jobs and caching. I'm using Phoenix on SQLite on a project right now, and it's been working pretty flawlessly. It's as easy as `mix phx.new MyProject --database sqlite3`.
- enstyled 3y agoHere's more on the subject from Fly.io https://fly.io/ruby-dispatch/sqlite-and-rails-in-production/ https://fly.io/ruby-dispatch/sqlite-and-rails-in-production/
- pavelevst 3y agoVM with 1GB ram and some swap file can easily run rail app, Postgres and redis. With that you don’t have to limit yourself to not able to scale later. I never used sqlite, can it be used by multiple process simultaneously? Eg rails server and rails console
- fractaledmind 3y agoWhen you open your database connection in WAL journal mode, you can have multiple concurrent readers. This is the new default for all Rails applications. WAL mode doesn’t allow concurrent writers, but you are often talking about milliseconds to wait for the busy connection to resolve, and SQLite retries for you invisibly.
- mycroftholmess 3y agoWhat would be the deployment strategy here? Would it have to be manual deployments? Since the infrastructure for other approaches usually assumes that there isn’t any critical data on a single instance. The .sqlite file would have to be persisted somehow?
- fractaledmind 3y agoYes, the .sqlite file needs to be persisted across deployments. It is fairly common for the /storage directory to be persisted across deployments. The Kamal deployment tool will use this directory. The Hatchbox.io service likewise uses a persisted /storage directory. This doesn’t mean that you have to have manual deployments tho. You simply need a file system and some persisted storage, which you should already have as most deployment setups don’t want to nuke and pave every static asset on every deployment.