MySQL sharding approaches?

后端 未结 6 1368
Happy的楠姐
Happy的楠姐 2020-11-28 00:56

What is the best approach for Sharding MySQL tables. The approaches I can think of are :

  1. Application Level sharding?
  2. Sharding at MySQL proxy layer?
6条回答
  •  囚心锁ツ
    2020-11-28 01:23

    1. Application Level sharding: dbShards is the only product that I know of that does "application aware sharding". There are a few good articles on the website. Just by definition, application aware sharding is going to be more efficient. If an application knows exactly where to go with a transaction without having to look it up or get redirected by a proxy, that in its self will be faster. And speed is often one of the primary concerns, if not the only concern, when someone is looking into sharding.

    2. Some people "shard" with a proxy, but in my eyes that defeats the purpose of sharding. You are just using another server to tell your transactions where to find the data or where to store it. With application aware sharding, your application knows where to go on its own. Much more efficient.

    3. This is the same as #2 really.

提交回复
热议问题