Skip to content

Commit

Permalink
update doc on cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jobs committed Aug 23, 2016
1 parent e47ab4e commit c86fdfa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hustdb/doc/doc/advanced/ha/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
[uri]
uri: ip:port
[action]
put | get | del | exist |
hset | hget | hdel | hexist |
put | get | get2 | del | exist |
hset | hget | hget2 |hdel | hexist |
sadd | srem | sismember |
zadd | zrem | zismember | zscore |
stat_all | sync_status | get_table | loop
zadd | zrem | zismember | zscore | zscore2 |
cache_exist | cache_get | cache_ttl |
cache_put | cache_append | cache_del | cache_expire |
cache_hexist | cache_hget | cache_hset | cache_hdel |
cache_hincrby | cache_hincrbyfloat |
stat_all | sync_status | sync_alive | get_table | loop
sample:
python autotest.py localhost:8082 loop
python autotest.py localhost:8082 stat_all
Expand Down
3 changes: 3 additions & 0 deletions hustdb/doc/doc/api/ha.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ ha
* 综合比较,`get2` 获取的数据是强一致的,但由于需要串行访问 `master1``master2`,因此 `QPS` 会比 `get` 低很多;`get` 获取的数据是弱一致的,但由于大部分情况下它只需要访问 `master1` 即可拿到数据,因此 `QPS` 会比 `get2` 高很多。
* 结论:`get`**弱一致性,高 `QPS`**`get2`**强一致性,低 `QPS`** 。如果业务需要保证数据的强一致性,同时对吞吐量没有很高的要求,可以选用 `get2`,例如金融类业务;如果业务需要很高的吞吐量,可以忍受部分读取数据的不一致,则 `get` 更合适,例如商品信息展示。

* 关于 `cache`
`cache` 相关的接口,数据均存储在内存中, **不会持久化到硬盘** 。其他的接口,数据会持久化到硬盘。

[上一级](index.md)

[根目录](../index.md)
3 changes: 3 additions & 0 deletions hustdb/doc/doc/appendix/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ FAQ

**Q** : `hustdb ha` 的接口中 `get``get2``hget``hget2``zscore``zscore2` 有什么差别?
**A** : 参考 [这里](../api/ha.md)

**Q** : `hustdb ha` 的接口中 `/cache/xxx``/xxx` 的差别是什么?例如 `/cache/put``put`
**A** : 参考 [这里](../api/ha.md)

[上一级](index.md)

Expand Down

0 comments on commit c86fdfa

Please sign in to comment.