Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 72 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
72
Dung lượng
1,15 MB
Nội dung
Presented by, Searle Oliveira Database Administrator Globo.com What is Redis? 02 Feb 2010
• DBA at Globo.com • Certified MySQL Associate ID 222572032 • Long time Linux/MySQL user • PHP OOP Developer • Beginner C programming • Redis Admin Project Owner About me
• What is Redis? • Redis x Memcached • Redis Persistence • Redis Replication • Sharding • Benchmark • Supported Languages • Quick Start • Commands • Study Case: twitter • Redis Admin Schedule
Redis is a advanced persistent keyvalue database, by Salvatore Antirez Sanfilippo, where every key is associated with a value. For example, Set the key "surname_1992" to the string "Smith". > SET surname_1992 “Smith” In other words, you can look at Redis as a data structures server. The essence of a keyvalue store is the ability to store some data, called value, inside a key. What is Redis?
It is similar to memcached but the dataset is not volatile. Values can be strings, exactly like in memcached, but also lists, sets, and ordered sets. All data types can be manipulated with atomic operations. Redis is free software released under the very liberal BSD license. Redis x Memcached
1. Redis encourages a column oriented style of programming data storage. No Transactions No ACID 2. Most DataGrids encourage an entity oriented style: Transational ACID A Map usually is a business object or database table. Constrained Tree Schemas are typical. Redis x Conventional KV
What makes Redis different from many other keyvalue storages, is that every single value has a type. The following types are supported: • Strings • Lists • Sets • Sorted Sets Data Types
The type of a value determines what operations (commands) are available for the value itself. For example, you can append elements to a list stored at the key "mypostlist" using the LPUSH or RPUSH command: > LPUSH mypostlist “Hello World!” Each command is performed through serverside atomic operations. Data Types
Redis loads and mantains the whole dataset into memory, but the dataset is persistent, since at the same time it is saved on disk, so that when the server is restarted data can be loaded back in memory. There are two kind of persistence supported: semi persistent mode (Snapshotting) and fully persistent mode (Append Only File). Data in memory, but saved on disk
Redis is very fast but at the same time persistent the whole dataset is taken in memory. • Semi persistent mode time to time save data on disc asynchronously. • Fully persistent mode alternatively every change is written into an append only file. Redis Persistences
. Beginner C programming • Redis Admin Project Owner About me
• What is Redis? • Redis x Memcached • Redis Persistence • Redis Replication • Sharding. All data types can be manipulated with atomic operations. Redis is free software released under the very liberal BSD license. Redis x Memcached
1. Redis encourages a column oriented style of