GithubHelp home page GithubHelp logo

rakesh-mohanta / cassandra-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avalanche123/cassandra-web

0.0 3.0 0.0 1.73 MB

A web interface for Apache Cassandra

Home Page: http://avalanche123.com/cassandra-web/

Ruby 4.06% CSS 3.42% HTML 3.06% JavaScript 89.45%

cassandra-web's Introduction

Cassandra Web

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

Installation

$ gem install cassandra-web

Usage

$ cassandra-web

Run cassandra-web -h for futher help.

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

cassandra-web's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.