I want to build a Python Discord bot where users can collect items at regular intervals and check their total count later. I’m wondering what’s the best way to store this data for each user. Should I use Google Sheets to keep track of everyone’s item counts, or are there better storage options? I need something that can handle multiple users and persist data between bot restarts. What would you recommend for this kind of user-specific tracking system?
Been running a similar bot for 8 months now - really depends on your user base size. Started with pickle files, which worked great for the first 50-60 users. Just serialize your user data and dump it to disk every few minutes. Way simpler than databases and handles restarts fine. Once we hit 100 active users though, file operations started lagging during peak hours. Had to switch to SQLite eventually, but pickle bought me time to learn database design properly. If you’re starting out with slow growth, don’t overthink it - pickle or JSON will work fine initially.
Google Sheets will be painfully slow since you’re hitting APIs for every database operation. I’ve built similar resource tracking bots - JSON files actually work great for smaller communities. Just load user data into memory on startup, update as needed, then save periodically or when shutting down. Once you hit a few hundred users though, you’ll need a real database. I’d go with PostgreSQL if you’re planning to scale - handles concurrent operations way better than SQLite and most hosts support it out of the box.
i think sqlite is a great choice! super easy to set up and use with python. you can keep user data organized without the hassle of google sheets. plus, it runs locally which is fast. good luck with your bot!
This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.