Very compelling architecture for projects that don't require massive horizontal scaling. Those looking for replicas/backups can add Litestream https://litestream.io
I 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.
Phoenix 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`.
I see conventions like that as an acknowledgement that Rails often gives up purity in favour of simplicity. It makes this decision quite often, primarily because it works for Basecamp, but also it keeps the mental model simple, especially for juniors learning the ropes.
I've not seen many places that actually use it. Instead there are several other layers of patterns that try to keep things decoupled but introduce a different kind of complexity. And the implementation is different every time (Ruby devs love their custom service/command DSLs).
The 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.
> 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.
Yeah I think it's one of those features that people generally steer away from. Ironically, if you stick to the "Rails way" of doing things I don't think you would ever encounter it.
VM 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
When 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.
You 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.
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?
Yes, 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.