Mobile app version of vmapp.org
Login or Join
Samaraweera270

: Multiple SQLite3 Databases In A Single Web Application Viable? This question was voted inappropriate for stackoverflow, so I'll ask here. I'm considering designing a CMS where content is centered

@Samaraweera270

Posted in: #Cms #Php #Xml

This question was voted inappropriate for stackoverflow, so I'll ask here. I'm considering designing a CMS where content is centered around what the users submit. Built on polyglot, php, sqlite3 for user content, and xml for CMS settings.

My question is would using a slite3 database for each user within one web application be viable? Or would it be too hard on server resources? In some ways it seems it would be easier especially on large sites, but then what about comments?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

1 Comments

Sorted by latest first Latest Oldest Best

 

@Hamaas447

My question is would using a slite3 database for each user within one web application be viable?


It is "technically" possible but highly unorthodox. Using sqlite this way would be well outside the assumed "solution space" for which it was designed.

So, viable ? No.


Or would it be too hard on server resources?


It is such an unexpected use-case I doubt it's ever been benchmarked.


In some ways it seems it would be easier especially on large sites, but then what about comments?


The standard practice would be to design the database to hold all the users data in one database. Each table that referenced any data specific to one user would have a column with a value that uniquely identified that user.

In this way you can safely store all the users data mixed in together in one database.

Here is a very basic example that might help illustrate the principle.

All the following tables are in 1 single database

TABLE = "users"
FIELDS
"user ID"
"user login nickname"
"user password_hash"
"user email"
"user name"


TABLE = "forum threads"
FIELDS
"thread id"
"thread title"

TABLE = "forum thread comments"
FIELDS
"thread id"
"comment id"
"comment user id"
"comment datetime"
"commnet text"

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme