TopicsMessaging
Messaging
Kafka, event-driven architecture, outbox and CQRS, WebSockets, MQTT, and queues you can defend in interviews.
Common tags: kafka, eda, outbox, queues
- Messaging
Event-Driven Architecture — Sync vs Events, Patterns & Tradeoffs
Cluster · Event-Driven Architecture
Event-driven architecture publishes facts that already happened. This hub maps sync versus events, notification versus carried state versus sourcing, and where CQRS, the outbox, ordering, and failure modes sit.
Open study →- messaging
- event-driven
- eda
- cqrs
- outbox
- event-sourcing
- interview
- Messaging
Transactional Outbox, Inbox & Consumer Idempotency
Cluster · Event-Driven Architecture
A dual-write commits the database and publishes as two steps, so one can succeed alone. The outbox makes the intent to publish part of the local commit. The inbox makes at-least-once delivery safe.
Open study →- messaging
- event-driven
- eda
- cqrs
- outbox
- event-sourcing
- interview
- Messaging
Ordering, Partitions, Poison Messages & Retry/DLQ Strategy
Cluster · Event-Driven Architecture
Most event-driven flows need order per entity, not global order. Partitions buy parallelism. Bounded retries and a dead-letter path keep one poison message from stalling that entity.
Open study →- messaging
- event-driven
- eda
- cqrs
- outbox
- event-sourcing
- interview
- Messaging
EDA Failure Modes — Dual Writes, Schema Drift & Fan-out Blast Radius
Cluster · Event-Driven Architecture
Event-driven systems fail in known ways: dual-write loss or ghosts, schema changes that break a fleet, and one poison event amplified across every consumer. Containment is outbox, compatible rollout, and per-consumer isolation.
Open study →- messaging
- event-driven
- eda
- cqrs
- outbox
- event-sourcing
- interview
- Messaging
Event Types — Notification, Event-Carried State Transfer & Event Sourcing
Cluster · Event-Driven Architecture
Notification, event-carried state transfer, and event sourcing are different contracts. Payload richness decides coupling, races, and whether the log is the source of truth.
Open study →- messaging
- event-driven
- eda
- cqrs
- outbox
- event-sourcing
- interview
- Messaging
CQRS — Commands, Queries, Projections & Consistency
Cluster · Event-Driven Architecture
CQRS splits commands that change state from queries shaped for screens. In an event-driven system the read side is usually a projection, and lag is an SLO rather than a stuck write.
Open study →- messaging
- event-driven
- eda
- cqrs
- outbox
- event-sourcing
- interview
- Messaging
WebSockets & MQTT — Real-Time Protocols for Senior Interviews
Cluster · WebSockets & MQTT
Interviewers ask how you push live updates without burning sockets, batteries, or ops. WebSockets give full-duplex browser streams; MQTT gives topic-based pub/sub for devices. SSE, long-polling, and Kafka-style logs fill different niches — this hub maps the cluster.
Open study →- websockets
- mqtt
- sse
- realtime
- pubsub
- system-design
- interview
- Messaging
WebSocket vs SSE vs Long-Polling vs MQTT — When to Choose What
Cluster · WebSockets & MQTT
Choose a realtime channel from directionality, client environment, proxies, battery, topic routing, and durability. Pick the simplest protocol that fits; bridge to Kafka only when replay is a product requirement.
Open study →- websockets
- mqtt
- sse
- long-polling
- realtime
- system-design
- interview
- Messaging
WebSocket Protocol — Handshake, Frames, Ping/Pong & Close Codes
Cluster · WebSockets & MQTT
RFC 6455 upgrade is HTTP 101 plus Accept = base64(SHA1(key + GUID)). Frames carry opcodes and masking; ping/pong is the application keepalive. Close 1001 drains deploys; 1006 is an abnormal drop with no close frame.
Open study →- websockets
- websocket
- realtime
- system-design
- interview
- Messaging
Scaling WebSockets — Sticky Sessions, Fan-out & Backpressure
Cluster · WebSockets & MQTT
A WebSocket is pinned to the process that accepted the TCP connection. Sticky affinity reduces reconnect churn, but multi-node rooms need a fan-out bus. Bounded queues, coalesce, and disconnect-slow-clients keep one laggy socket from OOM-ing the node.
Open study →- websockets
- fanout
- sticky-sessions
- realtime
- backpressure
- system-design
- interview
- Messaging
MQTT Essentials — Topics, QoS 0/1/2, Retained Messages & Sessions
Cluster · WebSockets & MQTT
MQTT is broker-centric pub/sub: hierarchical topics, hop-scoped QoS 0/1/2, retained last-value, and clean vs persistent sessions. Effective QoS is the min of publish and subscribe. QoS 2 is not Kafka exactly-once.
Open study →- mqtt
- qos
- pubsub
- realtime
- system-design
- interview
- Messaging
MQTT Brokers, Auth & Bridging — ACL, Wildcards, Last Will & Bridge Patterns
Cluster · WebSockets & MQTT
The broker authenticates, ACLs by topic, stores retained and sessions, and publishes Last Will on unclean disconnect. Namespace tenants; never grant # to untrusted clients. Bridge with prefix rewrite so topics cannot loop. MQTT QoS 2 is still not Kafka exactly-once.
Open study →- mqtt
- lwt
- pubsub
- qos
- realtime
- system-design
- interview
- Messaging
Schema Evolution, Compatibility & Dead Letter Queues
Cluster · Kafka messaging
Avro/Protobuf/JSON Schema; FORWARD/BACKWARD/FULL; poison→DLQ/retry; never block forever on bad payload.
Open study →- kafka
- schema-registry
- avro
- protobuf
- DLQ
- Messaging
Partition Keys — Ordering Guarantees vs Parallel Throughput
Cluster · Kafka messaging
hash(key)%N sticky order; null keys sticky/RR; repartition breaks affinity; hot keys/sticky partitioner.
Open study →- kafka
- partition-keys
- ordering
- throughput
- hot-keys
- Messaging
Delivery Semantics — At-Least-Once, At-Most-Once & Exactly-Once
Cluster · Kafka messaging
AMO vs ALO vs EOS (idempotent producer+transactions); external side effects still need idempotency keys.
Open study →- kafka
- delivery-semantics
- eos
- idempotency
- transactions
- Messaging
Consumer Rebalancing, Lag & Backpressure
Cluster · Kafka messaging
Cooperative sticky vs eager; lag as offset gap; pause/resume; scale consumers vs partitions.
Open study →- kafka
- rebalancing
- lag
- backpressure
- cooperative-sticky
- Messaging
Apache Kafka — Topics, Partitions, Brokers & Consumer Groups
Cluster · Kafka messaging
Append-only partitioned logs; consumer group assigns each partition to at most one member; durability=ISR; scale=partitions; order=within partition.
Open study →- kafka
- messaging
- event-driven
- partitions
- consumer-groups
- brokers
- ISR