Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Russell Comer
Russell Comer
26,102 Points

Databases for web app

I am looking to build a web app that will (hopefully) have multiple users. Do I construct one database with multiple tables or a database per user.

The app will be a logging system. Each user will be able to enter in information for each event and also see how things trend over time. Basically its like an app for tracking what you eat except it for tracking and logging trades that you make.

If I choose the single database how hard will it be to change later?

If this question isn't clear enough please let me know and I can clarify some more.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Since the app controls individual access to the database, a single database would be sufficient.

Each table in a database tracks records for a specific model. So whether it be a Trade Record or other table, the table row containing the record would have an element that identifies which user it belongs to. The app would prevent users from accessing rows that don’t match the current user.

Post back if you need more help. Good luck!!!