sharding - What are best practices for partitioning DocumentDB across accounts? -
i developing application uses documentdb store customer data. 1 of requirements segregate customer data geographic region, customers' data stored within us, , european customers' data lives in europe.
the way planned achieve have 2 documentdb accounts, since account associated data centre/region. each account have database, , collection within database.
i've reviewed documentdb documentation on client- , server-side partitioning (e.g. 1, 2), seems me built-in partitioning support not able deal multiple regions. though implementation of ipartitionresolver
conceivably return arbitrary collection self-link, partition map associated documentclient
, therefore tied specific account.
therefore appears need create own partitioning logic , maintain 2 separate documentclient
instances - 1 account , 1 europe account. there other ways of achieving requirement?
azure's best practices on data partitioning says:
all databases created in context of documentdb account. single documentdb account can contain several databases, , specifies in region databases created. each documentdb account enforces own access control. can use documentdb accounts geo-locate shards (collections within databases) close users need access them, , enforce restrictions users can connect them.
so, if intention keep data near user (and not keep them stored separate) option create different accounts. lucky billing not per account based per collection based.
documentdb's resource model gives impression can not (atleast out of box) mix documentdb accounts. doesn't partition keys of use partitions can happen within same account.
may sample or give hints.
Comments
Post a Comment