{"id":1754,"date":"2014-12-16T18:49:53","date_gmt":"2014-12-16T18:49:52","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1754"},"modified":"2014-12-16T18:49:53","modified_gmt":"2014-12-16T18:49:52","slug":"organizing-document-structure-document-databases","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/","title":{"rendered":"Organizing Document Structure in Document Databases"},"content":{"rendered":"<p>Couchbase is schema-less. That runs against the grain of traditional, RDBMS history and experience, but it&#39;s proven to be one of the most lauded features of NoSQL databases.<\/p>\n<p>Not being required to develop a schema before you build your application is a huge time saver. It enables quick prototyping and lets you mold the structure of your document as you delve into its different uses within your application.<\/p>\n<p>However, the lack of a required, formal schema, does not mean your documents don&#39;t gain value from having a consistent structure or &#8220;inherent&#8221; schema.<\/p>\n<p>One of the key considerations when crafting your documents for Couchbase is how granularly to split your data: one document or multiple documents for a single concept?<\/p>\n<p>Here are the key decision makers when choosing how to construct your data in Couchbase:<\/p>\n<p><em>What does this document look like in real life?<\/em><br \/>\nIn our case, we have Breweries and their Beer. We have a noun for each, and in the earlier post, we had a document for each. It feels natural, and makes sense.<\/p>\n<p><em>How often will I update this?<\/em><\/p>\n<p>Breweries and Beers are fairly static topics. It&#39;s more likely that we&#39;ll be adding Beer documents to a Brewery&#39;s portfolio rather than updating a Beer&#39;s description or changing a Brewery&#39;s address. Those things happen, but it&#39;s rare when compared with stock tickers, sensor data, or social game actions.<\/p>\n<p><em>Do you want all this data updated together?<\/em><br \/>\nIn Couchbase, the document is the smallest level of atomicity. If we combine Brewery and Beer data into a single document, all changes to Beer data require sending the entire Brewery document that contains it as well. All creation and update operations happen on that entire collection as if it were a single thing. This has the advantage of consolidating disparate updates into single, streamlined requests, but has the disadvantage of requiring a larger update each time a change is made to any of the contained concepts.<\/p>\n<p>Currently it looks like we have two available options when designing documents:<\/p>\n<ul>\n<li>one document for every distinct concept<\/li>\n<li>one document for the largest &#8220;container&#8221; concept<\/li>\n<\/ul>\n<p>However, there&#39;s a third option: determine the canonical data later with MapReduce. Content can be structured in such a way that it will exist more like a &#8220;general ledger&#8221; from which you can build an index that states what the canonical data is from among the documents. Plus, you can leave the past (now &#8220;stale&#8221;) data in the database without having to worry about the effects of that stale data on how you view the active material. This can prove advantageous if you&#39;d prefer to have that historical data available. In this case, we could put the address of the brewery on both the Brewery and Beer documents and be able to find that a Beer was originally crafted at the Brewery&#39;s original location. Interesting options abound!<\/p>\n<p>Since Couchbase is de-normalization friendly, we could put the Brewery data in each Beer document:<\/p>\n<h3>Beer with Brewery Object<\/h3>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #009900;\">{<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;_id&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;beer_1554_Enlightened_Black_Ale&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;_rev&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;1-191ae52a6c773fd7749b65ffd9ae8044&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;brewery&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;name&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;New Belgium Brewing&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;address&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">[<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;500 Linden Street&#8221;<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #009900;\">]<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;city&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;Fort Collins&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;state&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;Colorado&#8221;<\/span><br \/>\n\u00a0 \u00a0 \u00a0&#8230;<br \/>\n\u00a0 \u00a0<span style=\"color: #009900;\">}<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;name&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;1554 Enlightened Black Ale&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;abv&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;5.5&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0&#8230;<br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;category&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;Belgian and French Ale&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;style&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;Other Belgian-Style Ales&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;updated&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;2010-07-22 20:00:20&#8221;<\/span><br \/>\n<span style=\"color: #009900;\">}<\/span><\/div>\n<\/div>\n<p>This could save us a great deal of request time. It could also serve as a history record of where the beer was original brewed (if the address of the brewery changed years later). If we need the canonical brewery info in our app (vs. possibly stale data), then we can construct the brewery ID from it&#39;s name (at least in this app), and look up the address from the authoritative Brewery document. The Brewery document would be the canonical source of information about the Brewery, and the Brewery address information on the Beer document could serve as a historical reference.<\/p>\n<h4>Pros:<\/h4>\n<ul>\n<li>Get a Beer document and you have the Brewery info in one request<\/li>\n<li>Brewery info on Beer documents could serve some historical purposes<\/li>\n<li>No need to use MapReduce View Collation to construct relationships<\/li>\n<\/ul>\n<h4>Cons:<\/h4>\n<ul>\n<li>Getting the latest Brewery information takes a second request or a multiget (if you know both IDs) or a MapReduce View<\/li>\n<\/ul>\n<h3>Brewery with Beer Objects<\/h3>\n<p>Let&#39;s flip that last example on it&#39;s head. Brewery&#39;s brew beers. If they&#39;ve not given away the recipe (or even if they have), you can&#39;t get that particular beer, made that particular way, with that special mountain water (or whatever) from anyone but that brewery. So why not store all the beers within a Brewery document?<\/p>\n<p>Let&#39;s take a look at what this new structure might look like. The first several lines are from the original New Belgium Brewing document. The new addition is the &#8220;beers&#8221; key and the object of beer information set as its value.<\/p>\n<div class=\"geshifilter\">\n<div class=\"javascript geshifilter-javascript\" style=\"font-family:monospace;\"><span style=\"color: #009900;\">{<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;_id&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;brewery_New_Belgium_Brewing&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;_rev&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;1-e405d6f86ec028a4fe0d18be0a6d4fa1&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;name&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;New Belgium Brewing&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;address&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">[<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;500 Linden Street&#8221;<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #009900;\">]<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0&#8230;..<br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;geo&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;loc&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">[<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;-105.07&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;40.5929&#8221;<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0<span style=\"color: #009900;\">]<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #009900;\">}<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;updated&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;2010-07-22 20:00:20&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #3366CC;\">&#8220;beers&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;1554_Enlightened_Black_Ale&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;name&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;1554 Enlightened Black Ale&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;abv&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;5.5&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;category&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;Belgian and French Ale&#8221;<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;style&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #3366CC;\">&#8220;Other Belgian-Style Ales&#8221;<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #009900;\">}<\/span><span style=\"color: #339933;\">,<\/span><br \/>\n\u00a0 \u00a0 \u00a0 <span style=\"color: #3366CC;\">&#8220;beer_Fat_Tire&#8221;<\/span><span style=\"color: #339933;\">:<\/span> <span style=\"color: #009900;\">{<\/span>&#8230;<span style=\"color: #009900;\">}<\/span><br \/>\n\u00a0 \u00a0<span style=\"color: #009900;\">}<\/span><br \/>\n<span style=\"color: #009900;\">}<\/span><\/div>\n<\/div>\n<p>Our new &#8220;beers&#8221; child-object has keys for each beer using nearly the same IDs as keys for Beer documents we saw earlier (just without the &#8220;beer_&#8221; prefix).<\/p>\n<h4>Pros:<\/h4>\n<ul>\n<li>Brewery and its Beer in a single (possibly quite large) request<\/li>\n<li>No need to use View Collation to construct relationships<\/li>\n<\/ul>\n<h4>Cons:<\/h4>\n<ul>\n<li>Beer docs aren&#39;t directly retrievable (requires MapReduce)<\/li>\n<li>Size of the response could be quite large for big Breweries (+1 for microbreweries!)<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>Either of these approaches could be valid for different use cases. In cases where you want quick retrieval of a relationship &#8220;package&#8221; going the single, combined document route can be a great optimization.<\/p>\n<p>Enjoy the freedom, consider your options, and get that prototype built!<\/p>\n<p>Next up, we&#39;ll look at how to build indexes from the original Beer and Brewery documents. Stay tuned!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Couchbase is schema-less. That runs against the grain of traditional, RDBMS history and experience, but it&#39;s proven to be one of the most lauded features of NoSQL databases. Not being required to develop a schema before you build your application [&hellip;]<\/p>\n","protected":false},"author":36,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[9010],"class_list":["post-1754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.0 (Yoast SEO v26.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Organizing Document Structure in Document Databases - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Organizing Document Structure in Document Databases\" \/>\n<meta property=\"og:description\" content=\"Couchbase is schema-less. That runs against the grain of traditional, RDBMS history and experience, but it&#039;s proven to be one of the most lauded features of NoSQL databases. Not being required to develop a schema before you build your application [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-16T18:49:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Benjamin Young\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Young\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\"},\"author\":{\"name\":\"Benjamin Young\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/77c27b26379aa24fc2ec0c8726f5c19a\"},\"headline\":\"Organizing Document Structure in Document Databases\",\"datePublished\":\"2014-12-16T18:49:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\"},\"wordCount\":1006,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\",\"name\":\"Organizing Document Structure in Document Databases - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2014-12-16T18:49:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Organizing Document Structure in Document Databases\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/77c27b26379aa24fc2ec0c8726f5c19a\",\"name\":\"Benjamin Young\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ceaa78687ff2a1ec292e14e531bbcef4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4c72174438e035b8de1ddf66b0740394e6f833501446406b9da838e1cb014db5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4c72174438e035b8de1ddf66b0740394e6f833501446406b9da838e1cb014db5?s=96&d=mm&r=g\",\"caption\":\"Benjamin Young\"},\"description\":\"Benjamin Young is a User Experience Engineer at Couchbase specializing in cushion and seat cover design for Apache CouchDB and bucket juggling for Membase.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/benjamin-young\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Organizing Document Structure in Document Databases - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/","og_locale":"en_US","og_type":"article","og_title":"Organizing Document Structure in Document Databases","og_description":"Couchbase is schema-less. That runs against the grain of traditional, RDBMS history and experience, but it&#39;s proven to be one of the most lauded features of NoSQL databases. Not being required to develop a schema before you build your application [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/","og_site_name":"The Couchbase Blog","article_published_time":"2014-12-16T18:49:52+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Benjamin Young","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin Young","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/"},"author":{"name":"Benjamin Young","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/77c27b26379aa24fc2ec0c8726f5c19a"},"headline":"Organizing Document Structure in Document Databases","datePublished":"2014-12-16T18:49:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/"},"wordCount":1006,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/","url":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/","name":"Organizing Document Structure in Document Databases - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2014-12-16T18:49:52+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/organizing-document-structure-document-databases\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Organizing Document Structure in Document Databases"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/77c27b26379aa24fc2ec0c8726f5c19a","name":"Benjamin Young","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ceaa78687ff2a1ec292e14e531bbcef4","url":"https:\/\/secure.gravatar.com\/avatar\/4c72174438e035b8de1ddf66b0740394e6f833501446406b9da838e1cb014db5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4c72174438e035b8de1ddf66b0740394e6f833501446406b9da838e1cb014db5?s=96&d=mm&r=g","caption":"Benjamin Young"},"description":"Benjamin Young is a User Experience Engineer at Couchbase specializing in cushion and seat cover design for Apache CouchDB and bucket juggling for Membase.","url":"https:\/\/www.couchbase.com\/blog\/author\/benjamin-young\/"}]}},"authors":[{"term_id":9010,"user_id":36,"is_guest":0,"slug":"benjamin-young","display_name":"Benjamin Young","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/4c72174438e035b8de1ddf66b0740394e6f833501446406b9da838e1cb014db5?s=96&d=mm&r=g","author_category":"","last_name":"Young","first_name":"Benjamin","job_title":"","user_url":"","description":"Benjamin Young is a User Experience Engineer at Couchbase specializing in cushion and seat cover design for Apache CouchDB and bucket juggling for Membase."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=1754"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1754\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=1754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=1754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=1754"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}