# Building a Serverless-Safe Realtime Metaverse for MyZubster

Leader 1 3 43
calendar_todayschedule1 min read

Building a Serverless-Safe Realtime Metaverse for MyZubster

We have completed a major infrastructure upgrade for MyZubster World.

The original realtime system used Server-Sent Events and in-memory state. It worked locally, but serverless deployments introduced a problem: different requests could reach different Vercel instances, each with its own memory.

The result? Players could join successfully while the interface remained stuck on RECONNECTING.

What we changed

We moved the shared Metaverse state to MongoDB.

The new architecture supports:

  • shared player presence across serverless instances;
  • synchronized movements and emotes;
  • recent shared chat messages;
  • automatic expiration of inactive sessions with TTL indexes;
  • resilient browser synchronization;
  • automatic recovery after temporary connection failures;
  • verified MyZubster characters linked to authenticated accounts;
  • clear separation between verified users and guests.

The React frontend now periodically calls:

POST /api/metaverse/sync
Each synchronization refreshes the session and returns the current players, movements, emotes, and new chat messages.
This replaces the fragile dependency on a long-lived EventSource connection.
Verified identity
Authenticated users enter with the character linked by the server to their MyZubster account.
Browser-supplied names and identifiers cannot override a verified identity.
For example, the character H4x0r is displayed as:
H4x0r
@DanielIoni-creator
MYZ VERIFIED
Guests can still explore the world, but they are clearly marked as guests.
Production results
The implementation was successfully deployed and verified:
- Vercel deployment: ready;
- world API: HTTP 200;
- active transport: shared-polling;
- MongoDB shared presence: operational;
- legacy Metaverse EventSource removed from the frontend;
- 11 automated tests passed.
This architecture gives MyZubster a reliable serverless foundation today while keeping the door open for WebSockets, Redis, or a dedicated realtime network in the future.
Explore MyZubster World:
🌍 https://www.myzubster.com/metaverse
View the implementation:
💻 https://github.com/MyZubster-Ecosystem/myzubster/commit/412babfedfe29a917e5c6802c34defdcbfad75e7
What approach do you prefer for realtime serverless applications: polling, WebSockets, Redis streams, or an external realtime provider?
#MyZubster #OpenSource #Metaverse #ReactJS #NodeJS #MongoDB #Serverless #WebDevelopment #Realtime #Vercel
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

How to Deploy Your Website for Free (Vercel, Netlify, GitHub Pages)

muhammadfarhan.dev - Aug 14

How to Keep a Telemedicine MVP Small Without Creating Bigger Problems Later

kajolshah - Apr 16

The Audit Trail of Things: Using Hashgraph as a Digital Caliper for Provenance

Ken W. Algerverified - Apr 28

Growth Truth: Handling the Referral Spike

Pocket Portfolio - Apr 15

Building ZORGAX Party Mode: An AI Orchestration Layer for the MyZubster Metaverse

Myzubster - Sep 5
chevron_left
2.2k Points47 Badges
Rimini
53Posts
3Comments
17Connections

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!