5. Redis.io
keys can expire
master-slave
in memory dataset
persistence
Data Structure
- String
- Integer (mainly for counting)
- List
- Set
- Ordered set
- Hash stored list
6. Don't do this !!
rs = redis.Redis()
rs.keys('*')
- time complexity O(n)
- 10^6 keys database in 40 msec.
- IT MAY RUIN PERFORMANCES
7. Best practices
SADD SERVICES [QOL, S24, PROF]
HSET SERVICE:QOL expire 60
HSET SERVICE:QOL max_count 1
HSET SERVICE:QOL:bob max_count 3
ZADD ACTIVITY:QOL:bob:20121010 '14:50 Login' 1450
ZADD ACTIVITY:QOL:bob:20121010 '15:15 Logout' 1515
ZRANGE ACTIVITY:QOL:bob:20121010 1200, 1600 O(log(N) + M)
(N: # of elements in the sorted set. M: # of element returned)
list
objects
scores
8. Flask
> micro-framework for python
> builtin server
> RESTful request dispatching
> WSGI compliant
> integrated support for unit testing