Category: Development

Your startup doesn’t need microservices

A freelance developer recently posted on r/SaaS something that made me laugh because of how real it is. When a non-technical founder asks for a simple MVP, the build takes two weeks and the quote is reasonable. But when a founder asks for microservices and Kubernetes “so we can scale to millions,” the quote doubles.

Instead of a simple session handler, now there’s a separate Auth Service. That’s 10 billable hours. Instead of one SQL database, now there are three syncing via events. That’s a week of work. Instead of a $5 VPS, there’s a complex AWS cluster to configure. The app does the exact same thing. It just costs $5.000 a month to maintain instead of $50.

I’ve seen this play out too many times. So here’s my take on why microservices are almost always the wrong choice at the early stage, and what to do instead.

(more…)

Database-efficient API pagination

When designing APIs, you will probably need to handle a way to paginate the results in a collection.

Depending on the database you are using, the first thing that could come to your mind could be to use your database limit and offset to paginate the results. This may be tempting, but sometimes it could be better to rely on something else.

Imagine you have a list of messages in a chat application, and for the first call, you show the first 15 messages. Now you want to get the next page of results, say other 15 messages past the ones you already have, so you do LIMIT 15 OFFSET 15 in your database. Cool right?

(more…)

Common database paradigms

From the simplest to the more advanced, here is a list of different database paradigms with an introduction and some use cases for each one.

Use this index if you want to navigate directly to a specific one.

  1. Key-value
  2. Wide column
  3. Document
  4. Relational
  5. Graph
  6. Search
(more…)