Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Basics of Memcached - Introduction


Published on

This presentation basically deals with the concepts of memCached. The focus of this presentation is only discussing about theory of memCached.How to implement it and how to configure it.

if you want to stick with ACID properties and you want to scale your system definitely Memcached is the right candidate.

This presentation was presented by Prashant Prakash, a Sr. Software Engineer in Samsung.

Published in: Technology
  • Be the first to comment

Basics of Memcached - Introduction

  1. 1. Because fetching data from disk is too expensive
  2. 2.  Rise of the Dynamic Web  Web Architecture  What is MemCached  Theory Of Caching  How MemCached works  Evolution of Dynamic Web  Scaling  Traditional Vs MemCached
  3. 3.  The WEB : What’s Changed?  Population  Traffic  Content and Applications
  4. 4.  Most Sites (over 65%) based on LAMP or JAVA.  Shift to dynamic content put strain on origin sites.
  5. 5.  Complex a high performance ,distributed memory object caching ,generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.  Simple a really big ,platform independent ,dictionary like object that lives in memory and can be intelligently sliced across multiple computers.
  6. 6.  It uses consistent Hashing Technique to find the appropriate server where the data is residing or where the data has to be cached.  Consistent Hashing : ◦ server =serverlist[hash(key)%serverlist.length]
  7. 7.  Pros ◦ If one server goes down , all of its request move on to the next server. ◦ Seamlessly add new servers.  Cons ◦ Hashes distribute mostly evenly ,but could cluster.  Split servers into multiple sub-server nodes.
  8. 8.  It scales horizontally. ◦ More servers create more capacity. ◦ No single point failure.
  9. 9.  There are other distributed cache like : • EHCache • OSCache • JBossCache THEN WHY DO WE NEED MEMCACHED? The only reason is that memCached is ourely distributed with dedicated servers for caching . It does not rum with application server.
  10. 10.  Data is Stored in memory ,not disk.  I/O is non-blocking(asynchronous)  epoll() instead of poll for network event loop.  It’s distributed.
  11. 11.  accessed with sql .  Persistent.  Replicated.  Secure..
  12. 12.  A single entry cannot be larger than 1mb.  Keys are limited to 250 Characters.  Cache Algorithm is LRU. Key Size = 250 bytes Value Size = 1 Mbytes
  13. 13.  In General ◦ Cache everything that is slow to query ,fetch or calculate.  Some use cases ◦ Ideal for complex objects that are read several times. ◦ Keeps the current state of application in Cache. ◦ Cache directly displayable page elements.
  14. 14.  Shard MySQL to handle high write loads , cache objects in memcached to handle high read laods, and then write lot of glue code to make it all work together.
  15. 15.  The main limitations of the current Memcached implementations are the lack of support for : ◦ Write Scalability ◦ High Availability  With a little perspective its clear that MySQL+Memcached era is passing. ◦
  16. 16.  Whatever written in previous slide is really an observation about industry trends and isn’t meant to attack any technology  If we are using RDBMS and we want to scale out the application then Memcached is the right Candidate. In Simple , If we need ACID properties we need MemCached for scaling.