22. plain text
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize no
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
pidfile /var/run/redis.pid
# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379
# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
# bind 127.0.0.1
# Specify the path for the unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket /tmp/redis.sock
# unixsocketperm 755
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
# Set server verbosity to 'debug'
# it can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel notice
31. Cache Store
https://github.com/jodosha/redis-store
Session Store
https://github.com/mattmatt/redis-session-store
Counters
stats, API requests per hour, DoS, Spam
Kiwi accent, still lose me on the phone\n#bedrooms instead of square meters\nThanks, Driver!\n
Salvatore Sanfilippo, Pieter Noordhuis, Paul Maritz, Jose Valim, DHH\nthey have something in common\n
\n
\n
NoSQL, REmote DIctionary Server, written in C, single-threaded, all data in memory\n\n...like memcached\n
advanced data structures\npersistence\n
supports advanced data structures\nbut not THAT advanced \n
set-based queries, but not with that highly sophisticated selects or joins or type-supporting\n
10.4.2009 initial release\n
Paul Maritz, CEO vmware\n
\n
\n
how fast is fast? (> 100,000 SETs per second)\n
following and respecting the Big O notation (describe limiting behaviour, and classify algorithms)\n
\n
maintainers care and are very responsive\n
\n
\n
brew install redis, apt packages, standard make\nport 6379\n- no major dependencies\n
\n
just kidding\n
with lots of comments\n
\n
lots of clients (redis-rb, hiredis-rb, em-redis)\nnerdy DSL, but follows a logic\nCONSOLE!!!\nhttp://try.redis-db.com/\n
\n
slaves are read-only by default\nnon-blocking for master (logging incoming commands)\nnon-blocking for slaves (just a short switch-over)\n\n
Redis Data Backup (+easier to backup, +fast recover, -may lose data, -fork() slow for bigdata)\nsave 900 1\nsave 300 10\nsave 60 10000\n
Append-Only File (+readable, +faster to write, -bigger file, maybe slower if writing too often)\nrun both!\n
Redis is designed to be accessed by trusted clients inside trusted environments\n-> bind to local address\n-> Auth is possible\n-> strings are not escaped in any way\n-> rename certain commands\n\n
\n
\n
based on Redis strings\nuseful for permanent links or when urls get too long\nor to obsfuscate urls\n\n
based on Redis hashes\n
based on Redis hashes\n\n\n
based on Redis lists (FIFO)\n
based on Redis sets\n\n\n
based on Redis sets with expire\n\n\n
based on Redis sorted sets\nwhere you update a lot of items at once\n\n
based on Redis sorted sets\nwhere you update a lot of items at once\n\n
based on Redis pubsub\n
based on Redis pubsub\n\n
based on Redis pubsub\n\n
based on Redis lists\nLTRIM makes sure the list doesn’t get longer\n\n\n
based on Redis sorted set, in combi with a Hash\n\n\n\n
in combination with sort\n\n\n
\n
\n
kept in memory\n100M entries => 16GB RAM\n
not seamless\n- short blockings when syncing with slaves\n- just one master\n
every node has some portion of the data\n- native cluster is in the works\n- redis-rb simulates this\n
don’t try to treat it that way, it’s not a replacement\n- data structures not flexible enough\n- queries not detailed enough\n