Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:53:29+00:00 2026-06-18T06:53:29+00:00

I am designing application for multiple customer usage. I ended up creating single database

  • 0

I am designing application for multiple customer usage. I ended up creating single database setup with schema per customer layout which looks something like this:

CREATE TABLE public.companies
(
  id serial NOT NULL,
  name long_name NOT NULL,
  registration_number character(11),
  address character varying(256),
  CONSTRAINT "CompaniesPrimaryKey" PRIMARY KEY (id )
);

CREATE TABLE public.banks(.. );
CREATE TABLE public.calendars(.. );

-- Schema definition - none of the tables have company_id key
-- company_1 schema
CREATE TABLE company_1.employees
(
  id serial NOT NULL,
  first_name character varying(30),
  middle_name character varying(30),
  last_name character varying(50),
  bank_id integer,
  CONSTRAINT employees_pkey PRIMARY KEY (id )
);

CREATE TABLE company_1.contracts
(
  id serial NOT NULL,
  employee_id integer,
  calendar_id integer,
  CONSTRAINT contracts_pkey PRIMARY KEY (id )
)

-- company_2 schema same as schema company_1
-- and so on ...

In every discussion I have some argument about database design somebody says that there is something wrong with it, but nobody can say what, just gut feeling.

Is there anything really wrong with it? What are real caveats of this design?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:53:30+00:00Added an answer on June 18, 2026 at 6:53 am

    The problem is that in case of schema changes you have to upgrade all of them so that the applications finds a consistent structure. Your upgrade script must be atomic for all of them.

    If the tables are in the same database that shouldn’t be too bad because you can wrap the upgrade script in a transaction.

    If you use database-per-customer on the other hand, and the RDBMS does not support multiple databases per transaction, you might upgrade some customers while “crashing” others.

    Also, you cannot make one customer read from other customers easily if you want that (for example you might want to give all customers an auto-complete list filled by the data of all customers).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When designing a new application/database for multiple users, it usually involves having a table
I am in the process of designing a web application which will have multiple
i am designing application in which i want to allow user to select multiple
I am designing an iPhone application with a home page. This page has multiple
I am designing an application, one aspect of which is that it is supposed
I'm currently designing an application which I will ultimately want to move to Windows
I am designing an application that needs to save geometric shapes in a database.
I am designing an application where a user places multiple UIImageViews one over another.
I have an application which executes multiple queries (query1, query2, query3) against a DB,
I am doing an email application which will allow multiple attachments and emails will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.