[Labs-l] Accessing the databases from labs - A comparison with the toolserver

Daniel Kinzler daniel at brightbyte.de
Mon Jul 15 09:34:58 UTC 2013


Am 12.07.2013 17:43, schrieb Marc A. Pelletier:
> Also, relying on a particular mapping between shards and databases is a
> Bad Thing regardless; this way maintenance woes lies.  You shouldn't be
> connecting to "shard N which happens to be where foowiki_p is" but "to
> where foowiki_p is".  Not only can the mapping of database to cluster
> change in production, but there is no reason why that mapping needs to
> remain the same for the replicas.

That may be true if you only want to connect to one wiki's databasse. But what
if you want to connect to all of them, one ofter the other, or maybe just a
handful, as needed? Opening one database connection per wiki leaves you with
~800 mysql connections. That sucks. Much better to re-use connection for wikis
on the same shard. But for that, you have to know which shard that is.

That's actually one of the main use cases we introduced the toolserver table for.

It's true that the replicas can be sharded differently from the production
cluster. That has actually been the case for years on the toolserver. The
production setup isn't relevant, the mapping table should only contain the
mapping for the replicas.

As to maintenance woes: that's exactly what that mapping should be maintained in
one central place.

-- daniel




More information about the Labs-l mailing list