After this comment to a my question, im thinking if is better using 1 database with X schemas or viceversa.
My situation: im developing a web-app where, when people do register, i create (actually) a database (no, its not a social network: everyone must have access to his own data and never see the data of the other user).
Thats the way i used for the previus verison of my application (that is still running on mysql): throught the plesk api, for every registration i do:
- Create a database user with limited privileges;
- Create a database that can be accessed just by the previous created user and the superuser (for maintenance)
- Populate the db
Now, i'll need to do the same with posrtgresql (the project is getting mature and mysql.. dont fulfill all the needes)
I need to have all the databases/schemas backups indipendent: pg_dump works perfectly in both ways, the same for the users that can be configured to access just 1 schema or 1 database.
So, assuming you are more experienced potsgres users than me, what do you think is the best solution for my situation, and why?
There will be performance differences using $x db instead of $x schemas? And what solution will be better to mantein in future (reliability)?
Every help and suggestion is really appreciated.
Edit: i almost forgot: all of my databases/schemas will allways have the same structure!
Edit2: For the backups issue (using pg_dump), is maybe better using 1 db and many schemas, dumping all the schemas at once: recovering will be quite simple loading the main dump in a dev machine and then dump and restore just the schema needed: there is 1 additional step, but dumping all the schema seem faster then dumpin them one by one.
p.s: sorry if i forgot some 'W' char in the text, my keyboard suffer that button ;)