I cut my startup's back end down to four APIs so a new developer could get productive.

I published this video in June 2025, about halfway through rewriting the 200,000 lines of code behind SnapSuite, my startup's business management tool for contractors. In Part 1 I explained why I decided to rewrite it. This part is the architecture I chose, and it starts with a rule some developers won't like: the whole front end talks to four APIs.

The business case

For the 30 days before this video, I'd been using ChatGPT as a pair programmer, because I don't have another developer sitting next to me. The bigger job was deciding what the new system should look like.

The problem I kept coming back to was onboarding. The old API surface was so large that a new developer had to read through a mountain of it before they could do anything useful. Big companies hit that wall all the time. We're a small company, and we hit it anyway because the app has been around for so long.

So the point of the redesign was simplicity. A developer should be able to build one piece of the system without understanding all of it. Some of my choices are controversial in the development world, and I said so in the video. I'll take controversial if it makes things simple.

How the old app worked

The front end is written in Vue.js. It sends data to an Azure Function, which is roughly what AWS Lambda is on the AWS side. The function saves the data to Azure Cosmos DB (think DynamoDB if you're on AWS), puts it on an Azure Service Bus queue, and another function picks it up and writes it to the database.

That design works, and it's solid. When the last step fails, a developer can go to the Cosmos DB log, find the record by its status, replay it locally and push it into the right database.

One database per customer

Early on, somebody decided every customer would get their own database, so the data would be 100% isolated. A decade later, I think that was the wrong call for us, and I wouldn't go down that road again. There are cases where it makes sense. For us, there are better ways to handle it now, and we've merged everything into one master database.

Four APIs and nothing else

Goal number one. The entire application has four APIs: create, read, update and delete. That's deliberate, so the front end stays dramatically simple.

Two ideas carry the complexity behind those four. First, everything is an activity. A create is an activity, an update is an activity and a delete is an activity, the same way you'd think about an event. Second, every request carries an action, and each action has an ID.

Action IDs route the data

You can think of an action as a table. The mapping isn't perfect, but I'd put it at about 90%. Say the app has a clients table and a projects table. The front end sends a JSON payload with action ID 1, and the back end routes it to clients. Action ID 2 routes it to projects. Reads work the same way.

I'm simplifying here. Behind the routing, the server runs validation and security checks before anything touches a table. The action ID says where the data should go, and the server still decides whether it's allowed to get there.

One field at a time

Updates don't send the whole record. As you type, the app waits. About 500 milliseconds after you stop, it saves that one column of that one row. My analogy in the video was a laser taking off a single hair instead of a razor shaving the whole beard.

It's noisier. Each transaction is small, fast and simple, though, and it keeps the API generic: which action, which field, which value. Deletes are soft deletes. The record gets hidden from the user and stays in the database, except in rare cases like someone cancelling their account, where we do remove the data.

Jump to

I draw the whole design on a whiteboard in the full video on my channel: Rewriting my startup, Part 2 on YouTube.

The new save path

In Part 1 I showed the old app's annoying save: you add a record, it shows up, disappears, then comes back a second later once the database confirms it. I wanted that gone.

Now, when you press save, the Azure Function writes to Cosmos DB first. There's no logic in that step, so there's nothing to fail. It wraps the data in a package and stores it, which means I can tell the user nothing was lost on that request, short of a major catastrophe.

Then, in the same function, it writes to the relational database. That's the change from before. Once the database transaction comes back fine, it puts the record on the Service Bus queue. Only then does the user see that it saved. By my estimate in the video, that adds a second or two. In exchange, the user gets a real database ID right away, and that ID belongs to data that's in the database.

Three copies before success

My comparison in the video was cloud storage. When you upload a file to blob storage on Azure, AWS or Google, the provider writes it to more than one place before it confirms. Azure's locally redundant storage, for example, keeps three copies in one data center. I took that principle and made my own version of it. My three copies are Cosmos DB, the relational database and the queue.

Jobs that do one thing

The queue is there so other work can happen without the user waiting. Say you create a client. A set of background jobs is listening, and each one has a single purpose. One looks up the address. Another finds the latitude and longitude. Another runs a more advanced calculation. Each does its work on its own time and writes the result back to that record.

Architecture sticklers will say each service should have its own database. I know the trade-offs, and I made the choice anyway. In the video I said I'm using Service Bus a bit like Apache Kafka, as a log. You could swap in Kafka or RabbitMQ for the same job.

Why this matters

The part I most wanted people to take away is this. I can hand a developer one of these services, and they need no knowledge of the wider infrastructure. The message on the queue carries everything, and a shared library with a write method knows how to put the data back in the database. Another developer can build the next service on their own. That's what the redesign is for: a new developer gets productive on one small piece without learning 200,000 lines first.

I promised a Cosmos DB deep dive in this one and ran out of time, so that's for the next part.

If you're untangling an over-built back end of your own, book a strategy call and we can talk it through.

About Dwain

Dwain Browne

I'm Dwain Browne, Founder of LeadScore AI and SnapSuite. I'm a Toronto-based software architect with 25+ years across software, sales, operations and entrepreneurship. SnapSuite helps contractors and trades teams get paid faster, and LeadScore AI shows you which leads deserve your next call. I also run Vibe Code to Profit, a community helping people build software with AI.

YouTube · LinkedIn · Book a call