mongoDB is a document-driven database, so it is Nosql. It means that nay it is necessary to have a rigid structure for each record, you can adjust it/modify it in the format you want.
mongoDB organizes this document into collections to facilitate consultation and organization of information.
What all this means?
In my view, you don’t need multiple banks, but several different document formats (records) - and you chose the right bank for that :)
Example
Suppose you have a different client screen for each type of user (the screen is the same, but the information is different). How this should be organized:
Collection: Teladecustomer
// Documento para o cliente A:
{
_id: 'UM OBJECTID PARA O CLIENTE A',
owner: 'usuário2',
nome: 'Cliente A',
ultimoContato: '2014-01-01'
}
// Documento para o Cliente B:
{
_id: 'UM OBJECTID PARA O CLIENTE B',
owner: 'usuário1',
razaoSocial: 'Cliente B ltda',
totalVendas: 100,
nomeContatoComercial: 'João'
}
Both documents (json), are in the same collection, however, each one has a different set of information; information pertaining to each client.
The only information common among documents are the fields _id
and owner
, so that you can find the information you need.
The big trick
All documents will have the information owner:'id do usuário dono'
. These fields will serve for you to identify that the documento X pertence ao usuário Y
. Thus, you can maintain a bank in a standard (predictable) format, however, with different information for each user.
Multiple databases will be bad
If you install (create a new) database for each user, you will have a system for each user.
10 usuário = 10 sistemas diferentes
Maintenance for this type of system is extremely expensive and expensive. Avoid this type of behavior when building system.