cassandra-web

A web interface for Apache Cassandra

  • Owner: avalanche123/cassandra-web
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Cassandra Web

A web interface to Apache Cassandra with AngularJS and server-sent events.

Installation

gem install cassandra-web

Usage

Run cassandra-web -h for help.

Quick Start

cassandra-web

Connect to a Cassandra Cluster requiring authentication

cassandra-web --hosts '10.0.2.2' --port '9042' --username 'cassweb' --password 'myPassword'

How it works

Cassandra web consists of an HTTP API powered by Sinatra and a thin HTML5/JavaScript frontend powered by AngularJS.

When you run cassandra-web script, it starts a Thin web server on a specified address, which defaults to localhost:3000. Openning http://localhost:3000, or whatever address you've specified in the browser, loads the AngularJS application and it starts interacting with the HTTP API of cassandra-web. This api uses the Ruby Driver to communicate with an Apache Cassandra cluster.

When the frontend has fully loaded, it subscribes to /events API endpoint, and begins receiving Server Sent Events. The API uses an event listener, which is registered with the Cluster instance created by the Ruby Driver, to stream events such as schema and node status changes to update the user interface without having to refresh the page.

You can see this feature in action by creating a keyspace using the execute button in the top-right corner of the UI and executing the following statement:

CREATE KEYSPACE example WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}

If the statement executed successfully, you should see a new keyspace show up on the left side of the UI.

Alt text

The web server, Thin, used by cassandra-web is asynchronous and uses only a single thread to handle requests. This enables efficient handling multiple of long running connections, which is a requirement for streaming and Server Sent Events, but also means that the application cannot perform blocking operations during request handling, since it would hang up all connections for the duration of the blocking operation. cassandra-web therefore uses Asynchronous Execution feature of the Ruby Driver to not block on statements execution. The application executes statements asynchronously, receiving a future from the Ruby Driver. It then registers future completion listeners to send a response (or error) whenever it becomes available.

Credits

Cassandra web is possible because of the following awesome technologies (in no particular order):

Main metrics

Overview
Name With Owneravalanche123/cassandra-web
Primary LanguageJavaScript
Program languageRuby (Language Count: 4)
Platform
License:MIT License
所有者活动
Created At2014-09-19 23:27:50
Pushed At2021-12-07 01:55:24
Last Commit At2020-09-30 19:42:25
Release Count1
Last Release Namev0.4.0 (Posted on )
First Release Namev0.4.0 (Posted on )
用户参与
Stargazers Count142
Watchers Count10
Fork Count51
Commits Count31
Has Issues Enabled
Issues Count25
Issue Open Count18
Pull Requests Count9
Pull Requests Open Count3
Pull Requests Close Count2
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private