Git Product home page Git Product logo

siberite's Introduction

Siberite

License Build Release Go Walker

Siberite is a simple leveldb backed message queue server
(twitter/kestrel, wavii/darner rewritten in Go).

Siberite is a very simple message queue server. Unlike in-memory servers such as redis, Siberite is designed to handle queues much larger than what can be held in RAM. And unlike enterprise queue servers such as RabbitMQ, Siberite keeps all messages out of process, using goleveldb as a persistent storage.

The result is a durable queue server that uses a small amount of in-resident memory regardless of queue size.

Siberite is based on Robey Pointer's Kestrel - simple, distributed message queue. Like Kestrel, Siberite follows the "No talking! Shhh!" approach to distributed queues: A single Siberite server has a set of queues identified by name. Each queue is a strictly-ordered FIFO, and querying from a fleet of Siberite servers provides a loosely-ordered queue. Siberite also supports Kestrel's two-phase reliable fetch: if a client disconnects before confirming it handled a message, the message will be handed to the next client.

Compared to Kestrel and Darner, Siberite is easier to build, maintain and distribute. It uses an order of magnitude less memory compared to Kestrel, and has an ability to consume queue multiple times (using durable cursors feature).

Features

  1. Siberite clients can consume single source queue multiple times using get <queue>.<cursor_name> syntax.
  • Usually, with get <queue> syntax, returned message gets expired and deleted from queue.
  • With cursor syntax get <queue>.<cursor_name>, a durable cursor gets initialized. It shifts forward with every read without deleting any messages in the source queue. Number of cursors per queue is not limited.
  • If you continue reads from the source queue with usual syntax again, siberite will continue deleting already serverd messages from the head of the queue. Any existing cursor that is internally points to an already expired message will start serving messages from the current queue head on the next read.
  • Durable cursors are also support two-phase reliable reads. All failed reliable reads for each cursor get stored in cursor's own small persistent queue and get served to other cursor readers.
  1. Fanout queues
  • Siberite allows you to insert new message into multiple queues at once by using the following syntax set <queue>+<another_queue>+<third_queue> ...

Benchmarks

Siberite performance benchmarks

Build

Make sure your GOPATH is correct

go get github.com/bogdanovich/siberite
cd $GOPATH/src/github.com/bogdanovich/siberite
go get ./...
go build siberite.go
mkdir ./data
./siberite -listen localhost:22133 -data ./data
2015/09/22 06:29:38 listening on 127.0.0.1:22133
2015/09/22 06:29:38 initializing...
2015/09/22 06:29:38 data directory:  ./data

or download darwin-x86_64 or linux-x86_64 builds

Protocol

Siberite follows the same protocol as Kestrel, which is the memcache TCP text protocol.

List of compatible clients

Telnet demo

telnet localhost 22133
Connected to localhost.
Escape character is '^]'.

set work 0 0 10
1234567890
STORED

set work 0 0 2
12
STORED

get work
VALUE work 0 10
1234567890
END

get work/open
VALUE work 0 2
12
END

get work/close
END

stats
STAT uptime 47
STAT time 1443308758
STAT version siberite-0.4.1
STAT curr_connections 1
STAT total_connections 1
STAT cmd_get 2
STAT cmd_set 2
STAT queue_work_items 0
STAT queue_work_open_transactions 0
END

# other commands:
# get work/peek
# get work/open
# get work/close/open
# get work/abort
# get work.cursor_name
# get work.cursor_name/open
# get work.my_cursor/close/open
# set work+fanout_queue
# flush work
# delete work
# flush_all
# quit

Not supported

  • Waiting a given time limit for a new item to arrive /t= (allowed by protocol but does nothing)

siberite's People

Contributors

alyandon avatar bogdanovich avatar bryant1410 avatar gitter-badger avatar jeteon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

siberite's Issues

How to do replication?

For fail-over and horizontal scalability, how to do replication? As I see it's not supported in the backed goleveldb?

Are multiple consumers supported?

Hi, I am very new to queues and am going to use siberite for a project. While now one consumer will be sufficient, there might be need to add multiple consumers.

Your TODO has: Add multiple consumers get queue_name:consumer_name/open

Does this mean now only one consumer is supported? If I connect two consumers what is going to happen.

Fanout queue semantics not correct

In the documentation here, fanout queue usage is described as:

Siberite allows you to insert new message into multiple queues at once by using the following syntax set <queue>+<another_queue>+<third_queue> ...

However, in the Kestrel documentation the intended behaviour (and what I expected) is:

If a queue name has a + in it (like "orders+audit"), it's treated as a fanout queue, using the format +. These queues belong to a parent queue -- in this example, the "orders" queue. Every item written into a parent queue will also be written into each of its children.

Which is to say that the "+" syntax is used to make is so the child queue receives all SETs that the parent queue receives after that. This is what I need since I wanted a producer to create a single queue and then the consumers to be able to create independent queues that follow the main producer queue. With this implementation, it would mean the producer has to know about every consumer and send each of them updates, which is rather inconvenient.

I understand that such a change may be breaking. Do you know of any uses that depend on the "broadcast" behaviour?

If this won't be fixed to be consistent with the Kestrel protocol, would you consider adding syntax for this, perhaps like?:

FOLLOW <child> <parent>

Or perhaps, would you consider making use of another unlikely filename character so that the syntax below complies with the use of "+" in Kestrel?:

SET parent>child 0 0 0

server errors when connecting from siberite-ruby client

when connecting from ruby and issuing simple sets / gets in a loop, i see lots of errors in the server log:

2017/01/20 17:59:25 [::1]:49381 ERROR Unknown command
2017/01/20 17:59:25 [::1]:49392 ERROR Unknown command
2017/01/20 17:59:25 [::1]:49394 ERROR Unknown command
2017/01/20 17:59:25 [::1]:49398 ERROR Unknown command

(probably a client issue, but the other repo doesn't have issues enabled.)

Authentication

Do you have plans to add authentication to Siberite? Or if not, do you know of any proxies that might be suitable for the memcache protocol that I could use that might provide it?

Are fanout supported?

Are fanout queues supported?
We are heavy users of kestrel and this project looks very interesting, but we use a lot of fanout queues.

A Siberite Specific Client

Do you already have a Go siberite client, or should I start working on one?

While the memcache clients are good enough, with the addition of multiple consumer groups and the subcommands, I think siberite could use a custom client.

Also I find the existing Go Memcache clients are not implementing all the commands, specifically, stats and others.

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.