npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@koopjs/cache-apache-ignite

v1.0.1

Published

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

Downloads

6

Readme

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)