I'm working on early designs for an application that needs to start out small but be highly scalable. I'm particularly worried about the user database, which in this case will have a high INSERT and UPDATE load, and is unlikely to survive long on a single master.
(Although my question isn't tied to any particular RDBMS, for the record, we'll be using MySQL, and MySQL Cluster doesn't really meet our needs, so we need to roll our own solution on this one using stock MySQL + InnoDB.)
I'm considering a strategy of distributing users amongst MySQL masters based on a hash of their username (plus an unknown-to-user salt just as added insurance against any funny games). I've seen solutions like this used successfully before, but I've never designed/implemented it myself.
What I'd like some input on is:
1) Suitable hashing algorithms. I expect SHA-1 or even MD5 would work just fine for this, since cryptographic security really isn't the goal, but I'm not sure if there might be other algorithms out there that might have desirable properties for this sort of problem. Something a little faster might be nice, too.
2) Any major caveats anyone can think of. (I'm already very conscious of the potential connection pool problem, as well as the fun in adding new masters to the pool and migrating affected users.)
Thanks!