Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 502 Bytes

Transaction-style-in-Redis.md

File metadata and controls

25 lines (19 loc) · 502 Bytes
  • Date : 2018-01-31
  • Tags : #redis #transaction

Transaction style in Redis

In Redis, you can use transaction-style (mean queue commands then flush it once). It will improve performance in many case where latency or networking is slow.

> SET hoge 2
OK
> MULTI
OK
> INCR foo
QUEUED
> INCR hoge
QUEUED
> EXEC
1) (integer) 1
2) (integer) 1

MULTI command is begin transaction and EXEC command is commit transaction

The result will be returned in order your command queue list.