sharding is an external concept. mysql doesn't know anything about it. and there is no point in having different shards on same server. whole point of sharding is load distribution across several servers. but theoretically - why not?)
How to implement externally any documentation
make your application use several connections based on some parameter or value. use a proxy application, that will do it for you. you still have to write, how to select replica, based on some input value. so your application connects to proxy. proxy parses query amd decides "hey, this id is 625816, which should be found on node2, redirect there" if you use second approach - google docs of proxy of your choice. if you use first - no docs needed it is made with an if statement) just pick the right sharding key
Обсуждают сегодня