Ably Cluster Architecture and Four Primary Layers
Ably runs on AWS EC2 infrastructure with clusters typically spanning 2 to 10 regions. Each regional deployment operates independently, handling its own connections, REST traffic, and channel management. Cross-region message flow is peer-to-peer to eliminate bottlenecks.
The architecture consists of four primary layers:
- Routing Layer: Provides intelligent, latency-optimized routing for client connectivity.
- Gossip Layer: Distributes network topology information and facilitates service discovery.
- Frontend Layer: Handles REST requests and maintains realtime connections (WebSocket, Comet, SSE).
- Core Layer: Performs central message processing for channels.
Scaling is achieved through intelligent load distribution:
- Frontend: New instances join the load balancer pool automatically.
- Core: Uses consistent hashing to distribute channels across core processes, ensuring even load distribution as the cluster scales.