Messaging foundations

A database accepts only so many connections, and requests keep coming. This Architecture Weekly edition works through that problem by building a connection pool in TypeScript. Failing fast or retrying in a loop doesn’t scale, so requests wait in a queue. An unbounded queue brings its own trouble, so the pool adds backpressure and rejects excess requests. Moving queue handling into one broker gives you the single-writer pattern.

The last part shows the same patterns at system scale: SQS with Lambda, Cloudflare’s CDN and Kafka consumer groups.

  1. Architecture Weekly #190 - Queuing, Backpressure, Single Writer and other useful patterns for managing concurrency

    2024-08-12Welcome to the new week! In the last edition, we explored why connection pooling is crucial for using databases efficiently. Now, let’s take a step further and perform a…