{"id":1806,"date":"2014-12-16T18:03:44","date_gmt":"2014-12-16T18:03:44","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1806"},"modified":"2018-12-26T01:33:23","modified_gmt":"2018-12-26T09:33:23","slug":"three-things-know-about-document-database-modelling-part-1","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/","title":{"rendered":"Three things to know about document database modelling: part 1"},"content":{"rendered":"<p><span style=\"font-family: arial,helvetica,sans-serif;\">Most of us could churn out a first stab at a relational database model while sleeping.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Once you&#8217;ve chosen to work with a document database, though, you&#8217;ll need to think a little differently.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">It&#8217;s no more difficult, it&#8217;s just that you&#8217;re optimising for different things.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">So, what are the basics to getting it right?<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Well, there are three principles that can help guide your thinking:<\/span><\/p>\n<ul class=\"rteindent1\">\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Answer the questions you know you&#8217;ll ask.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Embed data for convenience, refer for integrity.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Name your keys predictably and semantically.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Today, let&#8217;s look at the first of those in detail.<\/span><\/p>\n<h2><span style=\"font-family: arial,helvetica,sans-serif;\">Questions, not answers<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">When we split our data into the tables, columns and rows of the relational model, we&#8217;re optimising for queryability. We&#8217;re building a source of almost unbound answers and deferring our decisions about what questions to ask.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Let&#8217;s take a simple example: a stock management system that lets us track Couchbase-branded swag.\u00a0<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">In this system, we have t-shirts, USB sticks, pens and that sort of thing. From time to time we get orders to send them out to meet-up groups, conferences and individuals.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Most likely, that&#8217;d give us the following relational tables:<\/span><\/p>\n<ul class=\"rteindent1\">\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">products<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">customers<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">orders<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">order_details<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">At first glance, <em>Order details<\/em>\u00a0might seem non-obvious. However, it allows us to store references to all the items in each order without breaking the first normal form. Otherwise, we&#8217;d have to serialise the line items from each order into a string and store that in a TEXT column.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Unless we make a mistake, each product, customer and order will appear only once in our database. That gives us a guarantee that updates to records are universal and it makes it supremely easy to query the data in whatever way we choose.\u00a0<\/span><\/p>\n<h2><span style=\"font-family: arial,helvetica,sans-serif;\">Trade-offs, there are always trade-offs<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">That way, we get to store the data for our swag management system in its purest form and then query it in whatever way suits us later on.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">So, what&#8217;s the problem?<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Well, there are a couple of trade-offs:<\/span><\/p>\n<ul class=\"rteindent1\">\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">SQL queries are expensive: for each join there&#8217;s a disk seek, there&#8217;s CPU overhead, there&#8217;s a user waiting for their page to render.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Relational databases are hard to scale out across a cluster.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Let&#8217;s focus on that first trade-off for now: if you&#8217;re being unkind, you could say that relational data modelling is an exercise in stealing CPU cycles from your future self.\u00a0<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">We know most of our query patterns early on and yet we so often spend time carefully stripping our data of that context. We split the data once and then spend the rest of our applications&#8217; lifetime asking the database server to piece it all back together.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Of course, that has its place but it&#8217;s almost the very opposite of the most efficient path with a document database.<\/span><\/p>\n<h2><span style=\"font-family: arial,helvetica,sans-serif;\">Don&#8217;t make people wait for answers<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">The first thing we do when modelling for a document database is ask, &#8220;what questions do I want to ask of my data?&#8221;<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Then when our system state changes, we compute the answers to those questions and store them pre-canned in the database.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Rather than re-piecing the answers each time we make a query, we pull the answer fully formed from the database in a single look-up.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">What does that mean in practice?<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Let&#8217;s go back to our swag management example. One of our questions would be:<\/span><\/p>\n<blockquote><p><span style=\"font-family: arial,helvetica,sans-serif;\">What do I need to do in order to fulfill a particular order?<\/span><\/p><\/blockquote>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">With a relational database, we&#8217;d write a SQL query that would find the order, use a join to find the items in the order, then another join to find the detail of what each item is and a further join to find the customer details.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">With Couchbase, it would look something more like this:<\/span><\/p>\n<ol class=\"rteindent1\">\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">User selects their items and makes their order.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Our system writes the order into the database as a single document.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">When we need to pull out order details, it&#8217;s one read to grab the lot.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">The resultant order document might look like this:<\/span><\/p>\n<div class=\"geshifilter\">\n<div class=\"text geshifilter-text\" style=\"font-family: monospace;\">{<br \/>\n&#8220;orderID&#8221;: 200,<br \/>\n&#8220;customer&#8221;:<br \/>\n{<br \/>\n&#8220;name&#8221;: &#8220;Matthew Revell&#8221;,<br \/>\n&#8220;address&#8221;: &#8220;11-21 Paul Street&#8221;,<br \/>\n&#8220;city&#8221;: &#8220;London&#8221;<br \/>\n},<br \/>\n&#8220;products&#8221;:<br \/>\n[<br \/>\n{<br \/>\n&#8220;itemCode&#8221;: &#8220;RedTShirt&#8221;,<br \/>\n&#8220;itemName&#8221;: &#8220;Red Couchbase t-shirt&#8221;,<br \/>\n&#8220;quantityOrdered&#8221;: 3<br \/>\n},<br \/>\n{<br \/>\n&#8220;itemCode&#8221;: &#8220;USB&#8221;,<br \/>\n&#8220;itemName&#8221;: &#8220;Black 8GB USB stick with red Couchbase logo&#8221;,<br \/>\n&#8220;quantityOrder&#8221;: 51<br \/>\n}<br \/>\n],<br \/>\n&#8220;status&#8221;: &#8220;paid&#8221;<br \/>\n}<\/div>\n<\/div>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><span style=\"font-size: 1em; line-height: 1.4375em;\">This example is pretty heavily denormalised. Our swag management system would have details of each customer and product in separate documents already but we&#8217;re repeating what we know about them by embedding their details here.<\/span><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">We&#8217;ll look at the trade-offs involved with embedding data versus referring to data in a future post.<span style=\"font-size: 1em; line-height: 1.4375em;\">\u00a0<\/span><\/span><\/p>\n<h2><span style=\"font-family: arial,helvetica,sans-serif;\">Production is more complex<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">In a production system, we&#8217;d most likely generate several of those ready made answers. Without really thinking about it, we can probably come up with a few of them for our swag management system:<\/span><\/p>\n<ul class=\"rteindent1\">\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Customer order history: customers want to look back at everything they&#8217;ve ordered, so we&#8217;d record this order against that person.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Live order status: similarly, our customers will want to see the status of their order, so we can generate that information now and then update whenever anything changes.<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Dispatch instructions: we&#8217;ll need to tell the people in our warehouse what they need to send where.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">The important thing is that we don&#8217;t have to generate all of these while a human being is waiting for a response.\u00a0<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">While we might want to update the customer&#8217;s live order status immediately, so that they can verify their order was recorded, it&#8217;s fine to process the dispatch instruction asynchronously.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">This way, when a human views something in our system, the data is already there waiting.\u00a0<\/span><\/p>\n<h2><span style=\"font-family: arial,helvetica,sans-serif;\">In summary: pre-compute your answers<\/span><\/h2>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">The first step to efficient document database modelling is to think in terms of pre-computing your answers.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">We know up-front what questions we want to ask and so we can cater to those questions in the way that we write our data.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">While there&#8217;s a lot of intellectual appeal in the idea of a pure, normalised, mathematically sound representation of our data, in practice it can make it harder to serve multiple concurrent users and to scale our operation as demand changes.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">By computing our various answers at write time, we:<\/span><\/p>\n<ul class=\"rteindent1\">\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">remove lag from our user experience<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">can more easily distribute the data across a cluster<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">get the added bonus of less mismatch between object state and what&#8217;s in the database.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Next time I&#8217;ll look at when to embed data and when to refer data.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of us could churn out a first stab at a relational database model while sleeping. Once you&#8217;ve chosen to work with a document database, though, you&#8217;ll need to think a little differently. It&#8217;s no more difficult, it&#8217;s just that [&hellip;]<\/p>\n","protected":false},"author":18,"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":[8982],"class_list":["post-1806","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>Three things to know about document database modelling<\/title>\n<meta name=\"description\" content=\"The first step to efficient document database modelling is to think in terms of pre-computing your answers and know the three things to know about the same.\" \/>\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\/three-things-know-about-document-database-modelling-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Three things to know about document database modelling: part 1\" \/>\n<meta property=\"og:description\" content=\"The first step to efficient document database modelling is to think in terms of pre-computing your answers and know the three things to know about the same.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-16T18:03:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-12-26T09:33:23+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=\"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase\" \/>\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\/three-things-know-about-document-database-modelling-part-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/\"},\"author\":{\"name\":\"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/6c3060a94353df62a71d4672b3454555\"},\"headline\":\"Three things to know about document database modelling: part 1\",\"datePublished\":\"2014-12-16T18:03:44+00:00\",\"dateModified\":\"2018-12-26T09:33:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/\"},\"wordCount\":1103,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#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\/three-things-know-about-document-database-modelling-part-1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/\",\"name\":\"Three things to know about document database modelling\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2014-12-16T18:03:44+00:00\",\"dateModified\":\"2018-12-26T09:33:23+00:00\",\"description\":\"The first step to efficient document database modelling is to think in terms of pre-computing your answers and know the three things to know about the same.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#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\/three-things-know-about-document-database-modelling-part-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Three things to know about document database modelling: part 1\"}]},{\"@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\/6c3060a94353df62a71d4672b3454555\",\"name\":\"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/b1bc555cd9166b46d6063003c3b92317\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3b38ea45b78371f0008a765ea828bfed91aa97c25981ebf214226402a510b39b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3b38ea45b78371f0008a765ea828bfed91aa97c25981ebf214226402a510b39b?s=96&d=mm&r=g\",\"caption\":\"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase\"},\"description\":\"Matthew Revell is a Lead Dev Advocate, EMEA Couchbase. He developed a global strategy for putting Couchbase front in the minds of the product's developers.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/matthew-revell\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Three things to know about document database modelling","description":"The first step to efficient document database modelling is to think in terms of pre-computing your answers and know the three things to know about the same.","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\/three-things-know-about-document-database-modelling-part-1\/","og_locale":"en_US","og_type":"article","og_title":"Three things to know about document database modelling: part 1","og_description":"The first step to efficient document database modelling is to think in terms of pre-computing your answers and know the three things to know about the same.","og_url":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/","og_site_name":"The Couchbase Blog","article_published_time":"2014-12-16T18:03:44+00:00","article_modified_time":"2018-12-26T09:33:23+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":"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/"},"author":{"name":"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/6c3060a94353df62a71d4672b3454555"},"headline":"Three things to know about document database modelling: part 1","datePublished":"2014-12-16T18:03:44+00:00","dateModified":"2018-12-26T09:33:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/"},"wordCount":1103,"commentCount":5,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#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\/three-things-know-about-document-database-modelling-part-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/","url":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/","name":"Three things to know about document database modelling","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2014-12-16T18:03:44+00:00","dateModified":"2018-12-26T09:33:23+00:00","description":"The first step to efficient document database modelling is to think in terms of pre-computing your answers and know the three things to know about the same.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/three-things-know-about-document-database-modelling-part-1\/#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\/three-things-know-about-document-database-modelling-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Three things to know about document database modelling: part 1"}]},{"@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\/6c3060a94353df62a71d4672b3454555","name":"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/b1bc555cd9166b46d6063003c3b92317","url":"https:\/\/secure.gravatar.com\/avatar\/3b38ea45b78371f0008a765ea828bfed91aa97c25981ebf214226402a510b39b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b38ea45b78371f0008a765ea828bfed91aa97c25981ebf214226402a510b39b?s=96&d=mm&r=g","caption":"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase"},"description":"Matthew Revell is a Lead Dev Advocate, EMEA Couchbase. He developed a global strategy for putting Couchbase front in the minds of the product's developers.","url":"https:\/\/www.couchbase.com\/blog\/author\/matthew-revell\/"}]}},"authors":[{"term_id":8982,"user_id":18,"is_guest":0,"slug":"matthew-revell","display_name":"Matthew Revell, Lead Developer Advocate, EMEA, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/3b38ea45b78371f0008a765ea828bfed91aa97c25981ebf214226402a510b39b?s=96&d=mm&r=g","author_category":"","last_name":"Revell","first_name":"Matthew","job_title":"","user_url":"","description":"Matthew Revell is a Lead Dev Advocate, EMEA Couchbase. He developed a global strategy for putting Couchbase front in the minds of the product's developers."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1806","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\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=1806"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/1806\/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=1806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=1806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=1806"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=1806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}