A microservice-like paradigm for real-time communication at global scale.
Micro Socket brings the microservice mindset to WebSockets and real-time systems: one sub-socket (subscription group) per topic, scalable to millions of broadcasts, with clear invariants (ACL, dedup, ordering, resume) and a single protocol across gateways.
- Documentation — Methodology, sub-socket model, invariants (I₁–I₇), algorithms, architecture, and code examples (EN / TR / ES). Built with VitePress.
| Concept | Description |
|---|---|
| Sub-socket | One logical subscription group per topic. Scale unit = number of sub-sockets, not raw connections. |
| Main + sub | One “main” feed (e.g. raw prices); many “sub” streams (e.g. same feed + margin per channel). Different clients get different views. |
| Invariants (I₁–I₇) | No unauthorized access (ACL), no double processing (dedup), ordering (seqNo), delivery guarantee, latency SLO, resume after disconnect, data integrity. |
| Protocol | Setup → Subscribe → Message/Ack; optional Publish with messageId (dedup), Resume with sessionId + lastSeq. |
npm install
npm run docs:devOpen http://localhost:5173. Use the sidebar for methodology, algorithms, and examples. Languages: English (default), Türkçe, Español.
| Command | Description |
|---|---|
npm run docs:dev |
Dev server (localhost:5173) |
npm run docs:build |
Production build |
npm run docs:preview |
Preview production build |
- Methodology — What Micro Socket is, principles, global problems and solutions.
- Sub-Socket Model — Server/client sub-sockets, data structures, broadcast flow.
- Invariants — I₁ (ACL) through I₇ (integrity).
- Algorithms — Master flow, dedup, ACL, ordering, resume; Mermaid diagrams.
- Architecture — High-level diagrams, data flow, scaling.
- Examples — Elysia gateway, price-feed gateway, Node.js gateway/client/backbone, E2E.
- Test & Fintech — Test matrix, metrics, fintech use cases.
Full navigation and details are on the documentation site (run locally with the commands above or use the deployed site if you have one).
- Documentation (this repo) — Run with
npm run docs:dev(see above). - GitHub — github.com/oguzhan18/micro-socket — Star the repo if this is useful to you.
See the repository for license information.