{"id":8743,"date":"2020-05-28T14:49:24","date_gmt":"2020-05-28T21:49:24","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=8743"},"modified":"2025-06-13T22:40:23","modified_gmt":"2025-06-14T05:40:23","slug":"couchbase-eventing-small-scripts-that-solve-big-problems-at-scale","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/","title":{"rendered":"Couchbase Eventing: Small Scripts That Solve Big Problems"},"content":{"rendered":"<h2>Eventing Simple Yet Powerful:<\/h2>\n<p><a href=\"https:\/\/www.couchbase.com\/products\/eventing\/\">Eventing<\/a> allows small scripts to overcome hard to solve problems.<\/p>\n<p><em>If you are familiar with both Couchbase and Eventing please feel free to skip the brief overview and skip\u00a0ahead to the <a href=\"#examples\">examples.<\/a><\/em><\/p>\n<h2>Overview:<\/h2>\n<p>First off, let&#8217;s look at the basic <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/eventing\/eventing-lifecycle.html\">Eventing Lifecycle<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-8739 size-large\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-1024x398.png\" alt=\"Eventing Life Cycle 6.5\" width=\"900\" height=\"350\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-1024x398.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-300x117.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-768x298.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-1536x597.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b-1320x513.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/cron_implementation_1_image_0_lifecycle_overview_notitle_b.png 1825w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>The steps below show how easy it is to write and use an Eventing Function<\/p>\n<ul>\n<li>Add (or import) an Eventing Function via Couchbase Server&#8217;s UI.<\/li>\n<li>Assign a data source, a scratchpad bucket, and some bindings to manipulate documents or communicate with the outside world.<\/li>\n<li>Implement some JavaScript code to process the received mutation.<\/li>\n<li>Save your new Function and hit &#8220;Deploy&#8221;<\/li>\n<\/ul>\n<p>That&#8217;s it you now have a distributed function responding to mutations in your data set in real-time across your entire cluster.<\/p>\n<p>The Eventing service provides an infrastructure-less platform that can scale your Eventing Functions as your business experiences growth whether a one-time spike or a monthly increase in data stores or clients served without concern for the fact that your JavaScript based Eventing functions are running in a robust reliable parallel distributed fashion.\u00a0 To learn more about Couchbase Eventing please refer to the <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/eventing\/eventing-overview.html\">Eventing Overview<\/a> in our documentation.<\/p>\n<p>The examples in this article below show that in some cases Eventing can act like a drop of oil to needed &#8220;free up&#8221; the moving parts of your applications.<\/p>\n<h2>Couchbase a database you build to order:<\/h2>\n<p>I like to think of a Couchbase cluster as a set of scalable interoperable &#8220;micro-services&#8221;. These services can be wired together and sized to meet a specific set of operational and business needs.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3884 size-large\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/07\/MDS-container-1-1024x405.png\" alt=\"\" width=\"900\" height=\"356\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/07\/MDS-container-1-1024x405.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/07\/MDS-container-1-300x119.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/07\/MDS-container-1-768x304.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/07\/MDS-container-1-20x8.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/07\/MDS-container-1-1320x522.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/07\/MDS-container-1.png 1330w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>Couchbase provides Multi-dimensional Scaling, or MDS, across six key services with minimal resource interference between them. Furthermore, each Couchbase service is independently scalable, via simply adding more nodes. This allows customers to create the ideal multi-node cluster at the possible lowest TCO for the task(s) at hand.<\/p>\n<ul>\n<li>The Data nodes easily scale to provide JSON aware KV operations at-scale for single and multi-record lookups is extremely fast.\u00a0 Did I did just mention that &#8220;<em><u>for single and multi-record lookups it is extremely fast<\/u><\/em>&#8220;, yes I didi, but I really want to stress this.<\/li>\n<li>The Query nodes easily scale to provide indexes and also N1QL, a SQL enhancement that works with natively with JSON documents, that allows programmers get up and running quickly without having to learn a new way of thinking.<\/li>\n<li>The Index nodes easily scale to provide flexible indexes to speed up some or all N1QL queries.<\/li>\n<li>The Search nodes easily scale to provide full text search for natural-language querying featuring: language-aware searching, scoring of results, and fast FTS based indexes,<\/li>\n<li>The Analytics node easily scales to parallel data management capability to efficiently run complex queries: large ad hoc join, set, aggregation, and grouping operations across large datasets.<\/li>\n<li>The Eventing service easily scale to provide a computing paradigm that developers can use to handle data changes (or mutations) and react to them in real-time.<\/li>\n<\/ul>\n<p>Like all product lines the newer services in Couchbase Query, Search, and Eventing, and Analytics have a few warts but taken as a whole the complete basket provides a unified suite, or a one-stop shop to solve a myriad of problems. \u00a0I mean seriously if you don&#8217;t care about a unified product and all you are going to do is use FTS you might just consider using Elasticsearch but once you need to integrate your FTS results with N1QL (SQL for JSON) you might have been much better off just starting with Couchbase.<\/p>\n<p>Today we are going to utilize just two services 1) the primary KV service provided by Data nodes 2) the Eventing Service.\u00a0 I will highlight through a few tiny JavaScript functions how you can overcome some hard at-scale problems by leveraging the Eventing Service.<\/p>\n<h2>Prerequisites \/ Learning about Eventing:<\/h2>\n<p>In this article we will be using the latest GA version, i.e. Couchbase version 6.5.1<\/p>\n<p>However, if you are not familiar with Couchbase or the Eventing service please walk through GET STARTED and one Eventing example specifically refer to the following:<\/p>\n<ul>\n<li>Setup a working Couchbase 6.5.1 server as per the directions in <a href=\"https:\/\/docs.couchbase.com\/server\/current\/getting-started\/start-here.html\">Start Here!<\/a><\/li>\n<li id=\"examples\">Understand how to deploy a basic Eventing function as per the directions in the <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/eventing\/eventing-example-data-enrichment.html\">Data Enrichment<\/a> example specifically &#8220;Case 2&#8221; where we will only use one bucket the &#8216;source&#8217; bucket.<\/li>\n<\/ul>\n<h2>Enriching Data via Eventing:<\/h2>\n<h4>A typical customer problem<\/h4>\n<p>A live production system has stored billions of documents. A new business need has occurred where the existing data needs to be enriched.\u00a0 This requirement of additional data impacts the complete document set.\u00a0 The operational impact encompasses both old or historic data and also new or mutating data. The business needs to keep the production system running non-stop and continuously respond to new real-time data.<\/p>\n<p>Consider a somewhat contrived example application a GeoIP lookup service. This utility needs a dataset to enable looking up countries by IPV4 address ranges. The initial implementation stored records as follows:<\/p>\n<pre class=\"toolbar-overlay:false lang:js decode:true\">{\r\n  \"type\": \"ip_country_map\",\r\n  \"country\": \"RU\",\r\n  \"ip_start\": \"7.12.60.1\",\r\n  \"ip_end\": \"7.62.60.9\"\r\n}<\/pre>\n<p>Months or later new business requirements change. Engineering needed the JSON documents to be enriched with new fields.\u00a0 The requirement was to include the numeric representations of the two existing IPV4 address.<\/p>\n<div class=\"codeMirror-wrapper\">\n<pre class=\"toolbar-overlay:false lang:js decode:true\">{\r\n  \"type\": \"ip_country_map\",\r\n  \"country\": \"RU\",\r\n  \"ip_end\": \"7.62.60.9\",\r\n  \"ip_start\": \"7.12.60.1\",\r\n  \"ip_num_start\": 118242305,\r\n  \"ip_num_end\": 121519113\r\n}<\/pre>\n<\/div>\n<h4>Eventing to the rescue<\/h4>\n<p>A simple fourteen (14) line JavaScript (2 of which comments) Eventing Function can be written and deployed to solve the issue with minimal resources.<\/p>\n<div class=\"codeMirror-wrapper\">\n<pre class=\"toolbar-overlay:false lang:js decode:true\">function OnUpdate(doc, meta) {\r\n  if (doc.type !== \"ip_country_map\" ) return;\r\n  doc[\"ip_num_start\"] = get_numip_first_3_octets(doc[\"ip_start\"]);\r\n  doc[\"ip_num_end\"]   = get_numip_first_3_octets(doc[\"ip_end\"]);\r\n  \/\/ src is a bucket alias to the source bucket in settings, write back to it\r\n  src[meta.id]=doc;\r\n}\r\nfunction get_numip_first_3_octets(ip) {\r\n  if (!ip) return 0;\r\n  var parts = ip.split('.');\r\n  \/\/ IP Number = A x (256*256*256) + B x (256*256) + C x 256 + D\r\n  return = (parts[0]*(256*256*256)) + (parts[1]*(256*256)) +\r\n               (parts[2]*256) + parseInt(parts[3]);\r\n}<\/pre>\n<\/div>\n<p>By deploying the above Function with a &#8220;Feed boundary&#8221; set to &#8220;Everything&#8221; all documents of type: &#8220;ip_country_map&#8221; are processed and enriched.<\/p>\n<p>The Eventing Function is left &#8220;deployed&#8221; reacting to all new inserts or updates (or mutations) in real-time enriching new items and also updating existing items on changes to &#8220;ip_start_num&#8221; or &#8220;ip_end_num&#8221; to the proper &#8220;numeric&#8221; representations.<\/p>\n<p>Because the documents are enriched (the old fields are still present) the existing production applications will still work.\u00a0 All new or changed data is updated in real-time to the new schema. \u00a0The GeoIP application components are decoupled via this simple Eventing Function such that they can be upgraded one at a time.<\/p>\n<p>When all production components have been updated the Eventing Function can be undeployed and decommissioned.<\/p>\n<h2>Purging Stale Data via Eventing:<\/h2>\n<h4>A typical customer problem<\/h4>\n<p>A live production system has stored over 7 billion of documents.\u00a0 All documents have an automatic expiration (or <a href=\"https:\/\/www.couchbase.com\/blog\/how-to-manage-ttl-with-couchbase-n1ql\/\">TTL<\/a> for time to live) set. The production environment constantly receives new data and constantly expires old data.<\/p>\n<p>An operational mistake was made resulting in 2 billion documents being created without an expiration.<\/p>\n<p>The customer didn&#8217;t have the resources (nor desired to pay for the resources) to create a large index to utilize N1QL to identify select and purge the data that lacked an active (non-zero TTL) when it was no longer useful.<\/p>\n<h4>Eventing to the rescue<\/h4>\n<p>A simple six (6) line JavaScript (2 of which are comments) Eventing Function was deployed and solve the issue with minimal resources.<\/p>\n<div class=\"codeMirror-wrapper\">\n<pre class=\"toolbar-overlay:false lang:js decode:true\">function OnUpdate(doc, meta) {\r\n    if (meta.expiration !== 0) return;\r\n    \/\/ delete all items that have TTL or expiration of 0\r\n    \/\/ src is a bucket alias to the source bucket in settings, delete from it.\r\n    delete src[meta.id];\r\n}<\/pre>\n<\/div>\n<p>By deploying the above Function with a &#8220;Feed boundary&#8221; set to &#8220;Everything&#8221; the entire document set in the source bucket was scanned. All documents with a non-zero TTL (meaning they had no expiration) were ignored.\u00a0 Only the matching documents with a TTL greater than zero are deleted.<\/p>\n<p>Once the source bucket was cleaned the Eventing Function was undeployed as it was used as an administrative tool.<\/p>\n<p>Note we could replace the expiration !== 0 test in our JavaScript to filter out data for any needed purpose.<\/p>\n<p>Pretty easy to guess what we are doing below:<\/p>\n<pre class=\"toolbar-overlay:false lang:js decode:true\">function OnUpdate(doc, meta) {\r\n    if (!(doc.type === \"customer\"&amp;&amp; doc.active === false)) return \r\n    \/\/ archive the customer to the bucket aias arc and remove from the bucket alias src\r\n    arc[meta.id] = doc;\r\n    delete src[meta.id];\r\n}<\/pre>\n<p>In fact, we could easily update the above to perform a cascade archive and delete not only of the customer but of any other related information such as orders, returns and shipping addresses. Refer to the example <a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/eventing\/eventing-examples-cascade-delete.html\">Cascade Delete<\/a> in the Eventing Documentation.<\/p>\n<h2>Stripping sensitive data via Eventing:<\/h2>\n<h4>A typical customer problem<\/h4>\n<p>A company running Couchbase on-premises in production was needed to share customer profile information (150M and growing).\u00a0 Their business partner is also running Couchbase but in a cloud provider, AWS.<\/p>\n<p>Given a typical profile record like the following:<\/p>\n<div class=\"codeMirror-wrapper\">\n<pre class=\"toolbar-overlay:false lang:js decode:true\">{\r\n  \"type\": \"master_profile\",\r\n  \"first_name\": \"Peter\",\r\n  \"last_name\": \"Chang\",\r\n  \"id\": 80927079070,\r\n  \"basic_profile\": {\r\n    \"partner_id\": 80980221,\r\n    \"services\": [\r\n      {\r\n        \"music\": true\r\n      },\r\n      {\r\n        \"radio\": true\r\n      },\r\n      {\r\n        \"video\": false\r\n      }\r\n    ]\r\n  },\r\n  \"sensitive_profile\": {\r\n    \"ssn\": \"111-11-1111\",\r\n    \"credit_card\": {\r\n      \"number\": \"3333-333-3333-3333\",\r\n      \"expires\": \"01\/09\",\r\n      \"ccv\": \"111\"\r\n    }\r\n  },\r\n  \"address\": {\r\n    \"home\": {\r\n      \"street\": \"4032 Kenwood Drive\",\r\n      \"city\": \"Boston\",\r\n      \"zip\": \"02102\"\r\n    },\r\n    \"billing\": {\r\n      \"street\": \"541 Bronx Street\",\r\n      \"city\": \"Boston\",\r\n      \"zip\": \"02102\"\r\n    }\r\n  },\r\n  \"phone\": {\r\n    \"home\": \"800-555-9201\",\r\n    \"work\": \"877-123-8811\",\r\n    \"cell\": \"878-234-8171\"\r\n  },\r\n  \"locale\": \"en_US\",\r\n  \"timezone\": -7,\r\n  \"gender\": \"M\"\r\n}<\/pre>\n<p>They couldn&#8217;t just share the entire profile since it contained sensitive data on user preferences and payment methods. \u00a0They only needed to share a limited subset like the following:<\/p>\n<\/div>\n<div class=\"codeMirror-wrapper\">\n<pre class=\"toolbar-overlay:false lang:js decode:true\">{\r\n  \"type\": \"shared_profile\",\r\n  \"first_name\": \"Peter\",\r\n  \"id\": 80927079070,\r\n  \"basic_profile\": {\r\n    \"partner_id\": 80980221,\r\n    \"services\": [\r\n      {\r\n        \"music\": true\r\n      },\r\n      {\r\n        \"radio\": true\r\n      },\r\n      {\r\n        \"video\": false\r\n      }\r\n    ]\r\n  },\r\n  \"timezone\": -7\r\n}<\/pre>\n<\/div>\n<p>The customer wanted to replace middle-wear SPARK solution required hours on failure to initialize and only provided slow batch process (hours to reflect updates) and sync up the profile information in real-time.<\/p>\n<h4>Eventing to the rescue<\/h4>\n<p>A simple nine (9) line JavaScript (3 of which are comments) Eventing Function was deployed and solve the issue with minimal resources.<\/p>\n<div class=\"codeMirror-wrapper\">\n<pre class=\"toolbar-overlay:false lang:js decode:true\">function OnUpdate(doc, meta) {\r\n    \/\/ only process our profile documents\r\n    if (doc.type !== \"master_profile\") return;\r\n    \/\/ aws_bkt is a bucket alias to the target bucket to replicate to AWS via \r\n    \/\/ XCDR. Write the minimal (non-sensitive) profile doc to the bucket for AWS.\r\n    aws_bkt[\"shared_profile::\"+doc.id] = \r\n        { \"type\": \"shared_profile\", \"first_name\": doc.first_name, \"id\": doc.id, \r\n          \"basic_profile\": doc.basic_profile, \"timezone\": doc.timezone };\r\n}<\/pre>\n<\/div>\n<p>By deploying the above Function with a &#8220;Feed boundary&#8221; set to &#8220;Everything&#8221; the entire document set in the source bucket was scanned and all documents of type: &#8220;master_profile&#8221; were processed and only a sub-document from each profile without the sensitive information was copied to the shared destination bucket.<\/p>\n<p>The Eventing Function is always left deployed reacting to all user profile changes (or mutations) in real-time and forwarding each and every mutation to the AWS destination bucket.<\/p>\n<p>In this use case a final bucket to bucket synchronization is performed via the Couchbase <a href=\"https:\/\/docs.couchbase.com\/server\/current\/learn\/clusters-and-availability\/xdcr-overview.html\">XCDR<\/a> feature at no time does the sensitive data leave the on-premises cluster and it is never transmitted to AWS.<\/p>\n<h3>Resources<\/h3>\n<ul>\n<li><em>Download:\u00a0<\/em><a href=\"https:\/\/couchbase.com\/downloads?family=server&amp;product=couchbase-server-developer\">Download Couchbase Server 6.5.1<\/a><\/li>\n<\/ul>\n<h3>References<\/h3>\n<ul>\n<li>Couchbase Eventing documentation:<br \/>\n<a href=\"https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-overview.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-overview.html<\/a><\/li>\n<li>Couchbase Server 6.5 What\u2019s New:<br \/>\n<a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/introduction\/whats-new.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.couchbase.com\/server\/6.5\/introduction\/whats-new.html<\/a><\/li>\n<li>Couchbase blogs on Eventing:<br \/>\n<a href=\"https:\/\/www.couchbase.com\/blog\/tag\/eventing\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.couchbase.com\/blog\/tag\/eventing\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Eventing Simple Yet Powerful: Eventing allows small scripts to overcome hard to solve problems. If you are familiar with both Couchbase and Eventing please feel free to skip the brief overview and skip\u00a0ahead to the examples. Overview: First off, let&#8217;s [&hellip;]<\/p>\n","protected":false},"author":42711,"featured_media":8745,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,1815,1821,1816,2273,9411],"tags":[1445,9271,2046],"ppma_author":[9113],"class_list":["post-8743","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-best-practices-and-tutorials","category-couchbase-architecture","category-couchbase-server","category-eventing","category-multi-dimensional-scaling","tag-mds","tag-multi-dimensional-scaling","tag-mutation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Couchbase Eventing: Small Scripts That Solve Big Problems - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"With simple functions come great power. Couchbase Eventing is must have tool in your big data arsenal allowing small scripts to overcome hard to solve problems.\" \/>\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-eventing-small-scripts-that-solve-big-problems-at-scale\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase Eventing: Small Scripts That Solve Big Problems\" \/>\n<meta property=\"og:description\" content=\"With simple functions come great power. Couchbase Eventing is must have tool in your big data arsenal allowing small scripts to overcome hard to solve problems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-28T21:49:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T05:40:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"897\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jon Strabala, Principal Product Manager, 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=\"Jon Strabala, Principal Product Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 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-eventing-small-scripts-that-solve-big-problems-at-scale\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/\"},\"author\":{\"name\":\"Jon Strabala, Principal Product Manager, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c991579f88217edee79ffedb6fc914cc\"},\"headline\":\"Couchbase Eventing: Small Scripts That Solve Big Problems\",\"datePublished\":\"2020-05-28T21:49:24+00:00\",\"dateModified\":\"2025-06-14T05:40:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/\"},\"wordCount\":1564,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg\",\"keywords\":[\"MDS\",\"Multi-Dimensional Scaling (MDS)\",\"mutation\"],\"articleSection\":[\"Application Design\",\"Best Practices and Tutorials\",\"Couchbase Architecture\",\"Couchbase Server\",\"Eventing\",\"Multi-Dimensional Scaling (MDS)\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/\",\"name\":\"Couchbase Eventing: Small Scripts That Solve Big Problems - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg\",\"datePublished\":\"2020-05-28T21:49:24+00:00\",\"dateModified\":\"2025-06-14T05:40:23+00:00\",\"description\":\"With simple functions come great power. Couchbase Eventing is must have tool in your big data arsenal allowing small scripts to overcome hard to solve problems.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg\",\"width\":2560,\"height\":897,\"caption\":\"Eventing small scripts\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase Eventing: Small Scripts That Solve Big Problems\"}]},{\"@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\/c991579f88217edee79ffedb6fc914cc\",\"name\":\"Jon Strabala, Principal Product Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9c6045b0c2f7b07b0ee10f94ad748a25\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/db52a9f6d84faba430dd38106cdbc16ff02c2066b103b5f6b4cfcde40e83c683?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/db52a9f6d84faba430dd38106cdbc16ff02c2066b103b5f6b4cfcde40e83c683?s=96&d=mm&r=g\",\"caption\":\"Jon Strabala, Principal Product Manager, Couchbase\"},\"description\":\"Jon Strabala is a Principal Product Manager, responsible for the Couchbase Eventing Service. Before joining Couchbase, he spent more than 20 years building software products across various domains, starting with EDA in aerospace then transitioning to building enterprise software focused on what today is coined \u201cIoT\u201d and \u201cat-scale data.\u201d Jon worked for several small software consultancies until eventually starting and managing his own firm. He has extensive experience in NoSQL\/NewSQL, both in contributing and commercializing new technologies such as compressed bitmaps and column stores. Jon holds a bachelor\u2019s degree in electrical engineering and a master's in computer engineering, both from the University of Southern California, and an MBA from the University of California at Irvine.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/jon-strabala\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Couchbase Eventing: Small Scripts That Solve Big Problems - The Couchbase Blog","description":"With simple functions come great power. Couchbase Eventing is must have tool in your big data arsenal allowing small scripts to overcome hard to solve problems.","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-eventing-small-scripts-that-solve-big-problems-at-scale\/","og_locale":"en_US","og_type":"article","og_title":"Couchbase Eventing: Small Scripts That Solve Big Problems","og_description":"With simple functions come great power. Couchbase Eventing is must have tool in your big data arsenal allowing small scripts to overcome hard to solve problems.","og_url":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/","og_site_name":"The Couchbase Blog","article_published_time":"2020-05-28T21:49:24+00:00","article_modified_time":"2025-06-14T05:40:23+00:00","og_image":[{"width":2560,"height":897,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg","type":"image\/jpeg"}],"author":"Jon Strabala, Principal Product Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jon Strabala, Principal Product Manager, Couchbase","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/"},"author":{"name":"Jon Strabala, Principal Product Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c991579f88217edee79ffedb6fc914cc"},"headline":"Couchbase Eventing: Small Scripts That Solve Big Problems","datePublished":"2020-05-28T21:49:24+00:00","dateModified":"2025-06-14T05:40:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/"},"wordCount":1564,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg","keywords":["MDS","Multi-Dimensional Scaling (MDS)","mutation"],"articleSection":["Application Design","Best Practices and Tutorials","Couchbase Architecture","Couchbase Server","Eventing","Multi-Dimensional Scaling (MDS)"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/","url":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/","name":"Couchbase Eventing: Small Scripts That Solve Big Problems - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg","datePublished":"2020-05-28T21:49:24+00:00","dateModified":"2025-06-14T05:40:23+00:00","description":"With simple functions come great power. Couchbase Eventing is must have tool in your big data arsenal allowing small scripts to overcome hard to solve problems.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2020\/05\/eventing_water_drop_impact_on_a_water-surface_detail-scaled.jpg","width":2560,"height":897,"caption":"Eventing small scripts"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/couchbase-eventing-small-scripts-that-solve-big-problems-at-scale\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Couchbase Eventing: Small Scripts That Solve Big Problems"}]},{"@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\/c991579f88217edee79ffedb6fc914cc","name":"Jon Strabala, Principal Product Manager, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/9c6045b0c2f7b07b0ee10f94ad748a25","url":"https:\/\/secure.gravatar.com\/avatar\/db52a9f6d84faba430dd38106cdbc16ff02c2066b103b5f6b4cfcde40e83c683?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/db52a9f6d84faba430dd38106cdbc16ff02c2066b103b5f6b4cfcde40e83c683?s=96&d=mm&r=g","caption":"Jon Strabala, Principal Product Manager, Couchbase"},"description":"Jon Strabala is a Principal Product Manager, responsible for the Couchbase Eventing Service. Before joining Couchbase, he spent more than 20 years building software products across various domains, starting with EDA in aerospace then transitioning to building enterprise software focused on what today is coined \u201cIoT\u201d and \u201cat-scale data.\u201d Jon worked for several small software consultancies until eventually starting and managing his own firm. He has extensive experience in NoSQL\/NewSQL, both in contributing and commercializing new technologies such as compressed bitmaps and column stores. Jon holds a bachelor\u2019s degree in electrical engineering and a master's in computer engineering, both from the University of Southern California, and an MBA from the University of California at Irvine.","url":"https:\/\/www.couchbase.com\/blog\/author\/jon-strabala\/"}]}},"authors":[{"term_id":9113,"user_id":42711,"is_guest":0,"slug":"jon-strabala","display_name":"Jon Strabala, Principal Product Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/db52a9f6d84faba430dd38106cdbc16ff02c2066b103b5f6b4cfcde40e83c683?s=96&d=mm&r=g","author_category":"","last_name":"Strabala, Principal Product Manager, Couchbase","first_name":"Jon","job_title":"","user_url":"","description":"Jon Strabala is a Principal Product Manager, responsible for the Couchbase Eventing Service. Before joining Couchbase, he spent more than 20 years building software products across various domains, starting with EDA in aerospace then transitioning to building enterprise software focused on what today is coined \u201cIoT\u201d and \u201cat-scale data.\u201d Jon worked for several small software consultancies until eventually starting and managing his own firm. He has extensive experience in NoSQL\/NewSQL, both in contributing and commercializing new technologies such as compressed bitmaps and column stores. Jon holds a bachelor\u2019s degree in electrical engineering and a master's in computer engineering, both from the University of Southern California, and an MBA from the University of California at Irvine."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/8743","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\/42711"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=8743"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/8743\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/8745"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=8743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=8743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=8743"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=8743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}