Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tpppo-00Cvgy-60 for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 14:34:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tpppm-00Cb9g-At for pgsql-general@arkaria.postgresql.org; Wed, 05 Mar 2025 14:34:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tpppl-00Cb4l-Uw for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 14:34:53 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tpppk-0017RT-0I for pgsql-general@lists.postgresql.org; Wed, 05 Mar 2025 14:34:53 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43bd5644de8so6956175e9.3 for ; Wed, 05 Mar 2025 06:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1741185291; x=1741790091; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=oChycP0wftnlbmXH8lQYkk5ibN/UH6mu9Y7aCiR9p+Q=; b=RKbNAlRCSuKm3VfpSdFjeO1o3q7jw6lOE9EQLo+4ZcL21MsZCk2WN7gmj71X5XT84F 1kBjh+dwv8kwRuZOa29H2C3DLtrYFrrmqgVfT1IKjAX1NW1o+k5nPtkfQOnkfiXhbaP1 3j6BjQPDxHwNDawVLpfWq5+PraciWffd/PiK/fwfhc6XxxLoeVIx8ZXa3tuBxbXdv0Sy FnhwblXyiXBA85DO1tgwpKIUsIezY2DZvTQNc6t9AuIJO6z5e6F+ZKF5htM4Y2DAAar9 t3jfzfvZOzz5WO4tQcou2fJXqU6iBJZRDOso8r+T6OKNvIMa1g62rAH/oWzqsl1iWEvo dn0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741185291; x=1741790091; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=oChycP0wftnlbmXH8lQYkk5ibN/UH6mu9Y7aCiR9p+Q=; b=Zr3TqpK5tVL9+7weZLuyxvOo1WtJr6Gwp8cT4ys0ASak4wcKaqYvpLkwPIA5dlePNo 8Xt0us1VrNakRlmHJOZRZgtl5pkmPNzlaMr92KXlO7PyKux55SMNVljPve6vcUQ8xGDS hV/M6PHxvnlY7MEsxLwUWy9tTKcq1J/68eahqWqVhyIZIuNgOXpQFWfdeDBKUhuP6aJu HbrjOFzip2+QutUdxkZC1rtHD3VC1QqCPClp8np387PTYDjFdzmN8H8xvImEOkQkwUHI ngnVIZE72uaS+bawDfwpAz7XHXUU1ZUY76SqC1kzt8cXE4yapkwH9wprxY3xcC5/yPlS tDKw== X-Forwarded-Encrypted: i=1; AJvYcCXgJKvSzdtkLWO2+cyOm6loqe50RjYblKN/L36qJsDdgaLO793doPfzIpwlYtuOSsxE0bGcxa/QigSCjB6L@lists.postgresql.org X-Gm-Message-State: AOJu0YzjozftSh5STDUD1/4tGBkS3QC6GVd3Uc9hWJ6Z9apoK1jIqLtV z0WhKxv7nrWV+KlBBBUzDLWCkSWrW9bI2ZH8H5Sjni0qCI0QwxNnDoJEosnTHOFH+v/Zd2Yoxlg ts00= X-Gm-Gg: ASbGncsZHSisXQx5SZ9T2GLG3jzbUSNnWH1p/SUY7CT8T324JUsmRIgaUgAozhc35Ha /DhCFQMuxblioYTRWTkOmqE/ICtQ/QRDzOxtx+CmUdfbPqHJPoJ/FaaQtUPcMXaM0/wIt6jJgqE Y4XMhnesiEmbUlqL3jN+b6DjpmyXdx5CxvHoSew5GFXtdx2zpV0udc+iV8CxpIBCB8MUMG/jSaU M8BhsUmgMMNYn9yT1kK24AOIbKC0HYCqu0YBNlpj7MFRT82DGvNjC3BqWQJN5a3qK4m0F70lZT1 KzQp7YSiGG9Rg6dXN3qjUzpNohXxNnKIvIsL X-Google-Smtp-Source: AGHT+IHsGMy1z9unSoOr2QUmIkRSkntuE3DFpYcuLZd9MJxoDFH2oOoTWK0IC5VIpeKHO+Sv4Ybg4A== X-Received: by 2002:a05:600c:198f:b0:439:9ee1:86bf with SMTP id 5b1f17b1804b1-43bd294309bmr32492845e9.7.1741185290535; Wed, 05 Mar 2025 06:34:50 -0800 (PST) Received: from localhost.localdomain ([213.208.157.38]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd42c5880sm18904015e9.19.2025.03.05.06.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 06:34:50 -0800 (PST) Message-ID: <3d59ad3a34bdcefe97efc5b6655a440021b32e23.camel@cybertec.at> Subject: Re: Quesion about querying distributed databases From: Laurenz Albe To: me nefcanto Cc: Adrian Klaver , pgsql-general@lists.postgresql.org Date: Wed, 05 Mar 2025 15:34:48 +0100 In-Reply-To: References: <099b49ebae94e23f19afdad3f8c9c6e702a3a2d5.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-03-05 at 15:45 +0330, me nefcanto wrote: > Dear Laurenz, the point is that I think if we put all databases into one = database, > then we have blocked our growth in the future. Hard to say. If you want to shard for horizontal scaling, that usually only works well if there are few interconnections between the different shards. If you end up joining data from different shards, you usually lose. > A monolith database can be scaled only vertically. We have had huge heada= ches > in the past with SQL Server on Windows and a single database. Without knowing what the headaches were, it is hard to answer something her= e. > But when you divide bounded contexts into different databases, then you h= ave > the chance to deploy each database on a separate physical machine. That m= eans > a lot in terms of performance. Please correct me if I am wrong. I don't know if you are wrong. But it seems like it is not working well, is it? Perhaps you can explain how splitting up the data might result in better performance. Is that just a guess or do you have a reason to think = so? > Let's put this physical restriction on ourselves that we have different > databases. What options do we have? I don't know. Based on what you showed: perhaps a complete re-design? Yours, Laurenz Albe