Building the MyZubster Metaverse: From Prototype to Secure Realtime Infrastructure

Leader ●2 ●22 ●155
calendar_today • schedule6 min read

Building the MyZubster Metaverse: From Prototype to Secure Realtime Infrastructure
The MyZubster Metaverse is evolving from a simple interactive experience into a distributed platform designed around secure identity, realtime communication, reliability, privacy, and verifiable collaboration.
During the latest development phase, we focused on the infrastructure required to operate the metaverse safely under real production conditions.
This article explains what we implemented, how the architecture works, what we verified, and what remains before the system can be considered production-ready.
The Current Architecture
The metaverse now follows a layered architecture:
Authenticated user

    ↓

MyZubster session

    ↓

Short-lived realtime token

    ↓

Authorized realtime channel

    ↓

Distributed gateway

    ↓

Redis coordination layer

    ↓

Presence, rate limits and observability
The objective is to prevent clients from connecting directly to unrestricted realtime resources.
Every connection must originate from an authenticated MyZubster session and receive only the permissions required for its specific room or operation.
Authenticated Realtime Sessions
We introduced a dedicated token exchange for realtime connections.
The server:

  1. verifies the current MyZubster session;
  2. checks whether the user may access the requested resource;
  3. generates a short-lived realtime token;
  4. restricts that token to authorized channels;
  5. rejects anonymous or malformed requests.
    This limits the damage caused by leaked tokens and prevents clients from subscribing to arbitrary rooms.
    A client cannot simply invent a room identifier and connect to it. Authorization is evaluated server-side before realtime access is granted.
    Channel Authorization
    Realtime channels are treated as protected resources.
    The authorization layer validates:
  6. user identity;
  7. session validity;
  8. resource ownership;
  9. room membership;
  10. token expiration;
  11. permitted operations.
    This establishes a clear trust boundary between the browser and the realtime gateway.
    The client requests access, but the server remains responsible for deciding whether that access is legitimate.
    Distributed Presence with Redis
    In-memory presence works only while a single application instance is running. It becomes unreliable when multiple instances or serverless functions are involved.
    We therefore introduced Redis-backed presence coordination.
    Redis is used to track:
  12. active participants;
  13. room membership;
  14. temporary presence state;
  15. expiration of abandoned sessions;
  16. coordination between separate gateway instances.
    Presence entries have a limited lifetime. If a client disappears without completing a normal disconnection, the corresponding state can expire automatically instead of remaining indefinitely.
    Graceful Redis Failure Handling
    Redis is now considered an explicit infrastructure dependency.
    The system distinguishes between:
  17. the application process being alive;
  18. the realtime gateway being operational;
  19. Redis being reachable;
  20. the complete service being ready to accept traffic.
    Failures are handled deliberately rather than silently ignored. This is important because returning a successful health response while the coordination layer is unavailable would provide misleading information to deployment systems and operators.
    Distributed Rate Limiting
    Local counters cannot reliably enforce limits across multiple runtime instances.
    We implemented a distributed rate-limiting foundation backed by Redis so that requests are evaluated against shared state.
    The rate-limiting system is designed to protect:
  21. realtime token generation;
  22. connection attempts;
  23. room joins;
  24. message publication;
  25. presence updates;
  26. abuse-sensitive API routes.
    This provides a foundation for defending the metaverse against spam, accidental request loops and automated abuse.
    Future work will refine quotas by route, identity, IP risk and operation type.
    Privacy-Safe Observability
    Reliability requires visibility, but observability must not expose private user information.
    The realtime infrastructure now supports structured operational signals for:
  27. authorization failures;
  28. connection lifecycle events;
  29. Redis availability;
  30. rate-limit decisions;
  31. degraded states;
  32. health and readiness checks.
    The goal is to make infrastructure problems diagnosable without logging raw credentials, session tokens or unnecessary personal information.
    Health and Readiness Endpoints
    A process being alive does not mean it is ready to serve realtime traffic.
    We extended the health model to include Redis readiness. The service can now report a degraded state when Redis is unavailable instead of returning an unconditional success response.
    Conceptually:
    Process alive + Redis unavailable
           ↓
    

    Service is not fully ready

           ↓
    

    Health response reports degradation
    This distinction is essential for:

  33. deployment validation;
  34. load balancers;
  35. automated monitoring;
  36. incident diagnosis;
  37. rolling releases;
  38. recovery procedures.
    Shared Redis Client
    A reusable Redis client layer was introduced to avoid creating duplicated connections across services and requests.
    The shared client centralizes:
  39. configuration;
  40. connection reuse;
  41. error handling;
  42. readiness checks;
  43. shutdown behavior;
  44. instrumentation.
    Centralizing this behavior reduces connection pressure and gives every Redis-dependent feature a consistent operational model.
    Preview Infrastructure
    The new realtime changes were deployed to an isolated Vercel Preview environment.
    This allows us to validate infrastructure modifications before they affect the public production deployment.
    The preview environment provides a safe place to test:
  45. application builds;
  46. serverless deployment behavior;
  47. environment configuration;
  48. readiness responses;
  49. Redis connectivity;
  50. authentication flows;
  51. realtime regressions.
    Production remains unchanged while the current pull request is still under review.
    Testing and Continuous Integration
    The implementation is covered by automated backend tests, including readiness behavior and Redis degradation scenarios.
    The principal validation pipeline successfully completed:
  52. backend tests;
  53. frontend tests;
  54. linting;
  55. application builds;
  56. Seller Free policy verification;
  57. continuous evidence generation;
  58. preview deployment.
    This provides strong evidence that the new infrastructure integrates correctly with the existing application.
    However, passing tests alone do not make the service production-ready. Runtime drills, dependency remediation and real multi-instance load testing are still required.
    Current Development Status
    The realtime readiness work is currently available in a draft pull request:
    MyZubster realtime readiness PR #40
    The implementation includes four focused commits:
    feat(realtime): expose Redis readiness
    test(realtime): cover Redis readiness
    feat(realtime): gate health on Redis
    test(realtime): cover Redis health degradation
    Keeping the commits focused makes review and rollback easier.
    Current Security Blocker
    The security audit currently reports vulnerabilities in the transitive ip-address dependency for versions up to 10.7.3.
    The available patched version is 10.7.4.
    Before merging the realtime work, we need to:
  59. identify which direct dependency introduces ip-address;
  60. update the dependency chain safely;
  61. regenerate the lockfile;
  62. run the complete test suite;
  63. repeat the security audit;
  64. confirm that no high or critical vulnerability remains.
    The pull request should remain in draft until this has been addressed and the runtime verification has been completed.
    What Still Needs to Be Done
  65. Dependency remediation
    Upgrade the affected dependency chain and obtain a clean security audit.
  66. Direct runtime verification
    Verify the deployed preview response from:
    /api/realtime/health
    The response should explicitly show whether Redis is ready and whether the service is operating normally or in a degraded state.
  67. Redis failure drill
    Temporarily simulate Redis unavailability in an isolated environment and verify that:
  68. readiness fails correctly;
  69. the service does not claim to be healthy;
  70. errors remain controlled;
  71. recovery occurs after Redis reconnects.
  72. Multi-instance load testing
    Run concurrent tests against multiple gateway instances and verify:
  73. shared rate limits;
  74. consistent presence;
  75. room synchronization;
  76. connection cleanup;
  77. acceptable latency;
  78. stable Redis connection usage.
  79. Restart and recovery testing
    Restart application and Redis instances while clients are connected.
    We need evidence that the platform can recover without leaving permanent ghost sessions or inconsistent presence records.
  80. End-to-end acceptance testing
    The complete flow must be tested:
    Login
    → request realtime token
    → authorize channel
    → connect
    → join room
    → publish event
    → update presence
    → disconnect
    → clean up state
    Unauthorized variations must also be tested.
  81. Production rollout strategy
    The production release should be gradual:
  82. deploy to Preview;
  83. complete runtime verification;
  84. run load and failure drills;
  85. review monitoring signals;
  86. merge after approval;
  87. deploy production;
  88. observe error rates and Redis health;
  89. retain a documented rollback procedure.
    Longer-Term Metaverse Roadmap
    Once reliability and security are validated, development can move toward the experience layer.
    Planned areas include:
  90. WebXR support;
  91. immersive rooms;
  92. interactive avatars;
  93. spatial collaboration;
  94. verified professional profiles;
  95. Zorgax integration;
  96. verified knowledge inside virtual environments;
  97. community-managed spaces;
  98. portable identity;
  99. privacy-safe analytics;
  100. independent interoperable nodes.
    The long-term objective is not merely to build another virtual world.
    MyZubster aims to combine identity, knowledge, collaboration and transparent open-source development inside an interoperable environment.
    Lessons Learned
    The most important lesson from this phase is that realtime development is not simply about sending messages quickly.
    A reliable realtime platform must answer several harder questions:
  101. Who is allowed to connect?
  102. Which channels may they access?
  103. How is state shared across instances?
  104. What happens when Redis fails?
  105. How is abuse limited globally?
  106. Can operators distinguish “alive” from “ready”?
  107. Can the system recover cleanly after a restart?
  108. Can failures be investigated without exposing private data?
    These concerns are now becoming first-class parts of the MyZubster architecture.
    Conclusion
    The MyZubster Metaverse has progressed beyond an isolated prototype.
    We now have the foundation for:
  109. authenticated realtime access;
  110. server-controlled channel authorization;
  111. Redis-backed presence;
  112. distributed rate limiting;
  113. privacy-aware observability;
  114. dependency-aware health checks;
  115. isolated preview deployments;
  116. automated tests and evidence generation.
    The next milestone is to prove that this architecture remains reliable under dependency failures, restarts, concurrency and realistic traffic.
    Only after those checks—and after resolving the current security advisory—should the realtime infrastructure be promoted to production.
    MyZubster remains an open-source project, and technical review, testing and constructive contributions are welcome.
    Project Links
  117. MyZubster repository
  118. MyZubster Metaverse
  119. Realtime readiness pull request
    Repository GitHub: https://github.com/danieldirimini-myzubster/myzubster
    Metaverso MyZubster: https://www.myzubster.com/metaverse
    Pull request Realtime Readiness #40: https://github.com/danieldirimini-myzubster/myzubster/pull/40
    Roadmap Linear MYZ-83: https://linear.app/myzubster/issue/MYZ-83/b6-realtime-observability-reliability-and-load-tests
    Organizzazione GitHub MyZubster Ecosystem: https://github.com/MyZubster-Ecosystem
    Profilo GitHub MyZubster: https://github.com/myzubster
    Sito principale: https://www.myzubster.com
    Knowledge Explorer: https://www.myzubster.com/knowledge
    Profilo Zorgax: https://www.myzubster.com/zorgax-profile-onboarding
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

AAIF Hits 10 Projects. Its CTO on What to Adopt Now and the Security Gaps Left Open

Tom Smithverified - Oct 23

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

🧠 **Coder Legion Dev Log — Building the MyZubster Metaverse from the infrastructure up**

Myzubster - Oct 7

# Building a Serverless-Safe Realtime Metaverse for MyZubster

Myzubster - Sep 1

I Wrote a Script to Fix Audible's Unreadable PDF Filenames

snapsynapseverified - Apr 20
chevron_left
4.4k Points • 179 Badges
Rimini
112Posts
17Comments
33Connections

Related Jobs

View all jobs →

Commenters (This Week)

Contribute meaningful comments to climb the leaderboard and earn badges!