Architecture Overview

How Roomzin delivers predictable latency at global scale

Roomzin platform architecture diagram

SDK / RzProxy → Edge Router → Zone Router → RzBridge → Roomzin Shard

Overview

Roomzin is a distributed in-memory inventory engine designed for booking workloads.

The application uses one logical inventory endpoint. Routing, shard topology, replication, and node failures are handled internally.

Why Booking Inventory Is Different

Booking queries combine availability, dates, geography, room types, pricing, amenities, and policies. Roomzin uses a fixed schema and specialized in-memory execution to make these queries predictable.

Platform Architecture

Request Flow

Applications do not need to know the active zone, shard, node, or leader.

Access Layer

SDKs

Supported SDKs:

Characteristics:

RzProxy

HTTP/JSON interface for legacy or non-native clients.

Routing Layer

RzRouter

One binary with two operating modes.

Edge Mode

Zone Mode

Routing occurs directly in the request path. No external proxy is required.

Bridge Layer

RzBridge

Shard-aware connector between routers and Roomzin nodes.

RzBridge knows:

Routing:

Writes → Leader
Reads → Followers

RzBridge isolates shard topology from the routing layer.

Leader changes and node failures do not require application-level topology changes.

Storage Layer

Roomzin

Roomzin is an in-memory inventory engine.

The hot booking window is stored in memory and organized into replicated shards.

The query engine is optimized for:

Each shard contains the complete dataset for that shard.

Query Execution

Fixed Schema

Booking attributes use fixed-size representations.

Attributes are represented as a bitmasks and numbers.

Benefits:

attributes
      ↓
bitmasks and numbers
      ↓
bitwise filtering

Maximum: 24 boolean attributes per each daily package.

Numeric Encoding

Human-readable values are converted to numeric identifiers during ingestion.

"pool" → bit position 2
"Hilton" → 16-bit ID 142

The query path operates on integers.

There is no runtime parsing or string interning.

Geospatial Indexing

Roomzin uses H3 for geographic indexing.

Segment-Based Execution

Inventory is partitioned into independent segments.

Query
  │
  ├── Segment A → Core 1
  ├── Segment B → Core 2
  ├── Segment C → Core 3
  └── Segment D → Core 4

Properties:

Segments execute in parallel and results are combined after processing.

Request / Response Pipeline

Roomzin uses independent request and response streams.

Request stream

Clients can send multiple requests without waiting for previous responses.

Response stream

Responses are returned asynchronously and may arrive out of order.

Each request contains a correlation ID.

Request 1 ─────┐
Request 2 ─────┼──→ Processing
Request 3 ─────┘

Response 2 ←──────
Response 1 ←──────
Response 3 ←──────

This avoids connection-level head-of-line blocking.

Replication

Each shard is a Raft cluster.

Leader

Followers

Full Replication

Every node in a shard contains the complete shard dataset.

Therefore:

Persistence

Roomzin uses lock-free snapshots for persistence.

Implementation uses Rust atomic references and copy-on-write.

Current characteristics:

Metric Value
Snapshot pause 4–10 ms
60M record load ~3 seconds
Snapshot size ~90MB for 5.3GB of raw data

Snapshot creation does not block query execution.

Global Distribution

Roomzin distributes inventory through zones and shards.

Global
 ├── Zone A
 │    ├── Shard 1
 │    └── Shard 2
 │
 ├── Zone B
 │    ├── Shard 3
 │    └── Shard 4
 │
 └── Zone C
     ├── Shard 5
     └── Shard 6

Routing tables determine:

Segment → Zone → Shard → Node

The application only sees the logical Roomzin service.

Control Plane

RzID

Lightweight service registry.

Responsibilities:

RzID is not on the request hot path.

RzPoint

Customer-provided HTTP service for resolving logical service identities to hostnames.

Works with:

RzPoint separates logical service identity from physical deployment.

Network Protocols

Connection Protocol
SDK / RzProxy ↔ Cluster TCP
Roomzin Node ↔ Node QUIC
RzProxy API HTTP/2
Discovery / RzPoint HTTP

Core Technologies

Architectural Constraints

Roomzin intentionally limits the query model.

These constraints are part of the execution model rather than configuration options.

Architecture Summary

Key properties:

Benchmarks

Run Roomzin against real booking inventory data.