I'm redesigning my client's website in order to add about 16 mini sites for their web site. It's a website using PostgreSQL. And my question is:

Performance wise, what is the better database design:

  • 1 (one) database, with about 190 tables, or
  • 17 databases, one with 30 tables, and the rest with about 10 tables each.

It's for a low to middle traffic web site, but 4 or 5 times a year the traffic will be high.

It's a Centos 6 VPS, with 3 GB of RAM. Other softwares are Apache and PHP.

  • 1
    How about "One connection vs multi connection" related to your description ? What's your really question ?
    – Luan Huynh
    Mar 24 '16 at 4:13

In postgreSQL, database is a logical concept and a PostgreSQL server manages one database-cluster which contains all databases. The number of databases does not affect to the server performance.

I recommend that you divide databases at the viewpoint of logical structure. If your system can be completely divided into each mini site, you may create databases corresponding to the sites. (When the access of one site increases, you can divide and relocate the site to other server.)


If you do 17 connections to your postgresql, you will have 17 threads being used for one single user session in the both sides (database and interface) on your system, this is specially true if you are developing using java.

But in other hand if too many users connects to the system maybe you will have too many postgresql threads on your server, for example 170 threads for 10 users, and this can destroy the hardware! Remember that threads use some repeated code and this can flood your memory.

I think the first design is better but for reasons of organizations create 17 schemas and not 17 databases or 17 connections as you want, this is will make your work better to understand.

And why you want to do such thing? If you need more than 1 processor by user for some kind of operation, you can also connect twice by using the same database for all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.