Resonate Server API
This is an overview of the Resonate API surface area.
Promises API​
The Promise API is the core of the Resonate Server. It allows us to store computational progress in a database. By doing this, we can offer recoverability
to processes using our SDK even after a process crash due to hardware or software failures. Currently, we support two databases:
- SQLite (default)
- PostgreSQL
If you don't see the database you are looking for, we are highly composable and eagerly accept contributions!
Tasks API​
The Tasks API allows users to route durable promises to a set of workers. This is very useful for implementing the Fan-out/Fan-in pattern
. Unlike the other APIs, this requires a small amount of server configuration to set up the routing rules.
Schedules API​
The Schedules API allows users to schedule the creation of durable promises with a cron expression. This is useful for creating stateful reminders
, also known as cron jobs. Applications can either poll for the created stateful reminders, which will persist beyond crashes, or pair it with the distributed tasks framework. When paired, the creation of a durable promise automatically gets routed and triggers a process at certain intervals.
Distributed Locks API​
The Distributed Locks API is used to provide mutually exclusive access
to a resource. This is primarily used as an internal API for the SDKs and Workers, but can also be used as a standalone API by the user.
One unique feature is the processId
parameter, which uniquely identifies a process and allows for optimized updates of all locks associated with that process. By including the processId in the lock acquisition and heartbeat requests, the SDK can easily update the expiration time for all locks held by a specific process in a single API call.