Percona Live 2017: Designing your SaaS Database for Scale with Postgres

PostgresThe Percona Live Open Source Data Conference 2017 day one is rolling right along, and we’re already in the afternoon sessions. In this blog, we’ll look at Citus Data’s presentation on how to design your SaaS database to scale with Postgres.

If you’re building a SaaS application, you probably already have the notion of tenancy built in your data model. Typically, most information relates to tenants/customers/accounts and your database tables capture this natural relation. With smaller amounts of data, it’s easy to throw more hardware at the problem and scale up your database. As these tables grow, however, you need to think about ways to scale your multi-tenant database across dozens or hundreds of machines. In this talk, Citus Data’s Lukas Fittl and Ozgun Erdogan (CTO) talked about the motivations behind scaling your SaaS (multi-tenant) database and several heuristics they found helpful in deciding when to scale.

They then described three design patterns that are common in scaling SaaS databases:

  1. Create one database per tenant
  2. Create one schema per tenant
  3. Have all tenants share the same table(s).

Next, they highlighted the tradeoffs involved with each design pattern and focused on one pattern that scales to hundreds of thousands of tenants. They also shared an example architecture from the industry that describes this pattern in more detail. Lastly, they talked about key PostgreSQL properties, such as semi-structured data types, that make building multi-tenant applications easy.

After the talk, Lukas and Ozgun were kind enough to speak with me about their session. Check it out below:

Don’t miss any of tomorrow’s session. See Wednesday’s (4/26) full schedule here.

Share this post

Comments (4)

  • Jouni Järvinen Reply

    Postgres mentioned in MySQL’s article … Betrayal, much ?

    April 27, 2017 at 10:42 am
  • Tushar Soni Reply

    Nice Post!
    This article helps you whenever you design your SaaS Database or Model.

    Thanks for sharing!!

    July 7, 2017 at 3:10 am
  • Shruchi Nagar Reply

    This is really good. Thanks for sharing this post, I just bookmarked this post for future reference. Really love your work have learned so much.

    July 11, 2019 at 7:40 am
  • Declan Lawton Reply

    Very detailed information on Designing your SaaS Database for Scale with Postgres.

    November 14, 2019 at 6:34 am

Leave a Reply