{"id":5129,"date":"2018-05-15T04:20:15","date_gmt":"2018-05-15T11:20:15","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=5129"},"modified":"2025-06-13T22:40:29","modified_gmt":"2025-06-14T05:40:29","slug":"ordering-couchbase-functions-1","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/ordering-couchbase-functions-1\/","title":{"rendered":"Pedido no Couchbase Functions - Parte 1"},"content":{"rendered":"<p><span style=\"font-weight: 400\">O Couchbase Functions est\u00e1 sendo <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/pt\/eventing\/\"><span style=\"font-weight: 400\">apresentado<\/span><\/a><span style=\"font-weight: 400\"> na vers\u00e3o 5.5 do Couchbase Server sob o c\u00f3digo <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/products\/eventing\/\">Servi\u00e7o de eventos do Couchbase<\/a>. O Couchbase Functions permite que voc\u00ea aproxime a l\u00f3gica de neg\u00f3cios orientada por dados dos seus dados. A l\u00f3gica de neg\u00f3cios definida pelo usu\u00e1rio pode ser acionada em tempo real no servidor quando os dados s\u00e3o alterados como resultado das intera\u00e7\u00f5es que ocorrem nos aplicativos da Web e de borda.\u00a0<\/span><span style=\"font-weight: 400\">Quando a computa\u00e7\u00e3o reside mais perto dos dados, \u00e9 importante entender como a computa\u00e7\u00e3o se comporta quando os dados, que ela est\u00e1 ouvindo, mudam. Tentaremos entender como o Eventing Service reage \u00e0 ordena\u00e7\u00e3o das muta\u00e7\u00f5es.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium_large wp-image-5152\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/05\/eventing-fn-768x403.png\" alt=\"\" width=\"768\" height=\"403\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn-768x403.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn-300x158.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn-1024x538.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn-20x11.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn.png 1238w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Vamos come\u00e7ar e entender o comportamento com um exemplo simples. Vamos criar uma fun\u00e7\u00e3o de teste com o seguinte c\u00f3digo e assumir as configura\u00e7\u00f5es padr\u00e3o (ou seja, 3 trabalhadores) para a fun\u00e7\u00e3o.<\/span><\/p>\n<pre class=\"p1\">function OnUpdate(doc, meta) \r\n{ \r\n  log('Created Doc ID:', \u00a0meta.id); \r\n} \r\n\r\nfunction OnDelete(meta) \r\n{ \r\n  log('Deleted Doc ID:', \u00a0meta.id); \r\n}<\/pre>\n<p><span style=\"font-weight: 400\">Observa\u00e7\u00e3o: Escolha \"Tudo\" no limite de alimenta\u00e7\u00e3o em todas as opera\u00e7\u00f5es abaixo durante a implementa\u00e7\u00e3o da fun\u00e7\u00e3o.<\/span><\/p>\n<p><span style=\"font-weight: 400\">No Bucket de origem que essa fun\u00e7\u00e3o escuta, vamos inserir cerca de 10 documentos com IDs de documento num\u00e9ricos crescentes. No arquivo de log do aplicativo para essa fun\u00e7\u00e3o, voc\u00ea ver\u00e1 algo semelhante \u00e0s seguintes entradas. <\/span><\/p>\n<pre class=\"p1\">2018-05-13T11:36:05.163-04:00 [INFO] \"Created Doc ID:\" \"2\" \r\n2018-05-13T11:36:05.163-04:00 [INFO] \"Created Doc ID:\" \"3\" \r\n2018-05-13T11:36:05.163-04:00 [INFO] \"Created Doc ID:\" \"9\" \r\n2018-05-13T11:36:05.163-04:00 [INFO] \"Created Doc ID:\" \"8\" \r\n2018-05-13T11:36:05.164-04:00 [INFO] \"Created Doc ID:\" \"1\" \r\n2018-05-13T11:36:05.164-04:00 [INFO] \"Created Doc ID:\" \"0\" \r\n2018-05-13T11:36:05.165-04:00 [INFO] \"Created Doc ID:\" \"5\" \r\n2018-05-13T11:36:05.165-04:00 [INFO] \"Created Doc ID:\" \"4\" \r\n2018-05-13T11:36:05.165-04:00 [INFO] \"Created Doc ID:\" \"7\" \r\n2018-05-13T11:36:05.165-04:00 [INFO] \"Created Doc ID:\" \"6\"<\/pre>\n<p><span style=\"font-weight: 400\">\u00a0T<\/span><span style=\"font-weight: 400\">Tente cancelar a implanta\u00e7\u00e3o e implantar a fun\u00e7\u00e3o acima e observe que a ordem dos IDs(\/altera\u00e7\u00f5es) n\u00e3o \u00e9 a mesma. Voc\u00ea pode repetir essa etapa algumas vezes para refor\u00e7ar essa observa\u00e7\u00e3o.<\/span><\/p>\n<pre class=\"p1\">2018-05-13T11:59:17.504-04:00 [INFO] \"Created Doc ID:\" \"8\" \r\n2018-05-13T11:59:17.504-04:00 [INFO] \"Created Doc ID:\" \"9\" \r\n2018-05-13T11:59:17.504-04:00 [INFO] \"Created Doc ID:\" \"3\" \r\n2018-05-13T11:59:17.504-04:00 [INFO] \"Created Doc ID:\" \"2\" \r\n2018-05-13T11:59:17.505-04:00 [INFO] \"Created Doc ID:\" \"1\" \r\n2018-05-13T11:59:17.505-04:00 [INFO] \"Created Doc ID:\" \"0\" \r\n2018-05-13T11:59:17.507-04:00 [INFO] \"Created Doc ID:\" \"4\" \r\n2018-05-13T11:59:17.507-04:00 [INFO] \"Created Doc ID:\" \"7\" \r\n2018-05-13T11:59:17.507-04:00 [INFO] \"Created Doc ID:\" \"6\" \r\n2018-05-13T11:59:17.507-04:00 [INFO] \"Created Doc ID:\" \"5\"<\/pre>\n<p><b>Take-Away#1 : A fun\u00e7\u00e3o n\u00e3o processa os documentos na ordem em que foram inseridos.<\/b><\/p>\n<p><span style=\"font-weight: 400\">Agora, vamos excluir um dos documentos que foi inserido (em nosso exemplo, exclu\u00ed o DocId#2).  Observamos imediatamente a seguinte entrada no registro (que est\u00e1 correta):<\/span><\/p>\n<pre class=\"p1\">2018-05-13T11:43:10.165-04:00 [INFO] \"Deleted Doc ID:\" \"2\"<\/pre>\n<p><span style=\"font-weight: 400\">Agora, vamos cancelar a implementa\u00e7\u00e3o da fun\u00e7\u00e3o e implement\u00e1-la novamente. Observamos a seguinte ordem:<\/span><\/p>\n<pre class=\"p1\">2018-05-13T11:44:04.808-04:00 [INFO] \"Created Doc ID:\" \"8\" \r\n2018-05-13T11:44:04.808-04:00 [INFO] \"Deleted Doc ID:\" \"2\" \r\n2018-05-13T11:44:04.809-04:00 [INFO] \"Created Doc ID:\" \"1\" \r\n2018-05-13T11:44:04.809-04:00 [INFO] \"Created Doc ID:\" \"0\" \r\n2018-05-13T11:44:04.809-04:00 [INFO] \"Created Doc ID:\" \"3\" \r\n2018-05-13T11:44:04.809-04:00 [INFO] \"Created Doc ID:\" \"9\" \r\n2018-05-13T11:44:04.810-04:00 [INFO] \"Created Doc ID:\" \"4\" \r\n2018-05-13T11:44:04.810-04:00 [INFO] \"Created Doc ID:\" \"7\" \r\n2018-05-13T11:44:04.810-04:00 [INFO] \"Created Doc ID:\" \"6\" \r\n2018-05-13T11:44:04.810-04:00 [INFO] \"Created Doc ID:\" \"5\"<\/pre>\n<p><span style=\"font-weight: 400\">Observamos isso:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400\">\"Created Doc ID:\" \"2\" est\u00e1 faltando<\/span><\/li>\n<li><span style=\"font-weight: 400\">\"Deleted Doc ID:\" \"2\" aparece antes na ordem de processamento e n\u00e3o depois.<\/span><\/li>\n<\/ul>\n<p><b>Take-Away#2 : Desduplica\u00e7\u00e3o<\/b><\/p>\n<p><span style=\"font-weight: 400\">Opera\u00e7\u00f5es sucessivas (\/altera\u00e7\u00f5es\/muta\u00e7\u00f5es) em um documento s\u00e3o agrupadas (dedup'ed), quando ocorrem em r\u00e1pida sucess\u00e3o, pelo Couchbase Server, de modo que a sobrecarga no disco e na mem\u00f3ria seja minimizada. O Couchbase Server envia somente a vers\u00e3o mais recente de um documento no fluxo DCP.<\/span><\/p>\n<p><span style=\"font-weight: 400\">No exemplo acima, esse \u00e9 o motivo pelo qual o manipulador OnUpdate n\u00e3o \u00e9 acionado, pois a exclus\u00e3o do DocID foi a mais recente na sequ\u00eancia de opera\u00e7\u00f5es no documento; ou seja, quando UPDATE e DELETE acontecem em ordem, eles s\u00e3o agrupados para DELETE, que acontece mais tarde na linha do tempo. Ou seja, quando v\u00e1rias atualiza\u00e7\u00f5es (ou at\u00e9 mesmo uma \u00fanica atualiza\u00e7\u00e3o) em um documento s\u00e3o seguidas pela exclus\u00e3o do documento, apenas o evento Delete \u00e9 visto pelo Couchbase Functions, pois as atualiza\u00e7\u00f5es s\u00e3o agrupadas no evento final, que \u00e9 a exclus\u00e3o do documento.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Um comportamento semelhante ser\u00e1 observado se um documento passar por v\u00e1rias atualiza\u00e7\u00f5es em uma pequena janela e, em seguida, uma fun\u00e7\u00e3o consumir as altera\u00e7\u00f5es; somente a \u00faltima altera\u00e7\u00e3o ocorrida no documento ser\u00e1 vista e as altera\u00e7\u00f5es intermedi\u00e1rias ser\u00e3o perdidas. Esse \u00e9 o caso apenas quando uma nova fun\u00e7\u00e3o \u00e9 implantada em um bucket existente com muitas altera\u00e7\u00f5es ocorrendo em um bucket. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Se a fun\u00e7\u00e3o for implantada e ocorrerem altera\u00e7\u00f5es em um documento, cada altera\u00e7\u00e3o ser\u00e1 tratada pela fun\u00e7\u00e3o. Por\u00e9m, se o n\u00famero de altera\u00e7\u00f5es ocorridas em um documento for muito alto em um pequeno intervalo de tempo, o Couchbase Server ainda far\u00e1 uma certa quantidade de desduplica\u00e7\u00e3o, e isso pode fazer com que nem todas as altera\u00e7\u00f5es acionem a fun\u00e7\u00e3o.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Ou seja, se 10 documentos foram inseridos e um deles foi exclu\u00eddo, ent\u00e3o, quando uma fun\u00e7\u00e3o \u00e9 implementada, n\u00e3o \u00e9 garantido que a opera\u00e7\u00e3o de exclus\u00e3o (no documento inserido e depois no exclu\u00eddo) ser\u00e1 vista no final pela fun\u00e7\u00e3o.<\/span><\/p>\n<p><b>Take-Away#3 : A fun\u00e7\u00e3o n\u00e3o processa as muta\u00e7\u00f5es na ordem em que foram feitas. <\/b><\/p>\n<p><span style=\"font-weight: 400\">Ent\u00e3o, o que est\u00e1 acontecendo aqui? Em <a href=\"https:\/\/www.couchbase.com\/blog\/pt\/ordering-couchbase-functions-2\/\">Parte 2<\/a> Nesta s\u00e9rie do blog, vamos nos aprofundar nos bastidores do Eventing Service do Couchbase e entender como os Eventing Workers processam as muta\u00e7\u00f5es.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Couchbase Functions is being introduced in the Couchbase Server 5.5 release under the Couchbase Eventing Service. Couchbase Functions gives you the ability to move data-driven business logic closer to your data. User-defined business logic can be triggered in real-time on [&hellip;]<\/p>","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":[1821,1816,2273],"tags":[2226,2133],"ppma_author":[9055],"class_list":["post-5129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-architecture","category-couchbase-server","category-eventing","tag-couchbase-functions","tag-functions"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ordering in Couchbase Functions - Part 1 - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"When compute resides closer to data, it is important to understand how compute behaves when the data, that it is listening to, changes.\u00a0\u00a0Let\u2019s understand Ordering in Couchbase Functions.\" \/>\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\/pt\/ordering-couchbase-functions-1\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ordering in Couchbase Functions - Part 1\" \/>\n<meta property=\"og:description\" content=\"When compute resides closer to data, it is important to understand how compute behaves when the data, that it is listening to, changes.\u00a0\u00a0Let\u2019s understand Ordering in Couchbase Functions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/ordering-couchbase-functions-1\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-15T11:20:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T05:40:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1238\" \/>\n\t<meta property=\"og:image:height\" content=\"650\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/\"},\"author\":{\"name\":\"Venkat Subramanian, Product Manager\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/0756e2347c2166a32f93f9a7e07e9f90\"},\"headline\":\"Ordering in Couchbase Functions &#8211; Part 1\",\"datePublished\":\"2018-05-15T11:20:15+00:00\",\"dateModified\":\"2025-06-14T05:40:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/\"},\"wordCount\":658,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Couchbase Functions\",\"functions\"],\"articleSection\":[\"Couchbase Architecture\",\"Couchbase Server\",\"Eventing\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/\",\"name\":\"Ordering in Couchbase Functions - Part 1 - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2018-05-15T11:20:15+00:00\",\"dateModified\":\"2025-06-14T05:40:29+00:00\",\"description\":\"When compute resides closer to data, it is important to understand how compute behaves when the data, that it is listening to, changes.\u00a0\u00a0Let\u2019s understand Ordering in Couchbase Functions.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-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\/ordering-couchbase-functions-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ordering in Couchbase Functions &#8211; 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\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@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\":\"pt-BR\",\"@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\/pt\/author\/venkatcouchbase-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ordering in Couchbase Functions - Part 1 - The Couchbase Blog","description":"Quando a computa\u00e7\u00e3o reside mais perto dos dados, \u00e9 importante entender como a computa\u00e7\u00e3o se comporta quando os dados, que ela est\u00e1 ouvindo, mudam.  Vamos entender a ordena\u00e7\u00e3o no Couchbase Functions.","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\/pt\/ordering-couchbase-functions-1\/","og_locale":"pt_BR","og_type":"article","og_title":"Ordering in Couchbase Functions - Part 1","og_description":"When compute resides closer to data, it is important to understand how compute behaves when the data, that it is listening to, changes.\u00a0\u00a0Let\u2019s understand Ordering in Couchbase Functions.","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/ordering-couchbase-functions-1\/","og_site_name":"The Couchbase Blog","article_published_time":"2018-05-15T11:20:15+00:00","article_modified_time":"2025-06-14T05:40:29+00:00","og_image":[{"width":1238,"height":650,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2018\/05\/eventing-fn.png","type":"image\/png"}],"author":"Venkat Subramanian, Product Manager","twitter_card":"summary_large_image","twitter_creator":"@venkasub","twitter_misc":{"Written by":"Venkat Subramanian, Product Manager","Est. reading time":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/"},"author":{"name":"Venkat Subramanian, Product Manager","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/0756e2347c2166a32f93f9a7e07e9f90"},"headline":"Ordering in Couchbase Functions &#8211; Part 1","datePublished":"2018-05-15T11:20:15+00:00","dateModified":"2025-06-14T05:40:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/"},"wordCount":658,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Couchbase Functions","functions"],"articleSection":["Couchbase Architecture","Couchbase Server","Eventing"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/","url":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/","name":"Ordering in Couchbase Functions - Part 1 - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2018-05-15T11:20:15+00:00","dateModified":"2025-06-14T05:40:29+00:00","description":"Quando a computa\u00e7\u00e3o reside mais perto dos dados, \u00e9 importante entender como a computa\u00e7\u00e3o se comporta quando os dados, que ela est\u00e1 ouvindo, mudam.  Vamos entender a ordena\u00e7\u00e3o no Couchbase Functions.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-1\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/ordering-couchbase-functions-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\/ordering-couchbase-functions-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ordering in Couchbase Functions &#8211; Part 1"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","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":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@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, gerente de produtos","image":{"@type":"ImageObject","inLanguage":"pt-BR","@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 trabalha com desenvolvimento e gerenciamento de produtos e vem desenvolvendo plataformas e produtos de dados\/an\u00e1lise. Uma parte significativa de sua experi\u00eancia foi na Oracle, onde passou de engenheiro da equipe de Enterprise Manager da Oracle a gerente de produtos do conjunto de produtos de BI\/Analytics da Oracle. No passado, ele trabalhou em startups, ajudando a desenvolver produtos de aprendizado de m\u00e1quina\/NLP e sistemas de decis\u00e3o distribu\u00eddos. Ele est\u00e1 sempre por perto em @venkasub.","sameAs":["https:\/\/x.com\/venkasub"],"url":"https:\/\/www.couchbase.com\/blog\/pt\/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 trabalha com desenvolvimento e gerenciamento de produtos e vem desenvolvendo plataformas e produtos de dados\/an\u00e1lise. Uma parte significativa de sua experi\u00eancia foi na Oracle, onde passou de engenheiro da equipe de Enterprise Manager da Oracle a gerente de produtos do conjunto de produtos de BI\/Analytics da Oracle. No passado, ele trabalhou em startups, ajudando a desenvolver produtos de aprendizado de m\u00e1quina\/NLP e sistemas de decis\u00e3o distribu\u00eddos. Ele est\u00e1 sempre por perto em @venkasub."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/5129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/3013"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=5129"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/5129\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=5129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=5129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=5129"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=5129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}