lundi 22 juin 2015

SQLite: Individual tables per user or one table for them all?

I've already designed a website which uses an SQLite database. Instead of using one large table, I've designed it so that when a user signs up, a individual table is created for them. Each user will possibly use several hundreds of records. I done this because I thought it would be easier to structure and access.

I found on other questions on this site that one table is better than using many tables for each user.

Would it be worth redesigning my site so that instead of having many tables, there would be one large table? The current method of mine seems to work well though it is still in development so I'm not sure how well it would stack up in a real environment.

The question is: Would changing the code so that there is one large database instead of many individual ones be worth it in terms of performance, efficiency, organisation and space?

SQLite: Creating a user's table.

CREATE TABLE " + name + " (id INTEGER PRIMARY KEY, subject TEXT, topic TEXT, questionNumber INTEGER, question TEXT, answer TEXT, color TEXT)

SQLite: Adding an account to the accounts table.

"INSERT INTO accounts (name, email, password, activated) VALUES (?,?,?,?)", (name, email, password, activated,)

Please note that I'm using python with Flask if it makes any difference.


EDIT

I am also aware that there are questions like this already, however none state whether the advantages or disadvantages will be worth it.

Aucun commentaire:

Enregistrer un commentaire