A gentleman on Twitter suggested that to make a new SaaS app, you should do these things:
- Keep it Simple, Stupid
- Start with Nextjs or Remix app and a database
- Break it out into a separate service
- DO NOT over architecture your app
So let’s talk about that last bit: separate it into a new thing.
I’ve talked about what a bad idea “turn it all into microservices” is. And I still think that.
So how come I’m saying “write it all as microservices?”
Here’s the trick: I’m not. I really like his test above. He doesn’t say “if you can separate it, separate it.” That’s often bad advice.
Instead, he says that if you can’t do it in JS or TypeScript, separate it. That’s much better advice. You’ll notice I rephrased it as “when something threatens [your app’s] simplicity.”
Your app stays simple when it’s “one idea big.” As long as there’s a strong overarching theme of what it is and what it does, it’s not too hard to think about or talk about. When it starts getting big and sprawling, you need more than one sentence (or a lot of the word “and”) to describe it, and that’s when it gets harder.
In Rails, you make an app that follows The Rails Way. That’s really hard if you start adding new services, or anything that doesn’t act like an HTTP server. Those want to get out of your Rails app and into some other service. That is what threatens your simplicity.
Don’t just blindly separate everything into services. But do separate out pieces that don’t fit. If you can separate off a service and both the app and the service are cleaner and more coherent separately, they belong apart. A new SaaS wants to be nice and simple, and to have a clean ‘theme.’ That means it’s extra-likely that pieces that don’t fit should be separate services.