<php developing the App interface Video tutorials > Using PHP Object-oriented ideas to explain how to develop the application server-side interface, the course gradually, easy to understand, the key points of the technology to do a detailed explanation, through the course can let you learn how to open the App interface, you will benefit a lot.
Course Play Address: http://www.php.cn/course/404.html
The teacher's lecture style:
The teacher lively image, witty witty, witty, touching. A vivid image of the metaphor, like the finishing touch, to the students to open the door of wisdom, a proper sense of humor, attracting students to smile, such as drinking a cup of glycol wine, to the aftertaste and nostalgia, the philosopher's motto, culture of the proverbs from time and again interspersed in the middle, give people to think and alert.
The difficulty in this video is memcache and Redis cache technology:
Memcache
Memcache is a high performance, distributed memory object caching system that can be used to store data in a variety of formats, including images, videos, files, and database retrieval results, by maintaining a unified, huge hash table in memory. The simple thing is to call the data into memory and then read it from memory, which greatly improves the reading speed.
Memcache Features:
(1) The use of physical memory as a buffer, can be run independently on the server. Maximum 2G per process, if you want to cache more data, you can open up more memcache processes (different ports) or use distributed memcache for caching, caching data to different physical or virtual machines.
(2) Using Key-value method to store data, which is a single index structured data organization, can make the data item query time complexity of O (1).
(3) The protocol is simple: text line-based protocol, directly through telnet on the memcached server can access data operation, simple, convenient multiple cache reference this Protocol;
(4) High-performance communication based on Libevent: Libevent is a set of libraries developed using C, which encapsulates the Kqueue,linux system's Epoll and other event processing functions as an interface, which improves performance compared to traditional select.
(5) Built-in memory management: All data are stored in memory, access data faster than the hard disk, when the memory is full, the LRU algorithm automatically delete the unused cache, but does not consider the data disaster tolerance, restart the service, all data will be lost.
(6) Distributed: Each memcached server does not communicate with each other, independently access data, do not share any information. The server does not have distributed functionality, and distributed deployment depends on the Memcache client.
(7) Cache policy: Memcached's caching policy is the LRU (least recently used) expiration policy. When storing data items within a memcached, you can specify the expiration time of the cache, which is permanent by default. When the memcached server runs out of allocations, the invalidated data is replaced first, and then the data that is not used recently. In LRU, Memcached uses a lazy expiration policy that does not monitor the expiration of the key/vlue being deposited, but instead checks the timestamp of the record when it gets the key value, checking to see if Key/value is out of space, which reduces the load on the server.
Redis
Redis is an open source (BSD-licensed), memory-based, multi-data structure storage system. Can be used as database, cache, and message middleware. Supports multiple types of data structures such as strings (strings), hashes (hashes), lists (lists), collections (sets), ordered collections (sorted sets) and range queries, Bitmaps,hyperloglogs and Geo-spatial (geospatial) Index RADIUS query.
Built-in replication (replication), LUA scripting (LUA scripting), LRU driver events (LRU eviction), transactions (transactions), and different levels of disk persistence (persistence), High availability is provided through Redis Sentinel (Sentinel) and automatic Partitioning (Cluster) (Hi availability).
Redis Common data types
The most commonly used data types for Redis are the following:
String
Hash
List
Set
Sorted Set
Pub/sub
Transactions