Eventing Service

      +
      The Eventing Service provides near real-time handling of changes to data; whereby code is executed either in response to mutations, or as scheduled by timers.

      About the Eventing Service

      The Eventing Service is a scalable framework which enables user-defined business logic to be triggered and respond in real time on the server when application interactions create changes in data. These changes to data are also known as document mutations (insert, update, deletion, or expiration). Eventing Functions are standalone JavaScript fragments that are triggered in real time in response to mutations on documents. Eventing Functions can also schedule further processing in the future via Timers.

      The Eventing Service offers a computing paradigm that abstracts away infrastructure concerns allowing developers to focus solely on business logic to handle data changes. In the database, you can use Eventing Functions to handle data-changes according to a real-time event-condition-action model.

      Typical use cases include:

      • Enriching documents

      • Cascade deletes

      • Generating threshold-based alerts

      • Propagating data changes inside a database

      • Interacting with external REST endpoints

      Using the Eventing Service

      Like the other Couchbase services, the Eventing Service can be deployed when creating a Couchbase hosted database, or by adding it to an existing Couchbase hosted database. The Eventing Service depends on the Data Service. This service must also be deployed on the database in order to use the Eventing Service. (Information about how these services interact with one another can be found in the Couchbase Server documentation.)

      If a database has the Eventing Service deployed, Eventing Functions can be created and managed using the Couchbase CLI, the REST API, and the Capella UI.