Hibernate sharding and master user lookup table: Moving users from one shard to another
For example, 5 tables with 5 primary keys and another table with user_name (or Application-level UUID generation, or Distributed hilo generation) is used as master look up table.
5 tables primary keys are based on mysql auto incerment. This won't work when you move users from one shard to another. Another option is to make 5 tables' primary key as a hash and moving users around shard won't cause key collision as in the case of autoincremented keys. If primary keys are hashes, then, mysql recreates index very time there in an insert. Performance can be pretty bad.
Any one have any suggestions/input on how to go about setting up sharding?
|