Re: Horizontal scalability/sharding

From: Marc Munro <marc(at)bloodnok(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Josh Berkus <josh(at)agliodbs(dot)com>, Mason S <masonlists(at)gmail(dot)com>, Oleg Bartunov <obartunov(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, BruceMomjian <bruce(at)momjian(dot)us>
Subject: Re: Horizontal scalability/sharding
Date: 2015-09-01 00:28:23
Message-ID: 1441067303.18680.26.camel@bloodnok.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2015-08-31 at 22:21 +0000, Robert Haas wrote:

> It seems to me that sharding consists of (1) breaking your data set up
> into shards, (2) possibly replicating some of those shards onto
> multiple machines, and then (3) being able to access the remote data
> from local queries. [...]

I believe there is another aspect to sharding that I have not yet seen
mentioned, which is one of connection routing.

One use case that I have been involved in, is to simply partition the
application into entirely, or almost entirely, separate datasets running
on separate databases with little or no need for queries to access
remote data.

This allows each database to deal only with connections from clients
that actually want its local data, greatly reducing the number of
connections on any individual database. If this works for your
application, your ability to scale is great.

The pain point comes from trying to route queries to the correct
database. Inevitably, everyone taking this route builds custom
connection-selection layers into their apps.

It seems to me that even with the more sophisticated types of sharding
being discussed here, the ability to conditionally route a
query/connection to a suitable starting database could be quite
beneficial.

Although this is probably a job for the pgbouncer/pgpool developers
rather than the hackers on this list, this thread seems to be a good
place to mention it.

__
Marc

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-09-01 00:54:51 Re: Horizontal scalability/sharding
Previous Message Josh Berkus 2015-09-01 00:10:11 Re: Horizontal scalability/sharding