{"id":3938,"date":"2017-08-19T09:26:21","date_gmt":"2017-08-19T16:26:21","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=3938"},"modified":"2025-06-13T19:28:47","modified_gmt":"2025-06-14T02:28:47","slug":"transition-index-replicas","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/","title":{"rendered":"How to transition from Equivalent Indexes to Index Replicas?"},"content":{"rendered":"<p><span style=\"font-weight: 400\">In the <a href=\"https:\/\/www.couchbase.com\/blog\/couchbase-index-replicas\/\">previous post<\/a>, we saw the benefits of using index replicas over equivalent indexes. \u00a0Let\u2019s say you are on Couchbase Server 4.x and have the following 3 equivalent indexes spread across 3 nodes; and with Couchbase 5.0 Beta available, you want to migrate these equivalent indexes to Index Replicas.<\/span><\/p>\n<pre class=\"\">\/\/old 4.x equivalent indexes\r\ncreate index eq_index1 on bucket(field1); \r\n\r\ncreate index eq_index2 on bucket(field1); \r\n\r\ncreate index eq_index3 on bucket(field1);<\/pre>\n<p><span style=\"font-weight: 400\">Note: If you want to use the same nodes to create the replicas, do make sure that they have the required memory and compute resources for the both the index replicas and equivalent indexes to coexist. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Step 1: Fire the following query with the num_replica parameter being 2, as we earlier had 3 copies of the index and want to maintain the same topology of indexes.<\/span><\/p>\n<pre class=\"\">create index eq_index on bucket(field1) with {\u201cnum_replica\u201d:2}<\/pre>\n<p><span style=\"font-weight: 400\">If you are bringing in a new set of 3 index nodes, then you might as well specify the \u2018create index\u2019 statement with the \u2018nodes\u2019 parameter set; for example:<\/span><\/p>\n<pre class=\"\">create index eq_index on bucket(field1) with {\u201cnodes\u201d\u00a0[\u201c10.10.10.1:9001\", \"10.10.10.2:9002\", \"10.10.10.3:9003\u201d]}<\/pre>\n<p><span style=\"font-weight: 400\">Step 2: Once Step1 completes and all the index replicas are created and online(i.e, index build completed), drop the old 4.x equivalent indexes present. <\/span><\/p>\n<pre class=\"\">drop index eq_index1; \r\ndrop index eq_index2; \r\ndrop index eq_index3;<\/pre>\n<p><span style=\"font-weight: 400\">Voila!! Your N1QL queries are all set to use the index replicas, and there was no application downtime during the process as well. If you had used \u2018USE INDEX\u2019 directive in your N1QL query, then the same needs to be updated with the new index name.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Equivalent indexes are still supported in Couchbase Server 5.0 and a mix of equivalent and replica indexes also works, i.e., \u00a0N1QL queries would load balance between equivalent and replica indexes; but for efficient manageability, index replicas are recommended over equivalent indexes.<\/span><\/p>\n<p><span style=\"font-weight: 400\">If you haven\u2019t already, <a href=\"https:\/\/www.couchbase.com\/downloads\/\">click here<\/a> to download Couchbase Server 5.0 and play around with Index Replicas.\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous post, we saw the benefits of using index replicas over equivalent indexes. \u00a0Let\u2019s say you are on Couchbase Server 4.x and have the following 3 equivalent indexes spread across 3 nodes; and with Couchbase 5.0 Beta available, [&hellip;]<\/p>\n","protected":false},"author":3013,"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,1812],"tags":[1695,1505,1626,1696,1641],"ppma_author":[9055],"class_list":["post-3938","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-n1ql-query","tag-gsi","tag-index","tag-index-managment","tag-indexing","tag-secondary-indexing"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to transition from Equivalent Indexes to Index Replicas?<\/title>\n<meta name=\"description\" content=\"Moving to Index Replicas from Equivalent Indexes is easy and leads to an efficient system and also makes index manageability a breeze.\" \/>\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\/transition-index-replicas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to transition from Equivalent Indexes to Index Replicas?\" \/>\n<meta property=\"og:description\" content=\"Moving to Index Replicas from Equivalent Indexes is easy and leads to an efficient system and also makes index manageability a breeze.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-19T16:26:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:28:47+00:00\" \/>\n<meta name=\"author\" content=\"Venkat Subramanian, Product Manager\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@venkasub\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Venkat Subramanian, Product Manager\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/\"},\"author\":{\"name\":\"Venkat Subramanian, Product Manager\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/0756e2347c2166a32f93f9a7e07e9f90\"},\"headline\":\"How to transition from Equivalent Indexes to Index Replicas?\",\"datePublished\":\"2017-08-19T16:26:21+00:00\",\"dateModified\":\"2025-06-14T02:28:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/\"},\"wordCount\":281,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"GSI\",\"Index\",\"index managment\",\"Indexing\",\"Secondary Indexing\"],\"articleSection\":[\"Couchbase Server\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/\",\"name\":\"How to transition from Equivalent Indexes to Index Replicas?\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-08-19T16:26:21+00:00\",\"dateModified\":\"2025-06-14T02:28:47+00:00\",\"description\":\"Moving to Index Replicas from Equivalent Indexes is easy and leads to an efficient system and also makes index manageability a breeze.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#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\/transition-index-replicas\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to transition from Equivalent Indexes to Index Replicas?\"}]},{\"@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\/0756e2347c2166a32f93f9a7e07e9f90\",\"name\":\"Venkat Subramanian, Product Manager\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8f9acdf95e167a15007b71867fe87a9a\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/53cfc83eb606325239f7058417a02969ab8ff0106a374bcdcf5d78f9b749cccd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/53cfc83eb606325239f7058417a02969ab8ff0106a374bcdcf5d78f9b749cccd?s=96&d=mm&r=g\",\"caption\":\"Venkat Subramanian, Product Manager\"},\"description\":\"Venkat dabbles in product development and product management and has been developing data\/analytics platforms &amp; products. Significant chunk of his experience has been with Oracle, where he transitioned from being an Engineer in Oracle\u2019s Enterprise Manager team to Product Manager for Oracle's BI\/Analytics suite of products. He has worked in startups in the past helping develop machine-learning\/NLP products and distributed decisioning systems. He lurks around at @venkasub.\",\"sameAs\":[\"https:\/\/x.com\/venkasub\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/venkatcouchbase-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to transition from Equivalent Indexes to Index Replicas?","description":"Moving to Index Replicas from Equivalent Indexes is easy and leads to an efficient system and also makes index manageability a breeze.","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\/transition-index-replicas\/","og_locale":"en_US","og_type":"article","og_title":"How to transition from Equivalent Indexes to Index Replicas?","og_description":"Moving to Index Replicas from Equivalent Indexes is easy and leads to an efficient system and also makes index manageability a breeze.","og_url":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-08-19T16:26:21+00:00","article_modified_time":"2025-06-14T02:28:47+00:00","author":"Venkat Subramanian, Product Manager","twitter_card":"summary_large_image","twitter_creator":"@venkasub","twitter_misc":{"Written by":"Venkat Subramanian, Product Manager","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/"},"author":{"name":"Venkat Subramanian, Product Manager","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/0756e2347c2166a32f93f9a7e07e9f90"},"headline":"How to transition from Equivalent Indexes to Index Replicas?","datePublished":"2017-08-19T16:26:21+00:00","dateModified":"2025-06-14T02:28:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/"},"wordCount":281,"commentCount":2,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["GSI","Index","index managment","Indexing","Secondary Indexing"],"articleSection":["Couchbase Server","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/","url":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/","name":"How to transition from Equivalent Indexes to Index Replicas?","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-08-19T16:26:21+00:00","dateModified":"2025-06-14T02:28:47+00:00","description":"Moving to Index Replicas from Equivalent Indexes is easy and leads to an efficient system and also makes index manageability a breeze.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/transition-index-replicas\/#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\/transition-index-replicas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to transition from Equivalent Indexes to Index Replicas?"}]},{"@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\/0756e2347c2166a32f93f9a7e07e9f90","name":"Venkat Subramanian, Product Manager","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8f9acdf95e167a15007b71867fe87a9a","url":"https:\/\/secure.gravatar.com\/avatar\/53cfc83eb606325239f7058417a02969ab8ff0106a374bcdcf5d78f9b749cccd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/53cfc83eb606325239f7058417a02969ab8ff0106a374bcdcf5d78f9b749cccd?s=96&d=mm&r=g","caption":"Venkat Subramanian, Product Manager"},"description":"Venkat dabbles in product development and product management and has been developing data\/analytics platforms &amp; products. Significant chunk of his experience has been with Oracle, where he transitioned from being an Engineer in Oracle\u2019s Enterprise Manager team to Product Manager for Oracle's BI\/Analytics suite of products. He has worked in startups in the past helping develop machine-learning\/NLP products and distributed decisioning systems. He lurks around at @venkasub.","sameAs":["https:\/\/x.com\/venkasub"],"url":"https:\/\/www.couchbase.com\/blog\/author\/venkatcouchbase-com\/"}]}},"authors":[{"term_id":9055,"user_id":3013,"is_guest":0,"slug":"venkatcouchbase-com","display_name":"Venkat Subramanian, Product Manager","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/53cfc83eb606325239f7058417a02969ab8ff0106a374bcdcf5d78f9b749cccd?s=96&d=mm&r=g","author_category":"","last_name":"Subramanian, Product Manager","first_name":"Venkat","job_title":"","user_url":"","description":"Venkat dabbles in product development and product management and has been developing data\/analytics platforms &amp; products. Significant chunk of his experience has been with Oracle, where he transitioned from being an Engineer in Oracle\u2019s Enterprise Manager team to Product Manager for Oracle's BI\/Analytics suite of products. He has worked in startups in the past helping develop machine-learning\/NLP products and distributed decisioning systems. He lurks around at @venkasub."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3938","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\/3013"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=3938"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3938\/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=3938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=3938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=3938"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}