Designing a Spring Boot API for a Small SaaS MVP
· Suroj Dangol ·7 min read
Building a SaaS MVP doesn't require every best practice. The goal is shipping a working product fast enough to validate demand, then tightening things once you have real users. Here are practical decisions I've made across several MVP launches, including GSewa and ariasys.
## Start with a module, not microservices
Separating into separate services too early introduces deployment overhead, distributed tracing, and coordination costs before you know whether the feature set will justify them. A modular monolith lets you split boundaries later with minimal rework if the domain shapes emerge clearly.
In practice this means keeping packages clean—`api`, `domain`, `infrastructure`—and avoiding circular dependencies between them. When one module truly grows beyond what a single deployable can hold, extracting it becomes straightforward because the interfaces are already explicit.
## Pick one ORM and stick to it
JPA/Hibernate is mature and well-supported with Spring Data repositories. It reduces the amount of SQL you need to write while still giving you control through native queries where performance matters. Using two persistence approaches in the same codebase (for example raw JDBC here, JPA there) creates confusion and makes refactoring slower.
A practical rule: use Hibernate for standard CRUD and entity relationships; drop to a native query only when the generated SQL is demonstrably slow under load or when a complex join is unavoidable.
## Decide your auth strategy in week one
SaaS products need multi-tenancy at some point, but most don't need it day one. Starting with application-level authentication (Spring Security with JWT) keeps the database simple. If you later need row-level isolation, you add a tenant identifier column and a `TenantFilter`—something much easier to retrofit into a single-database setup than switching after launch.
Don't implement SSO, OAuth providers, or RBAC until you have actual requests for them from customers. That level of identity infrastructure adds weeks to a first release.
## What to defer past v1
- Pagination on list endpoints that rarely exceed 50 results
- Event-driven async processing for non-critical paths
- Full audit logging (track key mutations at minimum)
- Rate limiting (add it once traffic patterns emerge)
Shipping without these is normal. Shipping with half-implemented versions of them is what causes technical debt.
## Measurable outcome from recent MVP work
On the ariasys platform—a project analytics tool for engineering and construction firms—the initial API served 1,200 monthly active users within six months using a single Spring Boot service. The decision to stay monolithic for v1 allowed us to ship feature branches in hours rather than days, and we haven't needed to extract a second service yet.