All Projects → kayac → Go Katsubushi

kayac / Go Katsubushi

Licence: mit
ID generator server

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Katsubushi

Did
高性能的ID生成器, 基于rpcx和Memcached协议提供网络服务调用
Stars: ✭ 120 (+1.69%)
Mutual labels:  snowflake, memcached
Shade
Memcached client for Scala
Stars: ✭ 107 (-9.32%)
Mutual labels:  memcached
Ansible Role Memcached
Ansible Role - Memcached
Stars: ✭ 54 (-54.24%)
Mutual labels:  memcached
Node Cached
A simple caching library for node.js, inspired by the Play cache API
Stars: ✭ 85 (-27.97%)
Mutual labels:  memcached
Php memcached dll
windows php-memcached dll files
Stars: ✭ 65 (-44.92%)
Mutual labels:  memcached
Snowflake
A simple to use Go (golang) package to generate or parse Twitter snowflake IDs
Stars: ✭ 1,314 (+1013.56%)
Mutual labels:  snowflake
Easycaching
💥 EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
Stars: ✭ 1,047 (+787.29%)
Mutual labels:  memcached
Id Generator
id-generator部署即使用的ID生成器, 支持HTTP、Dubbo、Spring Cloud方式.
Stars: ✭ 112 (-5.08%)
Mutual labels:  snowflake
Dogpile.cache
dogpile.cache is a Python caching API which provides a generic interface to caching backends of any variety
Stars: ✭ 106 (-10.17%)
Mutual labels:  memcached
Memcache Info
Simple and efficient way to show information about Memcache.
Stars: ✭ 84 (-28.81%)
Mutual labels:  memcached
Butterfly
🔥 蝴蝶--【简单】【稳定】【好用】的 Python web 框架🦋 除 Python 2.7,无其他依赖; 🦋 butterfly 是一个 RPC 风格 web 框架,同时也是微服务框架,自带消息队列通信机制实现分布式
Stars: ✭ 82 (-30.51%)
Mutual labels:  memcached
Redissnowflake
Twitter's Snowflake based ID generation as a redis module
Stars: ✭ 66 (-44.07%)
Mutual labels:  snowflake
Snow Stamp
Get the timestamp from a Discord snowflake ❄
Stars: ✭ 95 (-19.49%)
Mutual labels:  snowflake
Cucache
Fast PUT/GET/DELETE in-memory key-value store for lookaside caching
Stars: ✭ 63 (-46.61%)
Mutual labels:  memcached
Gosnowflake
Go Snowflake Driver
Stars: ✭ 108 (-8.47%)
Mutual labels:  snowflake
Finagle
A fault tolerant, protocol-agnostic RPC system
Stars: ✭ 8,126 (+6786.44%)
Mutual labels:  memcached
Locopy
locopy: Loading/Unloading to Redshift and Snowflake using Python.
Stars: ✭ 73 (-38.14%)
Mutual labels:  snowflake
Sonyflake Rs
🃏 A distributed unique ID generator inspired by Twitter's Snowflake.
Stars: ✭ 91 (-22.88%)
Mutual labels:  snowflake
Snowflake
java edition of [Twitter Snowflake](https://github.com/twitter/snowflake), a network service for generating unique ID numbers at high scale with some simple guarantees.
Stars: ✭ 114 (-3.39%)
Mutual labels:  snowflake
Memcached exporter
Exports metrics from memcached servers for consumption by Prometheus.
Stars: ✭ 109 (-7.63%)
Mutual labels:  memcached

katsubushi

katsubushi(鰹節) is stand alone application to generate unique ID.

Example

$ telnet localhost 11212
Trying ::1...
Connected to localhost.
Escape character is '^]'.
GET new
VALUE new 0 20
8070450532247928832
END

Installation

Download from releases or build from source code.

$ go get github.com/kayac/go-katsubushi
$ cd $GOPATH/github.com/kayac/go-katsubushi
make

Docker image

https://hub.docker.com/r/katsubushi/katsubushi/

$ docker pull katsubushi/katsubushi
$ docker run -p 11212:11212 katsubushi/katsubushi -worker-id 1
$ docker run -p 11212:11212 katsubushi/katsubushi -redis redis://your.redis.host:6379/0

Usage

$ cd $GOPATH/github.com/kayac/go-katsubushi/cmd/katsubushi
./katsubushi -worker-id=1 -port=7238
./katsubushi -worker-id=1 -sock=/path/to/unix-domain.sock

Protocol

katsubushi use protocol compatible with memcached.

Some commands are available with text and binary protocol.

But the others are available only with text protocol.

API

GET, GETS

Binary protocol is also available only for single key GET.

GET id1 id2
VALUE id1 0 18
283890203179880448
VALUE id2 0 18
283890203179880449
END

VALUE(s) are unique IDs.

STATS

Returns a stats of katsubushi.

Binary protocol is also available.

STAT pid 8018
STAT uptime 17
STAT time 1487754986
STAT version 1.1.2
STAT curr_connections 1
STAT total_connections 2
STAT cmd_get 2
STAT get_hits 3
STAT get_misses 0

VERSION

Returns a version of katsubushi.

Binary protocol is available, too.

VERSION 1.1.2

QUIT

Disconnect an established connection.

Algorithm

katsubushi use algorithm like snowflake to generate ID.

Commandline Options

-worker-id or -redis is required.

-worker-id

ID of the worker, must be unique in your service.

-redis

URL of Redis server. e.g. redis://example.com:6379/0

redis://{host}:{port}/{db}?ns={namespace}

This option is specified, katsubushi will assign an unique worker ID via Redis.

All katsubushi process for your service must use a same Redis URL.

-min-worker-id -max-worker-id

These options work with -redis.

If we use multi katsubushi clusters, worker-id range for each clusters must not be overlapped. katsubushi can specify the worker-id range by these options.

-port

Optional. Port number used for connection. Default value is 11212.

-sock

Optional. Path of unix doamin socket.

-idle-timeout

Optional. Connection idle timeout in seconds. 0 means infinite. Default value is 600.

-log-level

Optional. Default value is info.

-enable-pprof

Optional. Boolean flag. Enable profiling API by net/http/pprof. Endpoint is /debug/pprof.

-enable-stats

Optional. Boolean flag. Enable stats API by github.com/fukata/golang-stats-api-handler. Endpoint is /debug/stats.

-debug-port

Optional. Port number for listen http used for pprof and stats API. Defalut value is 8080.

Licence

MIT

Author

handlename

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].