Composing hyper data and cache services

hyper
2 min readFeb 16, 2022

--

hyper cache is a cache document store that provides a clean API to cache JSON documents. Caches are good for all sorts of things, to take the stress off of your transactional database when performing reads, to provide sessions for authentication, to contain simple aggregate values for dashboards and metrics, and more. Cache systems are complex and a challenge to set up and maintain. hyper removes this burden. hyper makes it easy to cache.

Why should I consider hyper?

For example, a dev could save data into the hyper data service followed by caching the document. Your application’s API can check for the data’s existence in the cache, and if it exists, retrieve popular data requests from memory rather than the disk. This has several advantages:

  1. Speed: Retrieving data from cache is much faster than retrieving data from a database.
  2. Conservation: Retrieving data from a cache takes pressure off your database.
  3. Delight: A performant app delights the customer.

Here’s a TypeScript code sample that saves a JSON document into a hyper data service followed by caching the document into a hyper cache service. Since the calls to hyper-connect are promised-based, the calls to data and cache can be chained together:

In conclusion, while the code sample above demonstrates a fairly happy path, it does illustrate composition of individual hyper backend services. Ready learn more? Check out our blogs, docs, workshop videos, and quickstarts.

Shhhh don’t tell anyone. We’re building an experimental project: ⚡️ hyper-ext-model ⚡️. hyper-ext-model is a hyper-connect extension that creates a model for an application that uses the hyper service. Using this extension you can compose hyper data, cache, search, storage, and queue (notification) services into a generic data model to define a given domain and provide basic business rules. You can specify rollback modes of atomic or non-atomic for those not-so-happy-paths. 😀 😔

It’s all about the dx y’all,

The hyper team.

--

--