Domain-driven sharding using tags

The recipes Starting a simple sharded environment of two shards and Connecting to a shard in the shell and performing operations in Chapter 1, Installing and Starting the Server explained how to start a simple two server shard and then insert data in a collection after choosing a shard key. The data that gets sharded is more technical where the data chunk is kept to a manageable size by Mongo by splitting it into multiple chunks and migrating the chunks across shards to keep the chunk distribution even across shards. But what if we want the sharding to be more domain oriented? Suppose we have a database for storing postal addresses and we shard based on postal codes where we know the postal code range of a city. ...

Get MongoDB Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.