Lightning Hedis

60
Lightning Hedis Kewang

Transcript of Lightning Hedis

Page 1: Lightning Hedis

Lightning Hedis

Kewang

Page 2: Lightning Hedis

2

about me

Page 3: Lightning Hedis

3

about me

● Java / Android● Node.js / AngularJS● Hadoop / HBase● AWS / Heroku / Firebase● @Mitake

Page 4: Lightning Hedis

4

I'm not ......

http://goo.gl/XCYYGI

Page 5: Lightning Hedis

5

I'm not ......, too

Page 6: Lightning Hedis

6

I'm not ......, too

Page 7: Lightning Hedis

7

Page 8: Lightning Hedis

8

Page 9: Lightning Hedis

9

霸氣!

Page 10: Lightning Hedis

10

霸氣!宅氣!

Page 11: Lightning Hedis

11

上一次報Lightning Talk

Page 12: Lightning Hedis

12

Page 13: Lightning Hedis

13

那些年,我們一起用高橋流的時代

Page 14: Lightning Hedis

14

Page 15: Lightning Hedis

15

OSDC.tw 2007

Page 16: Lightning Hedis

16

Page 17: Lightning Hedis

17

讓我們謝謝 OSDC.tw

Page 18: Lightning Hedis

18

只能拍三秒鐘啊 ~~~

Page 19: Lightning Hedis

19

進入正題

Page 20: Lightning Hedis

20

Page 21: Lightning Hedis

21

Redis, another step on the roadIntroductionto Redis 3.0, and it’s features and improvements. What’s difference between Redis / Memcached / Aerospike ? The strong sides of Redis, and away from the weak sides.

Page 22: Lightning Hedis

22

Redis 應用情境

Page 23: Lightning Hedis

23

Scenario - Redis

Application server

Redis Database

Client

Page 24: Lightning Hedis

24

Scenario - Redis

Application server

Redis Database

Client (1)

Page 25: Lightning Hedis

25

Scenario - Redis

Application server

Redis Database

(2)

Client (1)

Page 26: Lightning Hedis

26

Scenario - Redis

Application server

Redis Database

(2)

Client (1)(3

)

Page 27: Lightning Hedis

27

Scenario - Redis

Application server

Redis Database

(4)(2)

Client (1)(3

)

Page 28: Lightning Hedis

28

Scenario - Redis

Application server

Redis Database

(4)(5)(2)

Client (1)(3

)

Page 29: Lightning Hedis

29

Scenario - Redis

Application server

Redis Database

(6) (4)(5)(2)

Client (1)(3

)

Page 30: Lightning Hedis

30

Scenario - Redis

Application server

Redis Database

(6) (4)(5)(2)

Client (7)(1)

(3)

Page 31: Lightning Hedis

31

Hedis 應用情境

Page 32: Lightning Hedis

32

Scenario - Hedis

Application server

Hedis Database

Client

Page 33: Lightning Hedis

33

Scenario - Hedis

Application server

Hedis Database

Client(1)

Page 34: Lightning Hedis

34

Scenario - Hedis

Application server

Hedis Database

Client

(2)

(1)

Page 35: Lightning Hedis

35

Scenario - Hedis

Application server

Hedis Database

Client

(2)

(3)

(1)

Page 36: Lightning Hedis

36

Scenario - Hedis

Application server

Hedis Database

Client

(2)

(3)

(4)

(1)

Page 37: Lightning Hedis

37

Scenario - Hedis

Application server

Hedis Database

Client

(2)

(3)

(4)

(5)

(1)

Page 38: Lightning Hedis

38

Scenario - Hedis

Application server

Hedis Database

Client

(2)

(3)

(4)

(5)

(1)

(6)

Page 39: Lightning Hedis

39

How to use

Page 40: Lightning Hedis

40

Configuration

Page 41: Lightning Hedis

41

Run

Page 42: Lightning Hedis

42

所以

Page 43: Lightning Hedis

43

HadoopCon 2015Hedis (aka Hyper Redis) 是改良自 Redis 的 NoSQL 資料庫,一般使用 Redis 這類 In-memory database 的情境大都在於讀取熱門資料 ( 例:熱門文章、 token 認證 ... 等 ) 。以熱門文章為例, client 要跟 server 讀取熱門文章時, server 會先去 Redis 問是否有熱門文章存在這裡,如果有的話就直接讀取並回傳給 client ;但如果沒有的話 server 就要改去 source database 讀取原資料,一方面把資料寫回 Redis ,另一方面回傳給 client 。而 Hedis 則是改良了上述的情境。一樣以熱門文章為例, client 要跟 server 讀取熱門文章時, server 會去 Hedis 問是否有熱門文章存在這裡,如果沒有的話 Hedis 就會直接去 source database 讀取原資料,並把資料寫回 Hedis 之後再回傳給 client ,減少不必要的傳輸路徑。這場 Talk 就是介紹 Hedis 如何達到上面的情境,並且教導大家如何使用現有的 Redis client 直接操作 Hedis ,讓已經無法再透過 In-memory database 加速的應用,再加速存取一個等級。

Page 44: Lightning Hedis

44

可想而知

Page 45: Lightning Hedis

45

Hedis everywhere

Page 46: Lightning Hedis

46

Hedis everywhere

● MySQL conf 2015

Page 47: Lightning Hedis

47

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015

Page 48: Lightning Hedis

48

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015● MongoDB conf 2015

Page 49: Lightning Hedis

49

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015● MongoDB conf 2015● Cassandra conf 2015

Page 50: Lightning Hedis

50

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015● MongoDB conf 2015● Cassandra conf 2015● Oracle conf 2015

Page 51: Lightning Hedis

51

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015● MongoDB conf 2015● Cassandra conf 2015● Oracle conf 2015● MSSQL conf 2015

Page 52: Lightning Hedis

52

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015● MongoDB conf 2015● Cassandra conf 2015● Oracle conf 2015● MSSQL conf 2015● ......

Page 53: Lightning Hedis

53

Hedis everywhere

● MySQL conf 2015● PostgreSQL conf 2015● MongoDB conf 2015● Cassandra conf 2015● Oracle conf 2015● MSSQL conf 2015● ......

請 蔡英文 放過 Hedis

by 超後悔投柯 P 的kewang@ 新莊

Page 54: Lightning Hedis

54

TODO

Page 55: Lightning Hedis

55

TODO

● Memory leak ( 慣 C 真的好難寫 Orz )● 支援多資料庫● 支援多版本 Redis● 支援模組 git 化● 單點故障 ( 感謝 Triton Ho 指導 )

Page 56: Lightning Hedis

56

最後

Page 57: Lightning Hedis

57

We need you

Page 58: Lightning Hedis

58

No, in fact

Page 59: Lightning Hedis

59

I need you orz

Page 60: Lightning Hedis

60

http://hedis.io