K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated...
-
Upload
phillip-wood -
Category
Documents
-
view
212 -
download
0
Transcript of K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated...
![Page 1: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/1.jpg)
KALI ROHAN KOKA
AZEEM HIRANI
REDIS(Remote dictionary server)
![Page 2: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/2.jpg)
A Simple database Implementing a Dictionary where keys are associated with values.
For e.g.: It can set the key “surname_1987” to the string “Rohan”.
It is open sourced. First released in March 2009.Redis takes entire dataset in memory. Dump of
dataset is created and loaded whenever server is restarted.
Speed is the key feature. Estimated 80000+ operations per second at least
WHAT IS REDIS
![Page 3: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/3.jpg)
Values can be associated with:Strings – Binary safe so they can hold
text, images, compressed data, etc.Lists – Lists of Strings for operations
like append, list length, range of elements, sorting of lists
Sets – Addition and deletion of elements from a set, Intersection, union, subtraction, etc.
Zsets – Zadd, Zrange, Zscore, Zcard
Redis data types
![Page 4: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/4.jpg)
Some features like those of Memcached:
All data lives in the memory.Faster, Light weightData exists in the memorySupport Multiple databasesSupport for Integer countersAtomic operations
Similarities with memcached
![Page 5: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/5.jpg)
Memcached is not persistent.Memcached does not save as the purpose is
to be used only as a cache.Redis has capability of being used as main DB
for the application.Memcached uses key value model like Redis
but keys can be just string.In Redis, values can be Lists, Sets, Zsets.
Differences with memcached
![Page 6: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/6.jpg)
Strings- get, set, increment, decrement
Lists- push, pop, length, range, trim
Sets- add, remove, move, length, intersect, intersect
Some more commands useful – save, lastsave (can be used to force and verify disk persistance)
Overview of Commands
![Page 7: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/7.jpg)
These type of commands operate on database. They do not operate on individual keys.
SELECTMOVEFLUSHALLSHUTDOWNSLAVEOFDBSIZEINFOMONITOR
Database Commands
![Page 8: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/8.jpg)
Pick your own Level.
Redis supports Persistence
Replication – Works as a master slave
Publish/Subscribe
Advantages of using REDIS
![Page 9: K ALI ROHAN KOKA AZEEM HIRANI. A Simple database Implementing a Dictionary where keys are associated with values. For e.g.: It can set the key “surname_1987”](https://reader036.fdocuments.us/reader036/viewer/2022072006/56649cfa5503460f949cc1b9/html5/thumbnails/9.jpg)
Unreliable
Indexes take a lot of RAM.
Disadvantages