DEV Community

Anshita Verma
Anshita Verma

Posted on

Lately, I’ve been digging into what actually slows down APIs. Here are a few bottlenecks that changed how I think about performance

• It’s not always the database, sometimes it’s how we call it.
Sending multiple small requests instead of batching them adds network overhead.
• Connections are expensive.
Rebuilding them on every request means repeated handshakes that could’ve been avoided with reuse.
• Even logging can slow you down.
Synchronous logs make the system wait after every write.
• Repeated data fetching is often self-inflicted.
If the same response is requested again and again, caching at the right layer can remove unnecessary load.
• Payload size matters more than expected.
Uncompressed JSON responses increase latency, especially at scale.
• Database connections are costly to create.
Without pooling, each request pays the setup cost
• And sometimes it’s just the format.
JSON is convenient, but not always efficient when compared to something like Protobuf

Top comments (0)