Communication and storageMessaging patterns and Atlas Mesh

Messaging patterns and Atlas Mesh

Choose managed sockets or topic propagation for application messages.

Choose managed messaging for socket-pattern byte exchange, Atlas Mesh for authenticated topic propagation, or events for typed notifications.

Your application protocol interprets socket messages. A successful send does not save a record or publish a typed event.

Select a pattern

PatternApplication useResponsibility
PairOne peer conversationBind the expected peer identity
Publish and subscribeOne producer, interested receiversDefine topics, authority, and missed-message behavior
Request and replyBounded query and responseSet a deadline and correlate the response
Push and pullDistribute work to receiversDefine admission and duplicate-work handling
Router and dealerAddressed concurrent conversationsBound in-flight requests and preserve correlation

Use the selected language declarations for open, bind or connect, send, receive, queue inspection, close, timeout, and cancellation. A native socket API may not exist in another binding.

Define the application protocol

Document payload encoding, maximum size, schema version, correlation identity, deadline, and error response. Authenticate the remote peer and authorize the requested operation before interpreting a request as permission to act.

A timeout means the response did not arrive before the deadline. It does not prove that the remote action never executed.

If the caller retries a side-effecting request, keep a stable application operation identity and implement deduplication at the receiver. Do not claim exactly-once behavior from a socket pattern alone.

Atlas Mesh

Atlas Mesh is the Platform's replaceable topic-scoped propagation protocol. It supplies authenticated message verification, deduplication, rate limiting, and bounded priority queues. It does not impose your application's topic hierarchy or data model.

Subscribe only to needed topics. Treat duplicate suppression and rate limits as protocol behavior, not permanent business-level deduplication. A peer outside the topology or a disconnected subscriber can miss a live message.

Native and Dart Platform targets expose managed Atlas Mesh operations. The browser target does not provide that native mesh workflow. Do not interpret a value constructor or availability probe as a running mesh connection.

Storage and lifetime

Choose a message store when you need its retention or acknowledgment behavior. Memory, SQLite, and PostgreSQL availability depends on the target. Specify retention, acknowledgment policy, and replay position. A live subscription has durable replay only when its store contract provides it.

Bound receive queues and outstanding sends. Observe drop and capacity signals. On shutdown, cancel pending receives, close sockets, and join their tasks before replacing the Platform session. Process logging can remain a separate owner.

Use events for notification identity and event-before-state handling. Use streams for continuous typed samples and independent consumers.