locked
Newbie Question: Need help conceptualizing collections RRS feed

  • Question

  • Hi,

    I'm trying to conceptualize collections in DocumentDB and would appreciate some help.

    Do collections have just one "field" where we store the entire json document or do they somewhat resemble Azure Storage Tables where there's a key field and a value field?

    When we search for something, are we storing its Id in the key field and the json document in the value field OR are they more like single column tables where the entire json document is stored in the only field there is?


    Thanks, Sam

    Wednesday, August 27, 2014 3:40 AM

Answers

  • Hi Sam,

    When thinking about collections in DocumentDB, instead of thinking of Tables think of them as partitions. A collection is a boundary by which we can and will partition data. We will also scope queries and transactions to a single collection. Similar concept to an Azure Table Storage partition.

    In terms of are they one column, or field, think of them rather as a bag where you can put documents.
    They don't have to be documents of similar types, or documents even relating to each other.
    You store the document, we index everything, you query for and operate on the results of the queries.

    Does that help conceptualize?

    • Proposed as answer by Ryan CrawCour [MSFT] Wednesday, August 27, 2014 8:58 PM
    • Marked as answer by imsam67 Thursday, August 28, 2014 2:33 AM
    Wednesday, August 27, 2014 8:57 PM

All replies

  • Hi Sam,

    When thinking about collections in DocumentDB, instead of thinking of Tables think of them as partitions. A collection is a boundary by which we can and will partition data. We will also scope queries and transactions to a single collection. Similar concept to an Azure Table Storage partition.

    In terms of are they one column, or field, think of them rather as a bag where you can put documents.
    They don't have to be documents of similar types, or documents even relating to each other.
    You store the document, we index everything, you query for and operate on the results of the queries.

    Does that help conceptualize?

    • Proposed as answer by Ryan CrawCour [MSFT] Wednesday, August 27, 2014 8:58 PM
    • Marked as answer by imsam67 Thursday, August 28, 2014 2:33 AM
    Wednesday, August 27, 2014 8:57 PM
  • Yes, your response definitely helped. Thanks again Ryan. You've been very very helpful. Much appreciated.

    Thanks, Sam

    Thursday, August 28, 2014 2:34 AM