Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 July PostgreSQL: Should we create Multiple Databases OR create Multiple Schemas?

PostgreSQL: Should we create Multiple Databases OR create Multiple Schemas?

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

This title looks like a very basic topic, but this is one of the most important topics for PostgreSQL database professionals.

I have observed that most of the new PostgreSQL users are creating multiple databases into PostgreSQL Server which is not wrong

We all have common practice for creating multiple databases for the different purpose of the project.
But in the PostgreSQL server, we should create multiple schemas instead of multiple databases.

I recommended 1-database many-schemas approach for the PostgreSQL Server because cross database queries is very costly in PostgreSQL.

In the Microsoft SQL Server, we are creating different databases and we can also execute query between multiple databases by specifying a database name.
But this is not possible with the PostgreSQL.

For more details, You can visit this article of cross database queries in PostgreSQL.

The Schemas in PostgreSQL are a lot like packages in Oracle. A number of schemas should be more lightweight than a number of databases.

We require to take a backup of the only single database, including all schemas. We can also add or remove particular schema during the backup or restore operation.

We can also create different database permission groups & roles for each and every different schema so that we can control the access of database user.

Jul 25, 2016Anvesh Patel
A Day in the life of a DBA !MySQL: Password Encryption using the Advanced Encryption Standard Algorithm (AES_ENCRYPT())
Comments: 1
  1. vishy
    March 10, 2020 at 2:52 am

    Hi avneesh
    I have a question, currently i have a setup of 8 servers with 30+ database each database having 10 schemas each server has 64 core 16 GB RHEL with Postgresql 9.6 Enterprise edition. There are around 40-50 crore records from all databases. There are about 20000 users who access the 30 databases with access only to 1 database for each user

    We want to migrate to single server, so the question is

    1. Can we migrate to single server (considering the volume and no of databases (30+) to single database and 300+ schemas in the single database
    2. What should be the Configuration of this single server (earlier each of the 8 server had 64 Core 16 GB) on RHEL 7.x
    3. Should we keep single database with 300 schema or 30 databases with 10 schema in each database
    4. Should the server be physical or VM and can 1 server tolerate the load of 20000 total users out of which 7000-8000 users are concurrent

    Please advice
    Thanks

Anvesh Patel
Anvesh Patel

Database Engineer

July 25, 2016 PostgreSQLAnvesh Patel, cross database query, database, database research and development, dbrnd, plpgsql, Postgres Query, postgresql, PostgreSQL Administrator, PostgreSQL Error, PostgreSQL Programming, PostgreSQL Tips and Tricks, schema
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....