Redis
1) What is Redis?
-Open source in-memory data structure store which can be used as a database and/or a cache and message broker
-NoSQL Key/Value Store
-Supports Multiple Data Structures
-Built In Replication
2) Redis Datatypes
-String
-Lists - lists of string
-Sets - unordered collection of string
-Stored Sets - non repeated selections of strings
-Hashes - key value pairs
-Bitmaps
-Hyperlogs
-Geospatial Indexes
3) Advantages Of Redis
-Very Flexible
-No Schemas & Column Names
-Very Fast: Can perform around 110,000 SETs per second, about 81,000 GETs per second
-Rich Datatype Support
-Caching & Disk Persistence
4) Wha can Redis be used with?
-ActionScript
-Common Lisp
-emacs lisp
-Haskell
-Lua
-OCami
-R
-Scheme
-Bash
-Crystal
-Erlang
-Haxe
-Matlab
-Pascal
-Racket
-Smalltalk
-C
-D
-Fancy
-lo
-mruby
-Perl
-Rebol
-Swift
-C#
-Dart
-gawk
-Java
-nim
-PHP
-Ruby
-Tcl
-C++
-Delphi
-GNU Prolog
-Julia
-node.js
-Pure Data
-Rust
-VB
-Clojure
-Elixir
-Go
-Lasso
-Objective-C
-Python
-Scala
-VCL
5) Redis & Security
-Designed to be accessed by trusted clients
-Do not allow external access/ Internet exposoure
-Simple authentication can be setup
-Can be restricted to certain interfaces
-Data encryption not supported
6) Ubuntu install
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server
cp /etc/redis.redis.conf /etc/redis/redis.conf.default
7) Redis cli
redis-cli
default port 6379
ping //output pong
ECHO 'Hello World
Quit - close connection
SET foo 100
SET bar "Hello World"
GET foo
INCR foo //output 101
DECR foo /output 100
ExistS foo /output 1 or 0
DEL bar //remove var
FFLUSHALL // usunąć wszystko
SET server:name someserver
SET server:port 8000
//set experiation
SET greeting "Hrello world"
GET greeting
EXPIRE greeting 50 /// expire in 50s
TTL greeting /shows how . many seconds till expire
SETEX greeting 30 "Helloworld "/var greeting will expire in 30 s
PERSIST greeting // wycofanie EXPIRE
MSET key "Hello" key2 "world"// setting set key-value
APPEND key1 " world"
RENAME key1 greeting
8) Lists
-Open source in-memory data structure store which can be used as a database and/or a cache and message broker
-NoSQL Key/Value Store
-Supports Multiple Data Structures
-Built In Replication
2) Redis Datatypes
-String
-Lists - lists of string
-Sets - unordered collection of string
-Stored Sets - non repeated selections of strings
-Hashes - key value pairs
-Bitmaps
-Hyperlogs
-Geospatial Indexes
3) Advantages Of Redis
-Very Flexible
-No Schemas & Column Names
-Very Fast: Can perform around 110,000 SETs per second, about 81,000 GETs per second
-Rich Datatype Support
-Caching & Disk Persistence
4) Wha can Redis be used with?
-ActionScript
-Common Lisp
-emacs lisp
-Haskell
-Lua
-OCami
-R
-Scheme
-Bash
-Crystal
-Erlang
-Haxe
-Matlab
-Pascal
-Racket
-Smalltalk
-C
-D
-Fancy
-lo
-mruby
-Perl
-Rebol
-Swift
-C#
-Dart
-gawk
-Java
-nim
-PHP
-Ruby
-Tcl
-C++
-Delphi
-GNU Prolog
-Julia
-node.js
-Pure Data
-Rust
-VB
-Clojure
-Elixir
-Go
-Lasso
-Objective-C
-Python
-Scala
-VCL
5) Redis & Security
-Designed to be accessed by trusted clients
-Do not allow external access/ Internet exposoure
-Simple authentication can be setup
-Can be restricted to certain interfaces
-Data encryption not supported
6) Ubuntu install
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server
cp /etc/redis.redis.conf /etc/redis/redis.conf.default
7) Redis cli
redis-cli
default port 6379
ping //output pong
ECHO 'Hello World
Quit - close connection
SET foo 100
SET bar "Hello World"
GET foo
INCR foo //output 101
DECR foo /output 100
ExistS foo /output 1 or 0
DEL bar //remove var
FFLUSHALL // usunąć wszystko
SET server:name someserver
SET server:port 8000
//set experiation
SET greeting "Hrello world"
GET greeting
EXPIRE greeting 50 /// expire in 50s
TTL greeting /shows how . many seconds till expire
SETEX greeting 30 "Helloworld "/var greeting will expire in 30 s
PERSIST greeting // wycofanie EXPIRE
MSET key "Hello" key2 "world"// setting set key-value
APPEND key1 " world"
RENAME key1 greeting
8) Lists
Komentarze
Prześlij komentarz