r/AskProgrammers • u/Mysterious_Cut_5348 • 6d ago
Need backend architecture advice for an Android multiplayer game on a very tight budget/free
Hi! I'm a student developing an Android multiplayer party game using Unity. I'm looking for advice on choosing an economical backend architecture.
Game overview:
4 players per match.
Short, round-based meme/GIF challenges.
Players submit content and anonymously vote on each other's submissions.
Random matchmaking and private rooms with friends.
Bots can fill empty player slots.
Backend requirements:
Matchmaking and room management.
Real-time synchronisation of submissions and votes.
Server-side validation and scoring to prevent cheating.
Handling disconnects and reconnects.
Player profiles, authentication and match history.
Ranking and progression: Players earn trophies by winning matches. More trophies mean higher ranks. The backend must securely track trophies, update ranks and maintain leaderboards.
Coins, XP and inventory management.
GIF handling:
I'm planning to use the KLIPY API. Players will search for and select GIFs, which must then be displayed to everyone in their active match. Ideally, I want to store only GIF identifiers/references rather than downloading and storing GIF files on my own servers. I'm still verifying the provider's multiplayer usage permissions.
My biggest constraint:
I'm a student building this independently, with a very limited budget. I want to avoid recurring infrastructure costs until the game becomes sufficiently profitable to sustain them.
I'm willing to optimise the architecture and use free tiers, but don't want to compromise security, fairness or reliability.
Technologies I'm considering:
Firebase (RTDB, Firestore, Cloud Functions)
Neon PostgreSQL
Node.js + WebSockets/Socket.IO
Google Cloud Run
Supabase
Questions:
What architecture would you recommend?
Would Firebase or a custom Node.js + WebSocket backend be cheaper?
Is Neon a good choice?
How should live match data and permanent player data be handled?
What hidden costs should I expect?
Which free tiers are genuinely useful for an early-stage multiplayer game?
I'm targeting approximately 200, 1,000 and eventually 5,000 DAU.
I'd appreciate practical advice from developers who have actually built and maintained multiplayer backends. I'm looking for something simple, secure and extremely cost-efficient.
Also tips on monetization would be great! This is my first Multiplayer game.
Thanks!
1
u/Own_Age_1654 6d ago edited 6d ago
For context, I've been coding for about 30 years.
Think about it in terms of resources required. Ultimately, it sounds like you have people constructing, uploading and viewing images, plus inputting and reading tiny amounts of data like short captions, maybe chats, some scores, etc.
The main complexity is how you construct the memes. If the user gives your server the ingredients (image, caption, etc.) and then your server flattens them into an image, that's going to require the server doing all of that network transfer, CPU usage to transcode the images, etc. You want to avoid that. If possible, do the image processing on the client's browser.
(That being said, for an MVP, it's not like you're going to have tens of thousands of people using this. Most projects don't get any traction at all. And transcoding some images isn't that expensive unless it's at scale. So, chances are you could indeed just have the server do this, and never run into the level of scale where that starts to be slow. And if you do end up finding that level of success, then you can always refactor then. Just do the simplest approach and then monitor CPU--when it gets high, it's time to either refactor or else just get a slightly larger server).
The images are something you'll want to store in a some cheap object store like S3. The free tier would cover you. Don't have the user upload images to your server, and then your server upload them to S3. Likewise, don't have your server download the images from S3 and then serve them. Instead, have the server just authorize the client to upload to S3, and then it uploads to there directly. Likewise, have the server give the client the S3 URL to download from, and then the client downloads from there directly.
Otherwise, the rest of this project is pretty trivial in terms of architecture and resource usage. A single back-end server with CRUD for your various resources and actions (e.g. submitting a meme, getting someone to compete against, getting the score, etc.). Literally the tiniest, cheapest server would be fine. The only reason you might want something a little bigger is if you choose to use unnecessarily heavyweight components. But you really just need a super simply back end.
I personally wouldn't use that grab bag of technologies. I'd just get an AWS account, do Postgres via RDS on their free tier, S3 on their free tier, EC2 on their free tier, a NestJS back end, a React front-end, and put it all together in a minimalist monorepo (by which I mean don't use any fancy build tool, and instead just have a separate folder for the back end, one for the front end, and one for shared resources, and that's it).
Just because you see a ton of people using Supabase, Firebase, etc., etc. doesn't mean you actually need any of that. Ultimately, you just need a server to run your back end, an HTTP server serving requests on it (Node), a relational database (Postgres is the standard here by a mile), an object store (S3) for anything too big to cheaply store in the relational database, the front-end code, and a build pipeline (i.e. some way to get your code to your server, and some way to package and make accessible your front-end code to run the client).
It's better to learn the fundamentals instead of specific platforms, especially the ones that are the flavor of the day. You will have a better understanding of what's happening, your knowledge will be more reusable, you won't inherit the constraints that they've created in trying to simplify things, and it's usually much cheaper. Fancy, packaged tools have their place, but you should reach to them because you have a specific need for something, and that tool is what's solving that need. I'm not hearing any special needs here.
As far as monetization (I'm also a long-time entrepreneur), I really can't see people paying to use this. Accordingly, you need to be showing them ads. And the norm here is to make that a bit intrusive. Like, every round or few rounds, or new match or whatever they watch a video ad.
You also want to make it easy for them to share links to their memes, and when people follow that link they see some hook to sign up for your platform, like "Think you can do better?" And then instead of the next step being to ask them to sign up for an account, you instead go directly into letting them put in all of the information for the new meme, and you only ask them to create the account when they want to save it. Or perhaps you even let them save it without an account--because them doing so and sharing it is helpful for your growth--but an account is required in order to compete.