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 1nIb5k-0000Un-LU for pgsql-novice@arkaria.postgresql.org; Fri, 11 Feb 2022 18:56:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nIb5j-00071j-BA for pgsql-novice@arkaria.postgresql.org; Fri, 11 Feb 2022 18:56:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIb5j-00071a-1G for pgsql-novice@lists.postgresql.org; Fri, 11 Feb 2022 18:56:23 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nIb5g-0008Fn-Kl for pgsql-novice@lists.postgresql.org; Fri, 11 Feb 2022 18:56:22 +0000 Received: by mail-io1-xd2e.google.com with SMTP id s18so12503115ioa.12 for ; Fri, 11 Feb 2022 10:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=CqKQn+NCXG7/DwHeMWiGOaR+3A1hBuTLVGYPZIxJih8=; b=AS8OnJSHlVQ1pmmFRTb//f/VynXQ8puLW0/U63Sx5AMy6Z+u5UX5OcD2wbbzOHEjMG MgJa685CbziceB9WUakaeGcgPt3TSFFdM+CtkZgV2yJ/qkMxlLaGp2qionmm7vvR3z5a 1Iqs4e4qFQ257noV+D7MqvGH41ZuGBWi7kQXraNKAFid53eQ/kta5ewpHnUoLzKFh+AQ JbSxG+R/kCzflrMjCAd6WMA/v8hcCsZs6aoEBwGFBNdyPulIayYo8BAPw6MkqY0bjza/ 9hQsriY7VAj+OSmaSYpsFM+auUPo2JfPvgDtQ0W2X3fS1/PmQloURYZXEXyoDIiOjn7S Jkfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=CqKQn+NCXG7/DwHeMWiGOaR+3A1hBuTLVGYPZIxJih8=; b=IBkjD2ApCv1PxRXnQDsC3RgMx+pqdZg2fwoUM5jQWKEFzyI9Gd6PWc7qi/DFQGCuag dNm8L/WbOPu7/LESk9EKZoqhrmiiga0PYBscitU1r5PDRvX9WLquLSJAVGVKh/nZ8JRE ioPNXeSdVvxTRAX5YPySM8mFpskeRKXrQvleVWB2zsShnL3LNpTpQxg/Hsv4gcWSY+0i WKyK7ciEHHGpIl49+R54LsojZvR+aLe6k1uW9Lkt2ilo07kIQ0uUfs1o5/ZPAImBxhmy P5YIeb9QVrj9kmT9MGCNwGtyOPmdylcF3sgQa0u7sJlus5xy8KRBhO72z3KMyDXRR9Q5 HV8A== X-Gm-Message-State: AOAM530LLqDS8MclXmvRvsUL0ZPDwFeHs9oBRexS49fmLwWHNKGQFS4r MtcDzYALDzmSMOLexx4qUoZSM4Q3z/XgI0Kp5yvMIj6xPsw= X-Google-Smtp-Source: ABdhPJwPBHgQyjY/zplW85rwN8K1R1bp80CXA4x4PH4qMiEOEkc8BBlSTOwADP5coXiPEcOGdIuWYWx4YHr5rn69v4E= X-Received: by 2002:a05:6638:1927:: with SMTP id p39mr1602588jal.247.1644605779495; Fri, 11 Feb 2022 10:56:19 -0800 (PST) MIME-Version: 1.0 From: Jean Baro Date: Fri, 11 Feb 2022 15:56:03 -0300 Message-ID: Subject: Best practices for preparing an application to (possibly) be sharded (FDW) in the future? To: pgsql-novice@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000484fef05d7c29f3b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000484fef05d7c29f3b Content-Type: text/plain; charset="UTF-8" Hi there, Just out of curiosity, is there anything that we (as developers) can do on our code to (all together): - Have maximum performance while running on a single PG 14.1 database (HA) (Google Cloud SQL); - Be prepared (if needed in the future) to migrate the database to a sharding solution (FDW) once the microservice exceeds the capability of a single machine - Don't make the code (that access PG database) to be much more complicated compared to one running on a SINGLE Database (ho sharding) - No need to change the application's code when (and if) the database needs to be sharded in the future (FDW built-in approach). Our use case is to use PG today and be prepared to scale beyond a single Google Cloud SQL machine max capability (maybe self-hosted Postgres when sharding is necessary) We are a financial institution/Fintech with over 1MM customers (and growing 50% YoY). The new platform will probably be built on top of PG (as the standard database). One PG (Cloud SQL) for every microservice. Any help or suggestion would be appreciated. Thanks --000000000000484fef05d7c29f3b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi there,

Just out of=C2=A0curiosit= y, is there anything that we (as developers) can do on our code to (all tog= ether):

- Have maximum performance while running o= n a single PG 14.1 database (HA) (Google Cloud SQL);
- Be prepared (if n= eeded in the future) to migrate the database to a sharding solution (FDW) o= nce the microservice exceeds the capability of a single machine
- Don= 9;t make the code (that access PG database) to be much more complicated com= pared to one running on a SINGLE Database (ho sharding)
- No need= to change the application's code when (and if) the database needs to b= e sharded in the future (FDW built-in approach).

O= ur use case is to use PG today and be prepared to scale beyond a single Goo= gle Cloud SQL machine max capability (maybe self-hosted Postgres when shard= ing is necessary)
We are a financial institution/Fintech with over 1MM c= ustomers (and growing 50% YoY). The new platform will probably be built on = top of PG (as the standard database).
One PG (Cloud SQL) for every micro= service.

Any help or suggestion would be appreciated.

=
Thanks
--000000000000484fef05d7c29f3b--