C++ Distributed Services

Build Distributed Services in C++

HTTP, WebSocket, TCP, Pub/Sub, Mesh Networking, Jobs, Cache, ORM — all in one framework. Include one header and you're ready to go.

Read the Docs
Node 1LeaderNode 2FollowerNode 3FollowerMobile AppiOS v2.4Web BrowserChromeDashboardAdmin PanelChat AppSlack BotGPS TrackerVehicle #42Sensor HubFactory Floor
HTTP
WebSocket
TCP
Mesh Node

Clients connect via HTTP, WebSocket, and TCP to a self-organizing mesh cluster

  • Single header include to get started
  • Automatic node discovery via gossip
  • Raft consensus built-in
  • Self-organizing cluster topology
  • MySQL ORM with connection pooling
0
Transport Protocols
0
Header to Include
0k+
Connections/Node
0
Config Required

Multiple Transports, One Framework

HTTP, WebSocket, and TCP — all running on the same node. Choose what you need, or use them together.

HTTP Router

Full-featured HTTP routing with authentication, validation, and policies. Define your API endpoints with ease.

WebSocket

Real-time bidirectional communication with built-in connection management and message broadcasting.

TCP Services

Low-level TCP services for custom protocols. Full control over connection handling and data streams.

Pub/Sub Channels

Public, private, and presence channels with JWT authorization, membership tracking, and expiration.

Distributed Cache

Key-value store with vector-clock consistency, TTL, and anti-entropy synchronization across the mesh.

Jobs & Queues

Dispatch jobs, manage queues with worker pools. Configure retries and timeouts, all mesh-aware.

Simple, Expressive API

Define HTTP routes, WebSocket handlers, and TCP services with a clean, modern C++ API. Your services automatically join the mesh and start communicating.

HTTP Endpoints

RESTful APIs with routing, auth, validation, and policies

WebSocket Handlers

Real-time connections with channels and broadcasting

TCP Services

Custom protocols with full stream control

main.cpp
#include <framework.hpp>

using namespace framework;
using namespace framework::clients::http;

int main() {
    framework::app app;

    app.register_endpoint(
        http_verb_t::get,
        "/api/users",
        [](const http_request& req) -> http_response_t {
            auto res = helpers::make_base_http_response(
                req, http_status_t::ok);
            auto body = helpers::make_base_http_payload(
                200, "ok");
            helpers::finalize_response(res, body);
            return res;
        }
    );

    app.register_endpoint(
        http_verb_t::post,
        "/api/users",
        create_user_handler,
        create_user_validator,
        nullptr,
        false
    );

    app.run_http_service(8080);
    app.run();
}

Built-in Mesh Networking

Your services form a self-organizing cluster out of the box. Automatic node discovery via gossip protocol, with Raft consensus for distributed coordination.

Node 1LeaderNode 2FollowerNode 3FollowerCacheKey-Value StorePub/SubChannelsJobsWorker QueueMySQLORMRaftConsensus
Cache
Pub/Sub
Jobs
MySQL
Raft

Internal services: Cache, Pub/Sub, Jobs, MySQL ORM, and Raft consensus across mesh nodes

Auto Discovery

Nodes find each other via gossip protocol

Distributed Cache

Vector-clock consistency with TTL

Pub/Sub Channels

Public, private, and presence channels

Ready to build distributed systems?

Include one header. Define your services. Let the framework handle the mesh.

Get Started