{"id":17841,"date":"2026-01-23T09:06:56","date_gmt":"2026-01-23T17:06:56","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=17841"},"modified":"2026-01-28T08:32:42","modified_gmt":"2026-01-28T16:32:42","slug":"using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/","title":{"rendered":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \uc774\ubca4\ud2b8\uc5d0\uc11c \uc628\ub514\ud50c\ub85c\uc774\ub97c \uc0ac\uc6a9\ud558\uc5ec \ube44\ud589 \uc804 \uc124\uc815\uc73c\ub85c \ub3cc\uc5f0\ubcc0\uc774\ub97c \uac8c\uc774\ud2b8\ud558\uae30"},"content":{"rendered":"<h2><b>The problem: \u201cStateless\u201d doesn\u2019t mean \u201csetup-free\u201d<\/b><\/h2>\n<p><span style=\"font-weight: 400\">Couchbase Eventing is intentionally built like a short-running, stateless lambda: react to a mutation, do some work, exit. That model is clean \u2013 until your eventing function needs <\/span><i><span style=\"font-weight: 400\">one-time<\/span><\/i><span style=\"font-weight: 400\"> housekeeping before it can safely process the first mutation.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Historically, developers worked around this by doing a \u201cfirst mutation warmup\u201d inside OnUpdate, often with CAS-safe writes or counters so only one thread would load a shared state. That approach can work, but it forces you to depend on a mutation just to establish prerequisites, and it pushes setup concerns into the hottest part of your code path: mutation processing.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">This is exactly why there was a need for a mutationless initialization concept in Eventing \u2013 an explicit setup phase that can run without an initial mutation and make the function ready before any real work begins.<\/span><\/p>\n<h2><b>The idea: a pre-flight checklist<\/b><\/h2>\n<p><b>OnDeploy<\/b><span style=\"font-weight: 400\"> is a new Eventing handler that runs <\/span><b>once<\/b><span style=\"font-weight: 400\"> when an Eventing function is:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><b>deployed<\/b><span style=\"font-weight: 400\">, or<\/span><\/li>\n<li style=\"font-weight: 400\"><b>resumed<\/b><span style=\"font-weight: 400\"> (after being paused)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">And, importantly, <\/span><b>it runs before any mutations are processed<\/b><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">If you think of your Eventing function like an aircraft:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">OnUpdate<\/span><span style=\"font-weight: 400\"> \/ <\/span><span style=\"font-weight: 400\">OnDelete<\/span><span style=\"font-weight: 400\"> are the flight operations.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>OnDeploy is the pre-flight check.<\/b><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If the pre-flight check fails, <\/span><b>the plane doesn\u2019t leave the runway<\/b><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">That \u201cgatekeeper\u201d behavior is the key: <\/span><b>if<\/b> <b>OnDeploy<\/b><b> fails, the function reverts to the previous state<\/b><span style=\"font-weight: 400\"> \u2013 protecting you from \u201cmisconfigured logic goes live\u201d scenarios.<\/span><\/p>\n<p><b>How it works: <\/b><b>OnDeploy(action)<\/b><\/p>\n<p><span style=\"font-weight: 400\">If you define an <\/span><span style=\"font-weight: 400\">OnDeploy<\/span><span style=\"font-weight: 400\"> handler in your eventing function code, it will be invoked once with an <\/span><span style=\"font-weight: 400\">action<\/span><span style=\"font-weight: 400\"> argument.<\/span><\/p>\n<pre class=\"lang:default decode:true\">function OnDeploy(action) {\r\n  \/\/ your setup code\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Where:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">action.reason<\/span><span style=\"font-weight: 400\"> is one of:<\/span>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">&#8220;deploy&#8221;<\/span><span style=\"font-weight: 400\">: a fresh eventing function deploy<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">&#8220;resume&#8221;<\/span><span style=\"font-weight: 400\">: resuming after a pause<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">action.delay<\/span><span style=\"font-weight: 400\"> is:<\/span>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">0<\/span><span style=\"font-weight: 400\"> on <\/span><span style=\"font-weight: 400\">&#8220;deploy&#8221;<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">the effective paused duration (milliseconds) on <\/span><span style=\"font-weight: 400\">&#8220;resume&#8221;<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-17842\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Screenshot-2026-01-22-at-2.09.13-PM.png\" alt=\"\" width=\"1284\" height=\"782\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Screenshot-2026-01-22-at-2.09.13-PM.png 1284w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Screenshot-2026-01-22-at-2.09.13-PM-300x183.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Screenshot-2026-01-22-at-2.09.13-PM-1024x624.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Screenshot-2026-01-22-at-2.09.13-PM-768x468.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Screenshot-2026-01-22-at-2.09.13-PM-18x12.png 18w\" sizes=\"auto, (max-width: 1284px) 100vw, 1284px\" \/><\/p>\n<h2><b>Two important safety rails<\/b><\/h2>\n<ol>\n<li style=\"font-weight: 400\"><b>Timeout:<\/b> <span style=\"font-weight: 400\">OnDeploy<\/span><span style=\"font-weight: 400\"> must finish within the configured <\/span><b>OnDeploy Timeout <\/b><span style=\"font-weight: 400\">(default: 60 seconds). If it exceeds the timeout, the function deployment is not allowed to proceed.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Fail-fast semantics:<\/b><span style=\"font-weight: 400\"> If <\/span><span style=\"font-weight: 400\">OnDeploy<\/span><span style=\"font-weight: 400\"> throws an error or fails, <\/span><b>no mutations are processed<\/b><span style=\"font-weight: 400\"> and the function remains in its previous state.<\/span><\/li>\n<\/ol>\n<h2><b>Why this matters<\/b><\/h2>\n<p><span style=\"font-weight: 400\">OnDeploy isn\u2019t just \u201cnice to have.\u201d It\u2019s a shift in how you can design Eventing functions:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><b>Correctness first:<\/b><span style=\"font-weight: 400\"> Ensure prerequisites exist before any write logic runs.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Less boilerplate:<\/b><span style=\"font-weight: 400\"> Remove thread coordination hacks from <\/span><span style=\"font-weight: 400\">OnUpdate<\/span><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Faster time-to-first-correct-mutation:<\/b><span style=\"font-weight: 400\"> Warm caches once, not per thread.<\/span><\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td><b>Aspect<\/b><\/td>\n<td><b>Without OnDeploy\u00a0<\/b><\/td>\n<td><b>With OnDeploy<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Initialization<\/span><\/td>\n<td><span style=\"font-weight: 400\">In OnUpdate (race-prone)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Once, before mutations<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Thread coordination<\/span><\/td>\n<td><span style=\"font-weight: 400\">Required<\/span><\/td>\n<td><span style=\"font-weight: 400\">Not needed<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Setup guarantee<\/span><\/td>\n<td><span style=\"font-weight: 400\">Best effort<\/span><\/td>\n<td><span style=\"font-weight: 400\">Fail-fast guarantee<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Deployment safety<\/span><\/td>\n<td><span style=\"font-weight: 400\">Silent failures possible<\/span><\/td>\n<td><span style=\"font-weight: 400\">Blocked if setup fails<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><b>Use cases<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You need a lookup table (prices, exchange rates, configs) before any mutation is allowed to act on incomplete data.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You want a recurring job (once a day, once an hour) but you don\u2019t want to \u201cfake\u201d a mutation just to start a <\/span><a href=\"https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-timers.html\"><span style=\"font-weight: 400\">timer<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You want the function to refuse to run if prerequisites are missing \u2013 because it\u2019s better to block deployment than to silently produce wrong writes.<\/span><\/li>\n<\/ul>\n<h2><b>Example 1: Warm a lookup table once, then schedule a daily refresh<\/b><\/h2>\n<h3><b>Scenario<\/b><\/h3>\n<p><span style=\"font-weight: 400\">You enrich documents with end-of-day stock prices. Prices are fetched daily from an external REST API, stored in a KV document, and used by every mutation afterward.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">With OnDeploy, you can do the warmup <\/span><b>once<\/b><span style=\"font-weight: 400\">, guaranteed, before any mutation is processed.<\/span><\/p>\n<h3><b>Code<\/b><\/h3>\n<pre class=\"lang:default decode:true\">\/\/ Timer Callback: refresh prices daily\r\nfunction RefreshPricesCallback(context) {\r\n    log(\"Refreshing stock prices from API\");\r\n    var response = curl(\"GET\", stock_api_binding, {path: '\/api\/eod-prices'});\r\n    cache_bucket[\"lookup::eod_prices\"] = response.body;\r\n    \r\n    \/\/ Re-schedule for tomorrow\r\n    var tomorrow = new Date();\r\n    tomorrow.setSeconds(tomorrow.getSeconds() + 86400); \/\/ 24 hours\r\n    createTimer(RefreshPricesCallback, tomorrow, \"refresh_prices\", {});\r\n}\r\n\r\n\/\/ OnDeploy: initialize price cache once\r\nfunction OnDeploy(action) {\r\n    log(\"OnDeploy: reason=\" + action.reason);\r\n    \r\n    \/\/ Fetch initial prices from external API\r\n    var response = curl(\"GET\", stock_api_binding, {path: '\/api\/eod-prices'});\r\n    cache_bucket[\"lookup::eod_prices\"] = response.body;\r\n    \r\n    \/\/ Schedule daily refresh timer\r\n    var tomorrow = new Date();\r\n    tomorrow.setSeconds(tomorrow.getSeconds() + 86400);\r\n    createTimer(RefreshPricesCallback, tomorrow, \"refresh_prices\", {});\r\n    \r\n    log(\"Price cache initialized and refresh timer scheduled\");\r\n}\r\n\r\n\/\/ OnUpdate: enrich documents with cached prices\r\nfunction OnUpdate(doc, meta) {\r\n    var prices = cache_bucket[\"lookup::eod_prices\"];\r\n    \r\n    doc.stockPrice = prices[doc.symbol];\r\n    doc.enrichedAt = new Date().toISOString();\r\n    \r\n    dst_bucket[meta.id] = doc;\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">The advantages with this logic:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">No \u201cfirst mutation does setup\u201d surprise.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">No cross-thread complexity inside <\/span><span style=\"font-weight: 400\">OnUpdate<\/span><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Every mutation starts with the prerequisites in place.<\/span><\/li>\n<\/ul>\n<h2><b>Example 2: Treat deploy and resume differently with OnDeploy<\/b><\/h2>\n<h3><b>Scenario<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Sometimes the job isn\u2019t to \u201cschedule work\u201d \u2013 it\u2019s to <\/span><b>make your function safe to start (or safe to restart)<\/b><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">For example, your Eventing function might depend on:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">external data (can be fetched via cURL bindings at first deployment), and<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">configuration stored in Couchbase (that should be reloaded after a pause)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This is a great fit for OnDeploy because it lets you <b>branch behavior based on lifecycle<\/b> and ensure your function is ready <i>before<\/i> processing any mutations.<\/span><\/p>\n<h3><b>Code<\/b><\/h3>\n<pre class=\"lang:default decode:true\">function OnDeploy(action) {\r\n  log('OnDeploy triggered. Reason:', action.reason);\r\n  switch (action.reason) {\r\n    case 'deploy':\r\n      \/\/ First-time deployment: fetch initial data needed by the function.\r\n      log('Bootstrapping: Performing first-time setup...');\r\n      bootstrap_external_data();\r\n      break;\r\n    case 'resume':\r\n      \/\/ Function was paused and resumed: refresh any cached settings.\r\n      log('Configuration changed. Reloading settings...');\r\n      reload_config_from_bucket();\r\n      break;\r\n  }\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">This pattern keeps lifecycle logic explicit and clean:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><b>Deploy<\/b><span style=\"font-weight: 400\"> becomes the moment you do one-time bootstrap work.<\/span><\/li>\n<li style=\"font-weight: 400\"><b>Resume<\/b><span style=\"font-weight: 400\"> becomes the moment you reconcile\/refresh config after pausing (<\/span><span style=\"font-weight: 400\">action.delay<\/span><span style=\"font-weight: 400\"> tells you how long you were paused).<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Your mutation handlers stay focused on business logic because they can assume that the prerequisites are already satisfied.<\/span><\/li>\n<\/ul>\n<h2><b>Design guidance: what <\/b><b><i>not<\/i><\/b><b> to do in OnDeploy<\/b><\/h2>\n<p><span style=\"font-weight: 400\">OnDeploy is powerful, but it is deliberately constrained:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Keep it <\/span><b>short<\/b><span style=\"font-weight: 400\"> and <\/span><b>deterministic<\/b><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Avoid long-running loops that could delay deployment.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Treat it like infrastructure code: validate prerequisites, initialize shared state, schedule work, then exit.<\/span><\/li>\n<\/ul>\n<h2><b>Conclusion<\/b><\/h2>\n<p><span style=\"font-weight: 400\">OnDeploy brings a fundamental shift to Couchbase Eventing: the ability to guarantee prerequisites are met before a single mutation is processed. Instead of scattering initialization logic across mutation handlers or relying on race-prone warmup hacks, you now have a single, explicit pre-flight check that runs once and fails fast if anything goes wrong.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The result? Cleaner code, safer deployments, and confidence that your Eventing functions start in a known-good state every time.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Ready to try it? OnDeploy is available from Couchbase Server 8.0 and above. Check out the documentation below to get started, and consider which of your existing Eventing functions could benefit from this pattern.<\/span><\/p>\n<h2><b>References<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-language-constructs.html#ondeploy_handler\"><span style=\"font-weight: 400\">Couchbase Eventing OnDeploy handler documentation<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/docs.couchbase.com\/server\/current\/eventing\/eventing-timers.html\"><span style=\"font-weight: 400\">Timers in Couchbase Eventing<\/span><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The problem: \u201cStateless\u201d doesn\u2019t mean \u201csetup-free\u201d Couchbase Eventing is intentionally built like a short-running, stateless lambda: react to a mutation, do some work, exit. That model is clean \u2013 until your eventing function needs one-time housekeeping before it can safely [&hellip;]<\/p>\n","protected":false},"author":85689,"featured_media":17843,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[2273],"tags":[],"ppma_author":[10173],"class_list":["post-17841","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-eventing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup - 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\/ko\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup\" \/>\n<meta property=\"og:description\" content=\"The problem: \u201cStateless\u201d doesn\u2019t mean \u201csetup-free\u201d Couchbase Eventing is intentionally built like a short-running, stateless lambda: react to a mutation, do some work, exit. That model is clean \u2013 until your eventing function needs one-time housekeeping before it can safely [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-23T17:06:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-28T16:32:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1256\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Hiren Bavaskar, Software Engineer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hiren Bavaskar, Software Engineer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/\"},\"author\":{\"name\":\"Hiren Bavaskar, Software Engineer\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/525fabf075216ee904f309ef71f8adc3\"},\"headline\":\"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup\",\"datePublished\":\"2026-01-23T17:06:56+00:00\",\"dateModified\":\"2026-01-28T16:32:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/\"},\"wordCount\":876,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png\",\"articleSection\":[\"Eventing\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/\",\"name\":\"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png\",\"datePublished\":\"2026-01-23T17:06:56+00:00\",\"dateModified\":\"2026-01-28T16:32:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png\",\"width\":2400,\"height\":1256},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup\"}]},{\"@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\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@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\\\/525fabf075216ee904f309ef71f8adc3\",\"name\":\"Hiren Bavaskar, Software Engineer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Hiren.jpeg380ae5334d039ba294d4f0af4bd5a6a9\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Hiren.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2026\\\/01\\\/Hiren.jpeg\",\"caption\":\"Hiren Bavaskar, Software Engineer\"},\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/ko\\\/author\\\/hiren\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup - 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\/ko\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/","og_locale":"ko_KR","og_type":"article","og_title":"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup","og_description":"The problem: \u201cStateless\u201d doesn\u2019t mean \u201csetup-free\u201d Couchbase Eventing is intentionally built like a short-running, stateless lambda: react to a mutation, do some work, exit. That model is clean \u2013 until your eventing function needs one-time housekeeping before it can safely [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/","og_site_name":"The Couchbase Blog","article_published_time":"2026-01-23T17:06:56+00:00","article_modified_time":"2026-01-28T16:32:42+00:00","og_image":[{"width":2400,"height":1256,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png","type":"image\/png"}],"author":"Hiren Bavaskar, Software Engineer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Hiren Bavaskar, Software Engineer","Est. reading time":"5\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/"},"author":{"name":"Hiren Bavaskar, Software Engineer","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/525fabf075216ee904f309ef71f8adc3"},"headline":"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup","datePublished":"2026-01-23T17:06:56+00:00","dateModified":"2026-01-28T16:32:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/"},"wordCount":876,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png","articleSection":["Eventing"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/","url":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/","name":"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png","datePublished":"2026-01-23T17:06:56+00:00","dateModified":"2026-01-28T16:32:42+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Using-OnDeploy-in-Couchbase-Eventing-to-Gate-Mutations-With-Pre-Flight-Setup.png","width":2400,"height":1256},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/using-ondeploy-in-couchbase-eventing-to-gate-mutations-with-pre-flight-setup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using OnDeploy in Couchbase Eventing to Gate Mutations With Pre-Flight Setup"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4, Couchbase","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":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@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\/525fabf075216ee904f309ef71f8adc3","name":"\ud788\ub80c \ubc14\ubc14\uc2a4\uce74\ub974, \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc5d4\uc9c0\ub2c8\uc5b4","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Hiren.jpeg380ae5334d039ba294d4f0af4bd5a6a9","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Hiren.jpeg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Hiren.jpeg","caption":"Hiren Bavaskar, Software Engineer"},"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/hiren\/"}]}},"acf":[],"authors":[{"term_id":10173,"user_id":85689,"is_guest":0,"slug":"hiren","display_name":"Hiren Bavaskar, Software Engineer","avatar_url":{"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Hiren.jpeg","url2x":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2026\/01\/Hiren.jpeg"},"0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/17841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/85689"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=17841"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/17841\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/17843"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=17841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=17841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=17841"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=17841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}