HavenDOCS
Back to Home

Matchmaking Vibe (Connect)

The heart of Haven is its high-speed Matchmaking Engine. It connects two souls instantly across the globe for a direct, high-fidelity experience.

🧬 The "Connect & Vibe" Engine (2026)

Unlike early prototypes which relied on heavy database polling, the current Haven engine is a dedicated WebSocket Pulse microservice.

Why We Migrated:

  1. Massive Concurrency: The WebSocket Pulse handles 10,000+ simultaneous connections without breaking a sweat.
  2. Speed: In-memory matching occurs in <5 milliseconds.
  3. Safety: Real-time signal relay ensures faster WebRTC handshakes and instant disconnection sensing.

🚦 The Connection Process

When you click "Drop In":

  1. Pulse Handshake: The client establishes a secure path to NEXT_PUBLIC_MATCHMAKING_WS_URL.
  2. Preference Match:
    • Buddies First: The server prioritizes pairing you with an online "Buddy" (mutual connection) if they are also in the queue.
    • Global Pool: If no buddies are waiting, you are added to the general vibe pool.
  3. The Session:
    • Once a pair is found, the Pulse generates a unique sessionId.
    • Both clients receive a match_found message containing their partner's identity.
    • DB Handover: At this point, the session is logged to Supabase to prepare for message persistence and call logs.

🛡️ Real-time Safety

During the search and call:

  • Instant isolation: If a user is reported, the Pulse immediately isolates the reported ID in memory for that session.
  • Auto-Ban Score: Multiple reports across different sessions trigger a score-based exclusion from the vibe pool to protect the community.

⚡ Technical Benchmarks

  • Time-to-Queue: ~20ms.
  • Matching Latency: <5ms.
  • Relay Performance: Sub-2ms for WebRTC signals.

Created by the Haven Matchmaking Bureau.