𝗪𝗵𝘆 𝘁𝗵𝗲 𝗯𝗼𝗿𝗶𝗻𝗴 𝗱𝗲𝗰𝗶𝘀𝗶𝗼𝗻𝘀 𝘄𝗲𝗿𝗲 𝗺𝘆 𝗯𝗲𝘀𝘁 𝗱𝗲𝗰𝗶𝘀𝗶𝗼𝗻𝘀
I used to think being a good developer meant writing complex code.
I was wrong.
While designing an MVP for a medical clinic that will eventually become a multi-tenant SaaS, I learned a hard lesson. The code is the easy part. The hard part is deciding what NOT to build.
The temptation was to use microservices, events, and Kubernetes. It looks great on a CV. But microservices have a high cost. You pay for them with complex pipelines, versioning issues, and difficult debugging.
With a team of three people and few users, microservices are just extra work. You solve problems you do not have yet.
Instead, I chose a simple layered architecture with .NET 8 and PostgreSQL. It costs about $30 per month.
I focused on smart, cheap decisions that are expensive to change later:
• Added a TenantId column to every table from day one. • Used Docker from the first commit. • Created an interface for the WhatsApp provider.
These took one afternoon each. They turned future migrations into simple configuration changes.
I also learned to negotiate patterns with the business needs.
For example, I used the Outbox pattern for WhatsApp notifications. Booking an appointment must be fast and reliable. Sending a message can happen two seconds later. If WhatsApp is slow, the appointment still works.
However, I rejected "eventual consistency" for medical records. A medical diagnosis must be accurate and immediate. In healthcare, legal requirements are actually architectural requirements.
I also looked at the real math.
A Kubernetes setup (EKS) would cost $545 to $615 per month. An AWS Fargate setup costs $350 to $420 per month.
That is a saving of over $150 every single month. I chose Fargate because it is simpler and cheaper for our current size.
My strategy is simple:
- Use layers first.
- Use events when external dependencies (like WhatsApp) start to affect your system.
- Move to microservices only when the volume and team size require it.
Do not design for twenty clients you do not have yet. Build for the client that is paying you today.