Memcache架构

来源:互联网 发布:gps地图编辑软件 编辑:程序博客网 时间:2024/05/22 00:06


A basic memcached lookup can be illustrated in the example below with Clients X, Y, Z and
Servers A, B, C. 

‘Set’ the Key and Value 

• Client X wants to set the key “foo” with value “seattle”
• Client X takes the list of available memcached servers (A,B,C) and hashes the key against them
• Server B is selected
• Client X directly connects to Server B, and sets key “foo” with the value “seattle”

‘Get’ the Key and Value

• Client Z wants to get key “foo”
• Client Z is able to use the same hashing process to determine that key “foo” is on Server B
• Client Z directly requests key “foo” from Server B and gets back “seattle”
• Subsequent requests from Clients X, Y or Z for key “foo” will access the data directly from Server B 

0 0