[技術] Hedis(aka Hyper Redis)介紹
blog介紹:http://kewang.logdown.com/posts/281209
官網:http://hedis.io
DEMO影片:https://www.youtube.com/watch?v=aAgJaqvgqLU
# 前言
上個月在ModernWeb聽了@ant大大的Redis talk之後,就在想是不是可以讓Redis直接連
到其他的database。因為一般情境都是在AP server有商業邏輯判斷是不是要去
In-memory database取資料(如:熱門文章、token...等),如果在In-memory database
取不到資料時,AP就會改到source database取資料,然後丟回In-memory database,之
後如果還要取同一筆資料時,直接在In-memory database讀取就可以了。

)
後來因為想要省掉In-memory database再回AP取source database這一段的路徑(path),
所以我嘗試從Redis直接連到source database,就開發了[Hedis]( http://hedis.io )。

)
因為是從Redis得到的靈感,所以當然是從Redis那裡fork出來。而且我現在開發都是用
HBase,所以原本Hedis的全名是「HBase's Redis」,但後來覺得應該要支援各種
database才對,所以改成了「Hyper Redis」。
## How to use
啟動時只要撰寫如下的YAML設定檔,然後執行`redis-server --hedis hedis.yml`就可以
了,目前的connector已經可以支援MySQL及HBase,但還要靠大家幫忙支援更多的
database才行。
cdh1: # connector name (REQUIRED)
type: hbase # connector type (REQUIRED)
zookeeper: localhost:2181 # other configuration (depends on its type)
mysqltest:
type: mysql
username: root
password: MY_PASSWORD
host: localhost
database: hedistest
otherdb:
type: gooddb
## GET command
目前支援的Redis command雖然只有get而已,但之後會依照不同database的特性而支援不
同的command。像是HBase原本就有scan的功能,所以之後應該也會支援Redis的scan。
# HBase example:
#
# get "kewang" rowkey at "user" table on "cdh1" connector
GET "cdh1://user@kewang"
# HBase example:
#
# get "kewang" rowkey at "user" table on "cdh1" connector, again
GET "cdh1://!user@kewang"
# MySQL example:
#
# Query one record at "user" table on "mysqltest" connector
GET "mysqltest://select * from user limit 1"
當然也還有如下面的一大堆東西要開發,希望對Hedis有興趣的朋友可以一起來幫忙開發
喔
* output format support
* git connector support
* ...etc.
## References
* [Hedis]( http://hedis.io )
* [GitHub]( http://git.hedis.io )
--
雜七雜八的kewang部落格 http://kewang.tw
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.107.152
※ 文章網址: https://www.ptt.cc/bbs/Soft_Job/M.1435591965.A.BC2.html
→
06/29 23:52, , 1F
06/29 23:52, 1F
推
06/30 00:01, , 2F
06/30 00:01, 2F
※ 編輯: kewang (220.132.107.152), 06/30/2015 00:04:54
推
06/30 01:14, , 3F
06/30 01:14, 3F
→
06/30 01:28, , 4F
06/30 01:28, 4F
→
06/30 01:28, , 5F
06/30 01:28, 5F
推
06/30 01:32, , 6F
06/30 01:32, 6F
推
06/30 02:39, , 7F
06/30 02:39, 7F
推
06/30 19:48, , 8F
06/30 19:48, 8F
推
06/30 21:21, , 9F
06/30 21:21, 9F
推
07/01 01:46, , 10F
07/01 01:46, 10F
→
07/01 01:47, , 11F
07/01 01:47, 11F
→
07/01 01:49, , 12F
07/01 01:49, 12F
→
07/01 01:49, , 13F
07/01 01:49, 13F
→
07/01 01:53, , 14F
07/01 01:53, 14F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):