Enhancing ScalabilityWith Intelligent CachingBy Eric Ritchie (eric@zend.com)                                  © All rights...
Eric Ritchie bids you welcome!• Senior Technical Consultant and Trainer  at Zend Technologies• Zend Framework and PHP 5.3 ...
Why am I here?• Most caching is badly implemented• Allow me to explain...                      © All rights reserved. Zend...
Hey, it works!• A new website is born...                                  InternetLAMP Server                      © All r...
...or at least it used to work.• the smoke begins...                                    InternetLAMP Server               ...
No simple solutions• Migrating to web clusters:   Classical horizontal scaling   Complicates and imbalances application ...
Page Caching• Dramatic reduction in page delivery time   Reduces the need for expansive server farms   Quick and inexpen...
Page Caching               © All rights reserved. Zend Technologies, Inc.
Data caching• Protects the data layer:   Classical vertical scaling   Far easier than scaling the database• But...   Re...
Let‘s get controversial...• Caching is a divisive topic• Let me share my experience of...   Providing a highly available ...
One common architecture• Network data cache  e.g. Memcache Internet                                                       ...
Network data cache• Some advantages  Only one cache to update/invalidate  Most effective way of protecting the data sour...
A different approach• Shared memory cache                                    Cache  e.g. Zend Data Cache, APC             ...
Shared memory cache• Many advantages  Completely scalable (copy/paste architecture)  No single point of failure  Does n...
Demo...  The Great Cache Performance  Head to Head                 © All rights reserved. Zend Technologies, Inc.
Shared memory cache• Taming the disadvantages  True, we need to work a little, but...    • We can use Zend Server‘s Job Q...
Distributed de-caching• With Zend Server‘s Job Queue• ...and the job itself                          © All rights reserved...
Shared memory cache on steroids• Don‘t decache, update  Regenerate the data and insert into the cache  At a minimum do t...
So long...• …and thanks for all the fish.                       © All rights reserved. Zend Technologies, Inc.
Enhancing ScalabilityWith Intelligent CachingBy Eric Ritchie (eric@zend.com)                                  © All rights...
Upcoming SlideShare
Loading in …5
×

Enhancing scalability with intelligent caching

513 views

Published on

As applications grow in popularity, or after successful marketing efforts, increased traffic can cause problems for application servers. Caching is a relatively inexpensive and quick solution to the problem however, if implemented badly, can easily become a new bottleneck or even a point of failure. This session will demonstrate how to design a caching layer that will enhance scalability rather than fetter it.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
513
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Enhancing scalability with intelligent caching

  1. 1. Enhancing ScalabilityWith Intelligent CachingBy Eric Ritchie (eric@zend.com) © All rights reserved. Zend Technologies, Inc.
  2. 2. Eric Ritchie bids you welcome!• Senior Technical Consultant and Trainer at Zend Technologies• Zend Framework and PHP 5.3 ZCE• Eighteen years of system administration experience• Twelve years of PHP (3,4 & 5) and five years Zend Framework development experience• Hobbies: Sampling good wines/whiskies (gifts welcome) © All rights reserved. Zend Technologies, Inc.
  3. 3. Why am I here?• Most caching is badly implemented• Allow me to explain... © All rights reserved. Zend Technologies, Inc.
  4. 4. Hey, it works!• A new website is born... InternetLAMP Server © All rights reserved. Zend Technologies, Inc.
  5. 5. ...or at least it used to work.• the smoke begins... InternetLAMP Server © All rights reserved. Zend Technologies, Inc.
  6. 6. No simple solutions• Migrating to web clusters:  Classical horizontal scaling  Complicates and imbalances application architecture  Moves bottlenecks over to the DB (usually)• Scaling DB architecture:  Potentially expensive  Or complicates the application (sharding)  And/or replication issues• Let‘s just cache something... That‘ll work © All rights reserved. Zend Technologies, Inc.
  7. 7. Page Caching• Dramatic reduction in page delivery time  Reduces the need for expansive server farms  Quick and inexpensive (perhaps)• But...  Custom data is problematic one way or the other  Complicates the application  Risk of delivering stale content  Dependency on caching usually a recipe for disaster © All rights reserved. Zend Technologies, Inc.
  8. 8. Page Caching © All rights reserved. Zend Technologies, Inc.
  9. 9. Data caching• Protects the data layer:  Classical vertical scaling  Far easier than scaling the database• But...  Requires code changes  Custom data is still problematic  Risk of delivering stale content  De-caching can bring down the database © All rights reserved. Zend Technologies, Inc.
  10. 10. Let‘s get controversial...• Caching is a divisive topic• Let me share my experience of...  Providing a highly available cache  Providing a truly scalable cache  Providing a high performance cache  Preventing a run on the database  Ensuring fresh data resides in cache• Remember, don‘t kill me!  This is not the only way  © All rights reserved. Zend Technologies, Inc.
  11. 11. One common architecture• Network data cache e.g. Memcache Internet DB Server(s) LB Cache Server Web Farm © All rights reserved. Zend Technologies, Inc.
  12. 12. Network data cache• Some advantages  Only one cache to update/invalidate  Most effective way of protecting the data source• Many disadvantages...  Single point of failure (or uncertainty when in distributed mode)  Limits scalability  Performance bottleneck  Slower © All rights reserved. Zend Technologies, Inc.
  13. 13. A different approach• Shared memory cache Cache e.g. Zend Data Cache, APC Cache Internet DB Server(s) X LB Cache Cache Server Web Farm © All rights reserved. Zend Technologies, Inc.
  14. 14. Shared memory cache• Many advantages  Completely scalable (copy/paste architecture)  No single point of failure  Does not require TCP/IP  Very fast• Some disadvantages...  Not the path of least resistance  More work for the data source and the developer  Your colleagues may laugh at you (but they would be wrong) © All rights reserved. Zend Technologies, Inc.
  15. 15. Demo... The Great Cache Performance Head to Head © All rights reserved. Zend Technologies, Inc.
  16. 16. Shared memory cache• Taming the disadvantages  True, we need to work a little, but... • We can use Zend Server‘s Job Queue to perform remote cache maintenance • We can get a list of active servers from the Web API provided by Zend Server • Really, we don‘t have to code much ourselves © All rights reserved. Zend Technologies, Inc.
  17. 17. Distributed de-caching• With Zend Server‘s Job Queue• ...and the job itself © All rights reserved. Zend Technologies, Inc.
  18. 18. Shared memory cache on steroids• Don‘t decache, update  Regenerate the data and insert into the cache  At a minimum do this for all components of the index page  Reduces data source load © All rights reserved. Zend Technologies, Inc.
  19. 19. So long...• …and thanks for all the fish. © All rights reserved. Zend Technologies, Inc.
  20. 20. Enhancing ScalabilityWith Intelligent CachingBy Eric Ritchie (eric@zend.com) © All rights reserved. Zend Technologies, Inc.

×