{"id":9527,"date":"2020-10-19T23:43:40","date_gmt":"2020-10-20T06:43:40","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=9527"},"modified":"2025-06-13T19:27:19","modified_gmt":"2025-06-14T02:27:19","slug":"couchbase-views-and-better-alternatives-part-1-of-2","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/","title":{"rendered":"Couchbase Views and Better Alternatives [Part 1 of 2]"},"content":{"rendered":"<h5><strong>Introduction<\/strong><\/h5>\n<p>This blog is meant for users who are familiar with the basics of Couchbase Server and Views. Novice users should<a href=\"https:\/\/docs.couchbase.com\/server\/current\/getting-started\/start-here.html\"> start here<\/a> to gain basic understanding of Couchbase Server and then<a href=\"https:\/\/docs.couchbase.com\/server\/6.0\/learn\/views\/views-basics.html\"> continue here<\/a> to get acquainted with Views.<\/p>\n<p>Views were added in Couchbase Server nearly nine years ago to support secondary key access on the stored json data. They have served us well, but now we have better alternatives, namely <a href=\"https:\/\/docs.couchbase.com\/server\/current\/learn\/services-and-indexes\/indexes\/global-secondary-indexes.html\">Global Secondary Indexing<\/a> and <a href=\"https:\/\/docs.couchbase.com\/server\/current\/getting-started\/try-a-query.html\">N1QL querying<\/a>, <a href=\"https:\/\/docs.couchbase.com\/server\/current\/fts\/full-text-intro.html\">Full Text Search<\/a> and <a href=\"https:\/\/docs.couchbase.com\/server\/current\/analytics\/introduction.html\">Analytics<\/a>. In this blog we will try to gain basic understanding of Views, the common use cases they support and their limitations. Later, in a second blog, we will take a look at the aforementioned better alternatives.<\/p>\n<h5><strong>What is a Couchbase view?<\/strong><\/h5>\n<p>First, let\u2019s learn what a Couchbase view is and how it works. A view is basically a materialized version of selected portions of a dataset. Its definition is stored in a design document that comprises a \u2018Map\u2019 function operating on the Key-Value data that is then fed to an (optional) subsequent &#8220;Reduce&#8221; phase that further summarizes the data. Both outputs are materialized on disk under the &#8220;views&#8221; directory on each Data node in the cluster.<\/p>\n<h5><strong>How does a view work?<\/strong><\/h5>\n<p>Couchbase views are eventually consistent with their source data. Each view is updated at frequent intervals, by default every 5 seconds or 5000 mutations, whichever comes first. They are similar to Oracle\u2019s materialized views that are local to data partitions and are refreshed using a set of rules at some predefined intervals.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9528\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/10\/Views-blog-grphic-1-300x126.png\" alt=\"\" width=\"1066\" height=\"447\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-1-300x126.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-1-768x322.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-1-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-1.png 991w\" sizes=\"auto, (max-width: 1066px) 100vw, 1066px\" \/><\/p>\n<p>View replicas and compaction is very easy to configure. Replicas can be enabled easily on per bucket basis. Compaction can be configured equally easily alongside the compaction policy for buckets.<\/p>\n<p>Views use map and reduce functions to pre-calculate and store their results, hence minimizing the need for just in time calculations.\u00a0View functions are written in JavaScript. Hence, you can express fairly complex logic in a view definition without having to suffer long latencies at querying time. A map function is the most critical part of any view as it creates a logical mapping between the source dataset and its subset that is held by the view. Each map function is supplied a \u2018doc\u2019 and a \u2018meta\u2019 argument giving the function access to each stored item and its metadata.<\/p>\n<p>Basic form of a map function looks like this:<\/p>\n<pre class=\"font-size:11 lang:default decode:true\">function(doc, meta)\r\n{\r\n    if (doc.attribute){\r\n        emit(doc.attribute);\r\n    }\r\n}\r\n<\/pre>\n<p>This function returns rows containing keys and doc.attribute\u2019s values.<\/p>\n<p>Couchbase provides a few built-in reduce functions namely _count (provides a simple count of the rows that are output by the map function), _sum (provides a sum of the values output by the map function as long as they are numeric; supports group level summation) and _stats (provides count, min, max, sum and sum square of the values output by the map function as long as they are numeric).<\/p>\n<p>Writing of custom reduce functions is supported as well as overriding of the built-in reduce functions is supported.<\/p>\n<h5><strong>Querying a view<\/strong><\/h5>\n<p>View queries can be based on a single key, set of keys or key ranges with specified start and end. A view query can be targeted to any Data node which spreads it to the rest of the Data nodes in the cluster and gathers results from them, collates the results and responds to the query. This approach is called \u201cscatter and gather\u201d.<\/p>\n<p>Views offer three levels of consistency at querying time through the use of a parameter named \u2018stale\u2019. Stale value \u2018update_after\u2019 is the default. It returns the view query results and then triggers an index update. It offers fast responses but the query results have the potential for being stale. Stale value \u2018ok\u2019 means that the query results are returned without triggering an index update. Obviously, it gives fast responses but they carry the potential for being stale. Stale value \u2018false\u2019 means that the view index is updated before executing the query, hence the response may be delayed.<\/p>\n<h5><strong>Common use cases for views<\/strong><\/h5>\n<p>Views easily support common use cases such as:<\/p>\n<ul>\n<li>generating lists of data on specific object types<\/li>\n<li>generating tables and lists of information based on your stored data<\/li>\n<li>extracting or filtering information from the database<\/li>\n<li>returning pre-calculated aggregations or reductions on collections of stored data<\/li>\n<li>multi-level group by aggregations<\/li>\n<li>querying geo spatial data<\/li>\n<li>pagination<\/li>\n<\/ul>\n<p>Now let\u2019s create and query a view to see how a map and built reduce functions work together to give us statistical aggregations of geographical altitude of all airports in the travel-sample dataset. This screenshot of Couchbase Administrator Console UI shows how a view can be created there.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9529\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/10\/Views-blog-grphic-2-300x248.png\" alt=\"\" width=\"1290\" height=\"1066\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-2-300x248.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-2-1024x847.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-2-768x635.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-2-20x17.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Views-blog-grphic-2.png 1241w\" sizes=\"auto, (max-width: 1290px) 100vw, 1290px\" \/><\/p>\n<p>Impressive stuff!<\/p>\n<p>No doubt, Views are easy to create and easy to use. However, they do have their drawbacks and limitations. Let\u2019s take a look at how the above example can be easily served by using modern and better Couchbase features; Global Secondary Indexing and N1QL.<\/p>\n<p>First load travel-sample bucket and create a secondary index with the following definition.<\/p>\n<pre class=\"font-size:11 lang:default decode:true\">CREATE INDEX geo_altitude_idx ON `travel-sample`(geo.alt);<\/pre>\n<p>Then, execute the following N1QL query.<\/p>\n<pre class=\"font-size:11 lang:default decode:true \">SELECT SUM(geo.alt) as sum, COUNT (geo.alt) as count, MIN(geo.alt) as min, MAX(geo.alt) as mix, SUM(POWER(geo.alt,2)) as sumsqr FROM `travel-sample`;<\/pre>\n<p>This query returns the following result set.<\/p>\n<pre class=\"font-size:11 lang:default decode:true\">{\r\n\"count\": 1968,\r\n\"min\": -54,\r\n\"mix\": 9078,\r\n\"sum\": 1712485,\r\n\"sumsqr\": 5303561573\r\n}<\/pre>\n<p>That\u2019s how easy it is!<\/p>\n<h5><strong>Limitations of Views<\/strong><\/h5>\n<p>While Views offer great ease and flexibility in expressing the indexing and querying logic, they have their weaknesses and disadvantages such as:<\/p>\n<ol>\n<li>They are not easy to scale because they are tied with data partitions. Hence, they can\u2019t benefit from Couchbase\u2019s multi-dimensional scaling.<\/li>\n<li>It is not possible to achieve workload isolation with Views for the aforementioned reason.<\/li>\n<li>They can\u2019t deliver throughput higher than a few thousand QPS due to dependence on disk persistence and the scatter gather overhead.<\/li>\n<li>Storing view indexes on disk along with data partitions increases the overall amount of data on each Data node\u2019s disk. This results in longer rebalance times. Likewise, storing, updating and compacting of view indexes increases disk IO utilization.<\/li>\n<li>No memory quota is set aside for caching of view indexes. Hence, they can\u2019t deliver the best performance.<\/li>\n<li>Views don\u2019t offer strong error checking; hence it is easy to make mistakes in their definitions. For example, one can easily attempt to parse a json attribute that may exist only in a subset of documents. The map function for such a view logs parse errors for documents where that attribute doesn\u2019t exist.<\/li>\n<li>View updates often take a long time because they are disk bound. Modifying an existing view definition or executing a full build on a dev view, causes the entire view to be recreated. The issue gets amplified when a single design document has multiple views.<\/li>\n<li>Ephemeral buckets offer low latency and consistent high throughput reads and writes, but no views can be created on them because these buckets have no disk persistence.<\/li>\n<li>Views are eventually consistent compared to the underlying stored documents.<\/li>\n<\/ol>\n<h5><strong>Conclusion<\/strong><\/h5>\n<p>Couchbase Views have had a good run, but now we have better alternatives that offer far better manageability, scalability, performance and throughput. Given the expressive power of N1QL queries, the ease of scaling offered by multidimensional scaling, much higher performance and throughout delivered by Global Secondary Indexing and Full Text Search, it is very likely that Views will get deprecated soon. Users are encouraged to learn the new alternatives and start planning a migration. More will be said about those alternatives in the next blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This blog is meant for users who are familiar with the basics of Couchbase Server and Views. Novice users should start here to gain basic understanding of Couchbase Server and then continue here to get acquainted with Views. Views [&hellip;]<\/p>\n","protected":false},"author":64938,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816,9381,9411,1812],"tags":[1696,9271,2108,1241],"ppma_author":[8923],"class_list":["post-9527","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-indexing","category-multi-dimensional-scaling","category-n1ql-query","tag-indexing","tag-multi-dimensional-scaling","tag-scaling","tag-views"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Couchbase Views and Better Alternatives [Part 1 of 2] - 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\/couchbase-views-and-better-alternatives-part-1-of-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase Views and Better Alternatives [Part 1 of 2]\" \/>\n<meta property=\"og:description\" content=\"Introduction This blog is meant for users who are familiar with the basics of Couchbase Server and Views. Novice users should start here to gain basic understanding of Couchbase Server and then continue here to get acquainted with Views. Views [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-20T06:43:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:27:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Couchbase-Views-and-better-alternatives-part-1-of-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"627\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nirvair Singh, Solutions Architect, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Couchbase-Views-and-better-alternatives-part-1-of-2.png\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nirvair Singh, Solutions Architect, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/\"},\"author\":{\"name\":\"Nirvair Singh, Solutions Architect, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/e45019e9f99fc655864989d50ccc792a\"},\"headline\":\"Couchbase Views and Better Alternatives [Part 1 of 2]\",\"datePublished\":\"2020-10-20T06:43:40+00:00\",\"dateModified\":\"2025-06-14T02:27:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/\"},\"wordCount\":1217,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Indexing\",\"Multi-Dimensional Scaling (MDS)\",\"scaling\",\"views\"],\"articleSection\":[\"Couchbase Server\",\"Indexing\",\"Multi-Dimensional Scaling (MDS)\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/\",\"name\":\"Couchbase Views and Better Alternatives [Part 1 of 2] - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2020-10-20T06:43:40+00:00\",\"dateModified\":\"2025-06-14T02:27:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#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\/couchbase-views-and-better-alternatives-part-1-of-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase Views and Better Alternatives [Part 1 of 2]\"}]},{\"@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\/e45019e9f99fc655864989d50ccc792a\",\"name\":\"Nirvair Singh, Solutions Architect, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/baa2c25e4ef21ceae5c4241217e2e13e\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fe50bfb547fe1a261248b5436e3afc4923283be031a5eb8557c939127793f2ce?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fe50bfb547fe1a261248b5436e3afc4923283be031a5eb8557c939127793f2ce?s=96&d=mm&r=g\",\"caption\":\"Nirvair Singh, Solutions Architect, Couchbase\"},\"description\":\"Solutions ArchitectrnCenter of Excellence Team\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/nirvair-singh\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Couchbase Views and Better Alternatives [Part 1 of 2] - 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\/couchbase-views-and-better-alternatives-part-1-of-2\/","og_locale":"en_US","og_type":"article","og_title":"Couchbase Views and Better Alternatives [Part 1 of 2]","og_description":"Introduction This blog is meant for users who are familiar with the basics of Couchbase Server and Views. Novice users should start here to gain basic understanding of Couchbase Server and then continue here to get acquainted with Views. Views [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/","og_site_name":"The Couchbase Blog","article_published_time":"2020-10-20T06:43:40+00:00","article_modified_time":"2025-06-14T02:27:19+00:00","og_image":[{"width":1200,"height":627,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Couchbase-Views-and-better-alternatives-part-1-of-2.png","type":"image\/png"}],"author":"Nirvair Singh, Solutions Architect, Couchbase","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/10\/Couchbase-Views-and-better-alternatives-part-1-of-2.png","twitter_misc":{"Written by":"Nirvair Singh, Solutions Architect, Couchbase","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/"},"author":{"name":"Nirvair Singh, Solutions Architect, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/e45019e9f99fc655864989d50ccc792a"},"headline":"Couchbase Views and Better Alternatives [Part 1 of 2]","datePublished":"2020-10-20T06:43:40+00:00","dateModified":"2025-06-14T02:27:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/"},"wordCount":1217,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Indexing","Multi-Dimensional Scaling (MDS)","scaling","views"],"articleSection":["Couchbase Server","Indexing","Multi-Dimensional Scaling (MDS)","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/","url":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/","name":"Couchbase Views and Better Alternatives [Part 1 of 2] - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2020-10-20T06:43:40+00:00","dateModified":"2025-06-14T02:27:19+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-views-and-better-alternatives-part-1-of-2\/#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\/couchbase-views-and-better-alternatives-part-1-of-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Couchbase Views and Better Alternatives [Part 1 of 2]"}]},{"@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\/e45019e9f99fc655864989d50ccc792a","name":"Nirvair Singh, Solutions Architect, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/baa2c25e4ef21ceae5c4241217e2e13e","url":"https:\/\/secure.gravatar.com\/avatar\/fe50bfb547fe1a261248b5436e3afc4923283be031a5eb8557c939127793f2ce?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fe50bfb547fe1a261248b5436e3afc4923283be031a5eb8557c939127793f2ce?s=96&d=mm&r=g","caption":"Nirvair Singh, Solutions Architect, Couchbase"},"description":"Solutions ArchitectrnCenter of Excellence Team","url":"https:\/\/www.couchbase.com\/blog\/author\/nirvair-singh\/"}]}},"authors":[{"term_id":8923,"user_id":64938,"is_guest":0,"slug":"nirvair-singh","display_name":"Nirvair Singh, Solutions Architect, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/fe50bfb547fe1a261248b5436e3afc4923283be031a5eb8557c939127793f2ce?s=96&d=mm&r=g","author_category":"","last_name":"Singh","first_name":"Nirvair","job_title":"","user_url":"","description":"Solutions ArchitectrnCenter of Excellence Team"}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/9527","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\/64938"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=9527"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/9527\/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=9527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=9527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=9527"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=9527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}