I’m working on a browser-based game using HTML and JavaScript and I need somewhere to store player information like usernames, passwords, and high scores. I was wondering if I could use Google Sheets instead of setting up a traditional database.
The tricky part is that I need players to be able to update their own data without being able to see or modify other players’ information. I know about Google Apps Script but I’m not sure how to set up the permissions correctly.
Would I need to use a server-side language to act as a middleman? I’m thinking the server could handle the authentication with Google’s API so players never get direct access to the spreadsheet.
Has anyone tried something like this before? I’m curious if it’s even worth attempting or if I should just use a proper database instead.
I built a small portfolio tracker and tried Google Sheets - it technically works but has serious issues that make it terrible for anything real. The auth model is broken for your needs. You can’t do row-level permissions where players only see their own data without exposing everything else. Your gut feeling about needing server-side middleware is spot on. I ended up building a Node.js backend that validates sessions and filters data before sending responses. Basically had to make all the sheets API calls for authenticated users. It worked but completely defeats avoiding a real database. The real killer is data integrity. Sheets don’t have foreign keys, transactions, or proper validation like actual databases. I had multiple instances where concurrent writes corrupted player scores. Debugging was a nightmare since there’s no logs or rollback options. For a browser game with sensitive data like passwords, just use Firebase Auth with Firestore. Way easier learning curve than fighting sheets limitations, and you’ll save tons of time.
google sheets crawls with multiple users. I built a quiz app with it once - total nightmare. writing one row took 5+ seconds sometimes. you’d need server middleware anyway, so why not just use a proper database? plus the api quotas are brutal.
I experimented with using Google Sheets for a leaderboard a couple of years back, but I ran into several obstacles that ultimately led me to choose a traditional database. One of the major issues was the rate limiting imposed by the Google Sheets API, which can become problematic as your player base grows; you may find yourself exceeding those quotas quite quickly. While reading data was generally reliable, writes could be erratic and sometimes experienced significant delays.
I recommend implementing a server-side solution to manage security effectively. I employed Node.js with service account authentication for the necessary interactions, and while it achieved what I needed, it introduced more complexity than simply utilizing MySQL.
For smaller, less critical projects, it can be a handy option due to the ease of manually managing data through the spreadsheet. However, if you’re anticipating growth, it’s advisable to consider Firebase or SQLite from the outset, as attempting to work around the limitations of Google Sheets can end up consuming more time than focusing on core game development.