Skip to main content

Command Palette

Search for a command to run...

Mistakes I Made in My Backend Projects

Updated
2 min read

When I look back at the products I built and shipped, I see a lot of things I could have done better. At the time, everything felt fine, but using my own API or working on real features showed me the problems clearly.

Here are some lessons I learned the hard way while building real backend systems.

1. Overusing UUID

I used UUID everywhere without thinking much.

Problems:

  • Hard to read and debug

  • Makes query and indexing heavier

  • Not always needed

What I Learned:

Use UUID only when there is a real reason (eg, public IDs). Otherwise, simple integer IDs are easier and faster.

2. Not giving Importance to Slug

I didn't care much about Slug.

Problems:

  • URLs look messy

  • Hard to understand resources

  • Not user-friendly

What I Learned:

Slug is not just for looks. It helps in making clean and meaningful APIs.

3. Neglecting Hierarchy in API

I didn't build APIs based on relationships.

Problems:

  • Endpoints felt random

  • Hard to understand data flow

  • Lost domain meaning

What I Learned:

APIs should follow how data is related, not just how tables are created.

Example

Bad:

/lessons/{id}

Better:

/units/{id}/lessons/{id}

4. Focusing on Global Uniqueness

I tried to make everything globally unique.

Problems:

  • Unnecessary restrictions

  • Made design more complex

Example:

Making product name unique in whole system instead of inside a category.

What I Learned:

Uniqueness should be inside a domain or sub-domain, not always global.

5. Not Thinking About Frontend Usages

This one is subtle but important. I was only thinking from backend side.

Problems:

  • Data not shaped properly

  • Hard to use APIs

What I Learned:

Backend is not just about building APIs. It's about how easy those APIs are to use.

Final Thought

Looking back at these lessons helped me more than any tutorial ever could.

We build -> struggle -> make mistakes -> fix -> repeat.

Nobody starts perfect. But ignoring mistakes is worse than making them.