Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Patterns - Messaging, Publisher-subscriber, dynamic routing

Discussion on Messaging pattern Context: Some distributed systems are composed of services that were developed independently. To form a coherent system, however, these services must interact reliably, without incurring overly tight dependencies on one another. Problem Integrating independently developed services, each having its own business logic and values, into a coherent application requires…

Messaging, Publisher-Subscriber, and Dynamic Routing are three common patterns used in distributed systems to enable reliable and efficient communication between services.

In the Messaging pattern, services exchange data asynchronously via a message bus. The sender and receiver encode messages containing request data and types, allowing them to communicate without needing to know each other's data types statically. This decouples services, enabling them to interact without concerns about networking and service location. However, the lack of statically typed interfaces makes it challenging to validate system behavior beforehand and adds extra time and space for message processing.

The Publisher-Subscriber pattern allows components in an application to operate independently while still disseminating information to other components when necessary. A notification mechanism informs components about state changes or events affecting their computation. Components only need to know when another component is in a specific state, not which specific component it is.

This decouples applications and allows components to remain independent. However, the publisher can cause unnecessary overhead if subscribers are interested only in a specific type of event, resulting in filtering events and potential performance issues.

Lastly, the Dynamic Routing pattern is useful for building complex business processes from simple services. Routing messages through a distributed system based on filtering rules is inefficient because each message is inspected by every filter and router, whether or not it can be processed. A message router with filtering rules and knowledge about processing destination paths ensures messages are delivered only to processing endpoints capable of handling them.

This approach eliminates the need for services to deal with networking concerns or know each other's location, optimizes communication, and allows services to dynamically become available or unavailable. However, dynamic routing introduces performance overhead, a single point of failure, and potentially complex behavior when rules conflict.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

bigcommerce-api-mcp: Authentication Stopped at the Door but Not on the Transport Routes

bigcommerce-api-mcp: Authentication Stopped at the Door but Not on the Transport Routes An MCP server can expose a small number of routes and still have more than one security boundary.

  • CVE-2026-138034 affected bigcommerce-api-mcp versions prior to 1.0.1
  • /sse and /messages routes bypassed authenticateRequest middleware
  • Upgrade to version 1.0.1 or later to mitigate risk

Parsing Character Card V2/V3 PNG Chunks in Pure Browser JS & Building a Zero-XSS Regex Status Bar Sandbox

Interactive fiction and AI roleplay creators pass around thousands of "character cards" every week—portable PNG portraits that secretly carry structured JSON world lore, persona definitions, alternate…

  • Character Card V2/V3 PNG chunks parsed using pure browser JS
  • Zero-dependency, browser-native engine developed by Rubii AI
  • Allowlist-based HTML/CSS sanitizer prevents zero-XSS regex vulnerabilities

More from Saturday, 28 November 2026 →