Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@koopjs/cache-apache-ignite

Package Overview
Dependencies
Maintainers
7
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koopjs/cache-apache-ignite

[![npm version][npm-img]][npm-url] ![coverage](./coverage.svg)

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
7
Weekly downloads
 
Created
Source

koop-cache-apache-ignite

npm version coverage

This is a "cache" plugin for the Koop Web Server. It adheres to Koop's plugin specification. Registering this plugin with Koop will cause it to replace its in-memory cache with a cache backed by Apache Ignite.

An important fact about Koop cache plugins - registering a cache does not necessarily mean data from provider plugins will be cached. The provider must set a ttl (in seconds) on its data payload for it to be cached by any cache-plugin. This gives the provider developer ultimate control over data caching.

Why use the Apache-Ignite plugin?

Koop's default cache uses a simple key/value store to cache data in-memory. This means you are using a chunk of your deployment machine's memory for the cache. The size of cache entries isn't limited by the in-memory cache-plugin (though the number of entries is limited), which makes it hard to plan for how much memory you need. In contrast, using a backing store like Apache Ignite is a much more scalable solution as you can provision the Ignite instance independently and it's memory consumption has no impact on the web-server.

Using a plugin like the Apache-Ignite cache also benefits deployments that leverage horizontal scaling of the web-server. Imagine you are using the default in-memory cache and that you are deploying multiple Koop server instances with traffic routed to each by a load balancer. In this architecture, each Koop server has its own cache. Caching is therefore inefficient; a cache entry on server (A) is not accessible to server (B). Rather, each server instance has to build up its own cache. Alternatively, if you use the Apache-Ignite plugin with an independently deployed Apache-Ignite backing store, each Koop server instance will share a single cache; entries cached by server (A) can be retrieved by server (B).

Usage

As a Koop cache plugin

With registration options:
const Koop = require('koop')
const koop = new Koop()
const { Cache } = require('@koopjs/cache-apache-ignite')
koop.register(Cache, {
  connStr: '127.0.0.1:10800', // connection string for the Ignite deployment,
  cacheName: 'koop-ignite-cache' // a name to use for the cache; will be created if not found
})
With options set in "node-config" module:

Create a configuration json file (see node-config for details).

{
  "apacheIgnite": {
    "connStr": "127.0.0.1:10800",
    "cacheName": "koop-ignite-cache"
  }
}

Then register the cache plugin without options.

const Koop = require('koop')
const koop = new Koop()
const { Cache } = require('@koopjs/cache-apache-ignite')
koop.register(Cache)

FAQs

Package last updated on 08 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc