Skip to content
Frederic Charette edited this page Jul 24, 2018 · 21 revisions

Table of contents


Introduction

What is ha-store

ha-store, or High-Availability store, is wrapper to abstract common optimization and security patterns for data fetching.

It's goals are to

  • Decouple performance, security and degradation fallback concerns from the rest of the application logic.
  • Provide an extensible interface to control caching, batching, retrying and circuit-breaking.
  • Reduce the infrastructure-related costs of orchestration-type applications with smart micro-caching.

The competition

Facebook's dataloader is a close competitor, but it lacks a few key features.

dataloader's documentation suggests implementing a new instance on each request, only coalescing data queries within the scope of that request- with a batching frequency that runs on node's event-loop (nextTick). This approach fits their caching strategy, since they do not have micro-caching, they are forced to make their entire stores short-lived so that they do not cause memory concerns.

ha-store, on the other end prefers global, permanent stores. This means that data query coalescing is application-wide, with the batching tick rate customizable- to allow users to really optimize roundtrips.


Concepts


Formulas


Samples

Express+mongo

Includes all of the ha-store features (retry, circuit-breaker, batching, coalescing, caching) in this very classical Express+Mongo application: Gist


References

Clone this wiki locally