Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ms7dF-00086h-Ie for pgsql-general@arkaria.postgresql.org; Tue, 30 Nov 2021 18:13:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ms7dE-0003B8-EK for pgsql-general@arkaria.postgresql.org; Tue, 30 Nov 2021 18:13:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ms7dE-0003Az-30 for pgsql-general@lists.postgresql.org; Tue, 30 Nov 2021 18:13:32 +0000 Received: from bumble.maple.relay.mailchannels.net ([23.83.214.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ms7dA-00054o-9A for pgsql-general@postgresql.org; Tue, 30 Nov 2021 18:13:31 +0000 X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DAF136C0193; Tue, 30 Nov 2021 18:13:22 +0000 (UTC) Received: from a2ss24.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id CC38C6C1446; Tue, 30 Nov 2021 18:13:21 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|bench@silentmedia.com Received: from a2ss24.a2hosting.com (a2ss24.a2hosting.com [75.98.175.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.109.250.6 (trex/6.4.3); Tue, 30 Nov 2021 18:13:22 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|bench@silentmedia.com X-MailChannels-Auth-Id: a2hosting X-Snatch-Invention: 4df8a17a7ead97a9_1638296002370_1991102831 X-MC-Loop-Signature: 1638296002369:2683478986 X-MC-Ingress-Time: 1638296002369 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=silentmedia.com; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a5AmPKbXR74KNS0jsGrwIxOnrf5Q5klFkNjc0iKEbfU=; b=gTudu7tJi42nfqvuuv9LQlwimA xyZ3KMlPuadHyDnRDNEdhpFokQbVIz1SCMN6bazcGWRd67m4zt7l6obQ6VAUua7OW48a/Tt9guDyx 7/0uMdSmiwYYVekURLXkN+Q6YA8GhpwXv1bPuTV0Cg9Uh+iHJY1Bx8sR8nXPghNbacVSP48WMA5cf KhhL3GL6lGU3wAgrJYnNlghO8X6cgr9gbyREqLvJfQEEWi5/7RfvKpxhxbQQixDHjz+NPJeJGEstS Kb7ons8ywUDYftNjHPQQzV4WoyifVYINtYnJXtRUGaAhb4zyQ+6q4xMRCAAoOmnPxh6c8VlHwhB4k AQGYwR1w==; Received: from 97-113-88-109.tukw.qwest.net ([97.113.88.109]:61879 helo=Rolo.local) by a2ss24.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ms7cb-00G3sM-R1; Tue, 30 Nov 2021 13:13:20 -0500 Subject: Re: Database Scalability To: Saurav Sarkar Cc: pgsql-general@postgresql.org References: From: Ben Chobot Message-ID: <71ee08fc-200b-e9de-f597-d0f6f7da6675@silentmedia.com> Date: Tue, 30 Nov 2021 10:13:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:52.0) Gecko/20100101 PostboxApp/7.0.52 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------AECC6B3A68DCF371FED941AD" Content-Language: en-US X-AuthUser: bench@silentmedia.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------AECC6B3A68DCF371FED941AD Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Saurav Sarkar wrote on 11/29/21 10:13 PM: > Hi All, > > We have some multi-tenant solutions which are separating the tenant > data in Postgresql mainly in the following manner. > > 1. Using different schemas > 2. Using different tables for different tenants. Without more details it's impossible to give you a detailed answer, so, in general.... if you are breaking out your client data by schema, you will likely be fine. We have used this method with great success to scale our customer workload - each customer gets their own schema, which we can then rebalance between databases as those clients drive more load over time. For those tables that we want partitioned, we simply partition them in every schema. That's arguably inefficient but we find the schema consistency to be an overall win. (For context, when I say we have used this method with great success, we have over 13k customers, almost a PB of data, peak around 1.5M iops, and it's all painless to operate.) --------------AECC6B3A68DCF371FED941AD Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Saurav Sarkar wrote on 11/29/21 10:13 PM:
Hi All,

We have some multi-tenant solutions which are separating the tenant data in Postgresql mainly in the following manner. 

1. Using different schemas
2. Using different tables for different tenants.

Without more details it's impossible to give you a detailed answer, so, in general.... if you are breaking out your client data by schema, you will likely be fine. We have used this method with great success to scale our customer workload - each customer gets their own schema, which we can then rebalance between databases as those clients drive more load over time. For those tables that we want partitioned, we simply partition them in every schema. That's arguably inefficient but we find the schema consistency to be an overall win.

(For context, when I say we have used this method with great success, we have over 13k customers, almost a PB of data, peak around 1.5M iops, and it's all painless to operate.)
--------------AECC6B3A68DCF371FED941AD--