I’m working on an app where about 3.000 users will get their own personal (mail/calendar like) documents. My estimate is that they each will have about 200 document at any given moment.There are two types of documents (very simple) and two views needed to look them up.
To show these documents to the users I could use one database to put them in and one categorized view with all the documents and get the documents based the username compared to the author (category) of the document.
Or I could create a database with the username as the filename for every user and let them have their own database. This would mean 3.000 databases on the server.
Could anyone tell me which one of these is a performance technically good choice?
If both of these are not an option then I could create let’s say one database for every 100 users?
Please let me know if you have any ideas or casestories that apply.
Subject: 600.000 docs in one or multiple databases
I already meet in my life some firm that doesn’t want to create Mail file but everyone in only one database. They make a go back after some months.
In my experience, it is better to have one db per user, even if you think there are a minimum mail size even for unused DB.
Every one in only one DB call some problem with the refresh db view index when open it and the calcul formula to show only what they have the right to see.
But you can test it…
BEst regards.
Subject: 600.000 docs in one or multiple databases
Hi,
600.000 documents (and even much more) in a database are possible but they already make significant problems which you have to consider during the development.
The most important is to use as few views as possible (< 10) and to avoid that too many documents are changed too often.
From you description it seems to be fine and you could easily go this way.
Nevertheless it is a riskfull way because if your design goes wrong and you fill it with all your data it might get unuseable because of performance reasons.
If you create separate databases you can avoid this risk and develop “what you like”. However all of your 3000 databases will make all together a much heavier load on your server compared to the one large database.
Some other points to consider:
-
if you intend that your users will have local replicas of the database,then “separate databases” are properbly better because not all users understand “selective replication”.
-
to manage the ACL of one DB is much easier then to manage 3000 of them
-
separate dbs will use much more disk space then one
At last one large database gives your much more options for displaying your data. You can easily let somebody see data for more users or for all of them. This is an option which you never get with separate DBs.
Bye
Hynek
Subject: 600.000 docs in one or multiple databases
I would consider having one database for every 100-200 users, depending of size of their documents and how often documents are changed/created.