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