Hi all,
I’m exploring backend architecture options for a browser-based puzzle game similar in scale to popular titles like Block Blast Online and Jigsaw Puzzles. What are some best practices or recommended tools (Firebase, Supabase, custom Node.js stack, etc.) for handling user sessions, progress saving, and high concurrency, especially if aiming for scalability?
Would love insights from anyone who’s worked on puzzle or casual games with a focus on performance and low latency.
Thanks in advance!
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
Basics of Building Applications
Square Developer Tools
General Development Concepts
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
For a browser-based puzzle game like the one you’re developing, you might want to consider a few key factors when choosing your backend architecture:
-
User Sessions: For managing user sessions, you could use JSON Web Tokens (JWT) for session management. JWTs are secure, lightweight, and can be easily used in a distributed system.
-
Progress Saving: To save game progress, you could use a database system. If your game data is relational, SQL databases like PostgreSQL or MySQL could be a good fit. If your data is more document-oriented or you need to scale quickly, NoSQL databases like MongoDB or Firebase’s Firestore could be a better choice.
-
High Concurrency: Node.js can handle high concurrency due to its non-blocking, event-driven architecture. It’s a good choice if you need to handle many simultaneous connections with low response times.
-
Scalability: If you’re aiming for scalability, consider using a cloud platform like Google Cloud Platform (GCP), Amazon Web Services (AWS), or Microsoft Azure. These platforms offer services that can automatically scale your application based on demand.
-
Real-time Updates: If your game requires real-time updates, consider using WebSockets or a real-time database like Firebase’s Realtime Database.
-
Performance and Low Latency: To ensure performance and low latency, consider using a Content Delivery Network (CDN) to serve your game’s static assets. This can significantly speed up load times for your users.
In terms of specific tools, Firebase could be a good choice as it provides many of the services you might need (authentication, database, hosting, cloud functions) in one platform. However, if you need more control or have specific needs, a custom Node.js backend could be more suitable.
Remember, the best choice depends on your specific use case, resources, and expertise. It’s a good idea to prototype different architectures and see which one works best for your game.
This answer was reviewed by @Bryan-Square.
Are you looking to use Square developer tools for this project? 