MongoDB: indici di univocità cross cluster

18 views
Skip to first unread message

Andrea Zonzin

unread,
Mar 14, 2014, 5:59:18 AM3/14/14
to mongo...@googlegroups.com

Ciao!

dalla documentazione di mongoDB  (http://docs.mongodb.org/manual/core/sharding-shard-key/) leggo

sharded systems cannot enforce cluster-wide unique indexes unless the unique field is in the shard key.

Non sono sicuro di capire bene. Se ho il seguente unique index {a,b,c,d} e la seguente sharded key {a,b},

l'univocità di {a,b,c,d}è rispettata su tutto il cluster?


La documentazione dice anche:

MongoDB does not support unique indexes across shards, except when the unique index 
contains the full shard key as a prefix of the index. In these situations MongoDB 
will enforce uniqueness across the full key, not a single field.

Il mio dubbio deriva dalla contraddizione delle due frasi della documentazione:
  1. "sharded systems cannot enforce cluster-wide unique indexes unless the unique field is in the shard key."
  2. "MongoDB does not support unique indexes across shards, except when the unique index contains the full shard key as a prefix of the index In the first case the index is in the shared key. In the second case the index contains the shared key. "
Una sembra essere l'opposto dell'altra! 

Massimo Brignoli

unread,
Jul 19, 2014, 5:27:39 PM7/19/14
to mongo...@googlegroups.com
Affermativo.
Reply all
Reply to author
Forward
0 new messages