Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memcached & Redis CodeLab #35

Open
hackjutsu opened this issue May 19, 2017 · 2 comments
Open

Memcached & Redis CodeLab #35

hackjutsu opened this issue May 19, 2017 · 2 comments

Comments

@hackjutsu
Copy link
Member

hackjutsu commented May 19, 2017

课程代码

Hardware Speed

CPU

1GHz,

  • L1/L2/L3 Cache
  • 1 ns

Memory (Primary)

  • 1 us
    读取1mb, 250us

Hard Disk

  • SSD
    -- 1mb, 1ms
  • 传统
    -- 1 ms

Network

  • 美国 -- 欧洲 (round trip)
    -- 150ms
@hackjutsu hackjutsu changed the title Note Memcached & Redis CodeLab May 19, 2017
@wzzzzz
Copy link

wzzzzz commented May 23, 2017

python 的 list 类型数据作为value存储到memcached中,我用Java 取出的时候是如何指定类型的?我用Object的时候, 总是取出null。 For example:
python:
mc.set("key_a_b_c",["A","B","C"])
用python的话可以成功存储并取出。
但是用Java:
Object obj = mc.get("key_a_b_c") obj 总是null。 如果用其他类型, 就会抛出异常。

@hackjutsu
Copy link
Member Author

@wzzzzz

建议采用language neutral的序列化方法来存储数据(比如JSON)。(Java未必能够识别Python使用的序列化方法)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants