Home / Companies / Couchbase / Blog / Post Details
Content Deep Dive

Timers in Couchbase Functions

Blog post from Couchbase

Post Details
Company
Date Published
Author
Venkat Subramanian, Product Manager
Word Count
643
Language
English
Hacker News Points
-
Summary

Couchbase 6.0 Beta introduces Timers in Couchbase Functions, allowing asynchronous computations linked to specific wall-clock events, which can be used for various applications like document archiving, sending notifications, and risk assessments. Developers can create timers using a specific syntax that includes a callback function, an expiry timestamp, a unique reference, and a context payload, with the requirement that each timer's combination of function name, callback, and reference must be unique. Timer features include distributed processing for scalability, ensuring execution despite node failures, and maintaining the same timeout semantics as the parent functions. However, timers cannot be debugged visually, and failures aren't automatically retried, necessitating exception handling. Timers rely on metadata storage, requiring careful management of the metadata bucket to avoid data loss or interference, particularly in high-use scenarios requiring increased memory allocation.