Which of the following data duplication options across shards is recommended?
问题 High performance mysql book suggests that for sharding a blog application, one may want to put comments data across 2 shards: first, on the shard of a person posting comment, and on the shard where the post is stored. So this raises the question how to reliably duplicate this data. Which of the following data duplication options across shards is recommended? Option 1: Make 2 separate inserts from the PHP script. Pros: a) Logic is in application layer. Cons: a) User is held for 2 inserts. b)