Code Monkey home page Code Monkey logo

arabesque's Introduction

Arabesque

Arabesque, is a mail box (Queue) written in ruby with a backup from the super hero BerkeleyD. Arabesque tries to solve some of the existing solutions for applications written in ruby as:

  • Scaling to Mutliple CPUs
  • Garbage Collection
  • Performance and Reliability of Messaging Systems
  • And of course, Its not about the language, we can do great things with Ruby !! ;)

Download

Download Arabesque at:

   git://github.com/espace/arabesque.git

Installation

You can check out the latest source from git:

   git clone git://github.com/espace/arabesque.git

Sample Usage

Please First, Download BerkeleyDB and its ruby-wrapper.

Usage as a Library
Just Include the queues_manager file into your application, add queues to it, write to queues and read from queues.

Pros
Very fast
Much easier to setup and use
Less moving parts

Cons
Does not scale to multiple physical servers
If you do that you lose ordering (might not be an issue)

  require 'queues_manager.rb'
  # Creating the Manager
  @queues_manager = Arabesque::QueuesManager.new("data_folder_path")

  # Adding a Queue
  @queues_manager.add_queue('queue_name') 

  # Pushig to Queue
  @queues_manager.push_to_queue('queue_name','message')

  # Poping from Queue
  @queues_manager.pop_from_queue('queue_name')  

Usage as a server
Currently, We are using a simple sinatra server for processing, later Arabesque will have its own solid server implementation.

Pros
Allows multiple front end servers to use the same queue
Allows the queue to scale up or scale out independently from the front end

Cons
More moving parts
Added latencies of TCP/HTTP communication overhead
Loses strict queue ordering in scale out scenarios

Running the Server
ruby arabesque-server.rb

Adding A queue
curl http://SERVER_URL/queues -d “name=queue_name” (POST Request)

Pushing to Queue
curl http://SERVER_URL/queues/queue_name/ -d “message=my_message” (POST Request)

Poping from Queue
curl http://SERVER_URL/queues/queue_name/ (GET Request)

Numbers

These numbers are recorded on a machine wih AMD Turion X2 ultra 64-bit 2.00 GHZ Processor, 4 GB RAM, 5400 RPM Hard drive

Single Arabesque Process ( 1K message size) 5600.94 request/sec

Dual Arabesque Process (1K message size) 8577.74 request/sec

Notes

Arabesque is in the early begining, Testing enhancing server implementation are the first priorities now, sure contributions and reporting bugs are welcomed. More benchmarks will be avaliable soon.

Contribution By eSpace.

arabesque's People

Stargazers

 avatar

Watchers

James Cloos 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.