Skip to content

Communication Patterns

A robust distributed system relies on well-defined communication patterns. The Simple Platform employs three primary methods, each optimized for a specific purpose: a public-facing GraphQL API, an internal asynchronous event bus, and a high-speed RPC mechanism for core services.

1. The GraphQL API (Client-to-Platform)

All external communication with the Simple Platform happens through a single, unified GraphQL API. This is the primary endpoint for the web UI, mobile apps, command-line tools, and third-party integrations.

  • Endpoint: The Data API Gateway service.
  • Purpose: To provide a flexible, secure, and performant way for clients to query, create, update, and delete data.
  • Benefit: Developers get a powerful and self-documenting API that completely abstracts the underlying microservice complexity. The proprietary GraphQL-to-SQL engine ensures every query is highly optimized and secure by default.

2. The Event Bus (NATS)

For asynchronous, internal communication between services, the platform uses a high-performance event bus powered by NATS.

  • Pattern: Publish-Subscribe (Pub/Sub).
  • Purpose: To decouple services. A service can publish an event (e.g., invoice.created) without knowing or caring which other services need to react to it.
  • Benefit: This creates a highly resilient and scalable system. If a downstream service is temporarily unavailable, events can be queued. New services can be added to respond to existing events without reconfiguring the entire system. This is the backbone of the platform's extensibility.

3. Internal RPC (Elixir & OTP)

For critical, high-speed, synchronous communication between our core Elixir-based services, the platform leverages the native power of the Erlang VM (OTP).

  • Pattern: Remote Procedure Call (RPC).
  • Purpose: Used for internal, tightly-coupled requests where an immediate response is required, such as the Data API Gateway needing to look up tenant metadata from the Metadata Service.
  • Benefit: This communication is incredibly fast and fault-tolerant. Built on Elixir/OTP, it takes advantage of a battle-tested foundation known for massive concurrency and self-healing properties, ensuring the core of the platform is exceptionally robust.

Next Step

With an understanding of the high-level architecture, let's dive deeper into the foundation of every Simple application: the Data Layer.

The Data Layer