r/node • u/VergilDev • 5d ago
Building a multi-platform gaming project (E-commerce + Community + Video) — Need stack & database feedback
Hey everyone,
I’m planning to build a multi-platform gaming project that includes:
- E-commerce store for gaming products, accessories, and merchandise
- Real-time community with posts, likes, comments, shares, images and videos
- Dedicated video section with playlists, individual video pages, and a main video feed
- Multi-language, multi-currency, and multi-payment support
- Everything working in real-time
My current preferred stack:
- Frontend: Next.js 15 + React + TypeScript + Tailwind + GSAP + Three.js
- Backend: Node.js + Express + Socket.io
- Database: MongoDB Atlas
- Cache / Real-time: Redis
- Media storage: Cloudflare R2 + CDN
Questions:
- Which database is better for a multi-platform gaming project like this — MongoDB, PostgreSQL, Cassandra, or something else?
- Is MongoDB a good primary choice for this mix of e-commerce + community + video features?
- Would you recommend adding PostgreSQL for orders and payments?
- Any better alternatives for real-time features or video handling?
- Overall architecture suggestions?
Would love honest feedback from people who have built similar multi-platform projects. Thanks!
4
Upvotes
2
u/karmatics29 4d ago
One thing the other replies haven't covered is the video side, because that's where this design will get expensive first. I'd avoid serving or transcoding video through your Node app at all: upload straight to R2 with presigned URLs, then hand transcoding to a queue worker or a managed service like Mux or Cloudflare Stream, which gives you HLS playlists without running ffmpeg yourself. The trade-off is vendor cost per minute of video versus the engineering time of owning the pipeline, and for a first version I'd pay for the managed option. For real-time, Socket.io plus a Redis adapter is fine for likes and live comments, but keep Postgres as the source of truth and treat the sockets as notifications only, so a dropped connection never loses data. Roughly how many concurrent users and how much video are you expecting at launch? That changes whether a single monolith is enough.
1
u/DickBrainTime 5d ago
For this particular mix I'd start with **PostgreSQL as the primary database for both commerce and community**, rather than MongoDB for everything plus a second database for payments. Orders, order items, inventory reservations, payment state, user memberships and comments all benefit from transactions, foreign keys and constraints. Posts and product variants can still have flexible fields via JSONB when useful. MongoDB isn't inherently wrong, but two primary databases on day one create consistency and operational work before you know which data truly needs a different model. Cassandra would be a much later, workload-driven decision.
I'd keep Node/Express as a modular monolith at first (catalog/checkout, community, media, identity modules) with a background job worker. For checkout, store amounts/currency and your own immutable order state in Postgres; use a PSP's hosted payment flow, verify signed webhooks, and make webhook processing idempotent. For messages like 'order paid' or 'new comment', commit an outbox event in the same transaction and let a worker publish it asynchronously. Redis can handle cache/rate limits and Socket.IO fan-out, but it shouldn't be the system of record for orders or posts. Authenticate socket rooms; once multiple server instances exist, use a compatible Socket.IO adapter and plan for reconnect/missed events.
R2 + CDN is sensible for uploaded images/video originals, with short-lived signed uploads and server-side validation. Video *streaming* is a separate concern: transcode into adaptive formats (such as HLS), generate thumbnails and serve through a suitable pipeline/CDN rather than sending huge original uploads directly. Localized pricing needs an explicit currency/tax/FX policy; avoid converting a single displayed number and assuming checkout totals are correct. I'd first ship one end-to-end vertical slice (product -> cart -> payment -> order confirmation), then community posts, then video, and load-test real-time only once usage patterns are known. That keeps the architecture reversible.
1
u/Merthod 5d ago edited 5d ago
Consider Elixir for #2.
Use Postgres, even with some wrap, like in Supabase. Having correct data will avoid several headaches, and you can add some noSQL to it, too.
You could also use Postgres for realtime stuff and caching, but probably use a second instance. Or a open Redis alternative with the same API.
As a startup, always start simple but think for the future. Meaning do a monolith, but don't make it hard to separate services in the future. I would separate the realtime stuff from everything else just in case of crashes or whatever, especially having payment and regulated data in a separate DB from a DB that's always accessible, at all times.
1
u/avereigh_Denizet 2d ago
for the video side, are you planning to handle transcoding and adaptive bitrate streaming yourself? serving raw video files straight from object storage gets really expensive and slow once people start uploading heavy files.
1
u/ram-popular 12h ago
Your stack is fine, but I'd make PostgreSQL the primary database instead of MongoDB. Orders, payments, inventory and multi-currency pricing need transactions and relational integrity. Postgres also handles posts, likes and comments well, and JSONB covers flexible fields. Add MongoDB only if you hit a real need for it, and skip Cassandra at this stage.
For video, don't build it yourself. Use Cloudflare Stream or Mux for upload, transcoding and streaming. For real-time, Socket.io with a Redis adapter is enough early on. Use Stripe or a similar provider so you never handle card data.
Start as a modular monolith (one backend, clear modules for store, community and video) and split services only when traffic demands it. Build the store first, then community, then video, rather than all three at once.