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

restbase-mod-table-cassandra

v1.2.1

Published

RESTBase table storage on Cassandra

Downloads

69

Readme

RESTBase table storage on Cassandra

This projects provides a high-level table storage service abstraction similar to Amazon DynamoDB or Google DataStore on top of Cassandra. As the production table storage backend for RESTBase, it powers the Wikimedia REST APIs, such as this one for the English Wikipedia.

For testing and small installs, there is also a sqlite backend implementing the same interfaces.

Issue tracking

We use Phabricator to track issues. See the list of current issues in restbase-mod-table-cassandra.

Status

In production since March 2015.

Build Status coverage status

Features

  • basic table storage service with REST interface, backed by Cassandra, implementing the RESTBase table storage interface
  • multi-tenant design: domain creation, prepared for per-domain ACLs
  • table creation with declarative JSON schemas
  • limited automatic schema migrations
  • paging

TODO

Configuration

Configuration of this module takes place from within an x-modules stanza in the YAML-formatted RESTBase configuration file. While complete configuration of RESTBase is beyond the scope of this document, (see the RESTBase docs for that), this section covers the restbase-mod-table-cassandra specifics.

    - name: restbase-mod-table-cassandra
      version: 1.0.0
      type: npm
      options: # Passed to the module constructor
        conf:
          version: 1
          hosts: [localhost]
          username: cassandra
          password: cassandra
          defaultConsistency: localOne
          localDc: datacenter1
          datacenters:
            - datacenter1
          storage_groups:
            - name: default.group.local
              domains: /./

Version

The version of this configuration. Each edit of the module configuration must correpond to a new, unique version.

Note: Versions must be monotonically increasing.

    version: 1

Hosts

A list of Cassandra nodes to use as contact points.

    hosts:
      - cassandra-01.sample.org
      - cassandra-02.sample.org
      - cassandra-03.sample.org

Credentials

Password credentials to use in authenticating with Cassandra.

Note: Optional; Leave unconfigured if Cassandra authentication is not enabled.

    username: someuser
    password: somepass

Default Consistency

The Cassandra consistency level to use when not otherwise specified. Valid values are those from the nodejs driver for Cassandra. Defaults to localOne.

    defaultConsistency: localOne

TLS

Key and certificate information for use in TLS-encrypted environments. See the nodejs documentation on tls.connect for the meaning of these directives.

Note: Optional; Leave unconfigured if Cassandra client encryption is not enabled.

    tls:
      cert: /etc/restbase/tls/cert.pem
      key: /etc/restbase/tls/key.pem
      ca:
        - /etc/restbase/tls/root.pem

Local Datacenter

restbase-mod-table-cassandra uses a datacenter-aware connection pool. The localDc directive instructs the module which datacenter to treat as 'local' to this instance. Cassandra nodes in the local datacenter will be used for queries, and any others serve as a fallback. Defaults to datacenter1 (the Cassandra default).

Note: the localDc must be in the list of configured datacenters (see below).

    localDc: datacenter1

Datacenters

The list of datacenters this Cassandra cluster belongs to. Data will be replicated across these datacenters accordingly. Defaults to [ datacenter1 ].

Note: Changing this list alters the underlying Cassandra keyspaces in order to add or remove datacenter replicas accordingly, but replication is NOT made retroactive. You MUST perform a Cassandra repair after adding a new datacenter to realize the added redundancy. Likewise, you must perform a cleanup to reclaim space if a datacenter is removed.

    datacenters:
      - datacenter1

Storage Groups

Storage groups are used to map tables to one or more hosts/domains.

    storage_groups:
      - name: default.group.local
        domains: /./