cassandra-web

A web interface for Apache Cassandra

  • 所有者: avalanche123/cassandra-web
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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):

主要指标

概览
名称与所有者avalanche123/cassandra-web
主编程语言JavaScript
编程语言Ruby (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2014-09-19 23:27:50
推送于2021-12-07 01:55:24
最后一次提交2020-09-30 19:42:25
发布数1
最新版本名称v0.4.0 (发布于 )
第一版名称v0.4.0 (发布于 )
用户参与
星数142
关注者数10
派生数51
提交数31
已启用问题?
问题数25
打开的问题数18
拉请求数9
打开的拉请求数3
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?