SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Enhancing Scalability
With Intelligent Caching
By Eric Ritchie (eric@zend.com)




                                  © All rights reserved. Zend Technologies, Inc.
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.
Why am I here?

• Most caching is badly implemented
• Allow me to explain...




                      © All rights reserved. Zend Technologies, Inc.
Hey, it works!
• A new website is born...




                                  Internet



LAMP Server




                      © All rights reserved. Zend Technologies, Inc.
...or at least it used to work.
• the smoke begins...




                                    Internet



LAMP Server




                        © All rights reserved. Zend Technologies, Inc.
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.
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.
Page Caching




               © All rights reserved. Zend Technologies, Inc.
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.
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.
One common architecture
• Network data cache
  e.g. Memcache



 Internet                                                               DB Server(s)


                LB


                                                                         Cache
                                                                         Server
                                                    Web Farm


                       © All rights reserved. Zend Technologies, Inc.
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.
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.
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.
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 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.
Distributed de-caching
• With Zend Server‘s Job Queue




• ...and the job itself




                          © All rights reserved. Zend Technologies, Inc.
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.
So long...

• …and thanks for all the fish.




                       © All rights reserved. Zend Technologies, Inc.
Enhancing Scalability
With Intelligent Caching
By Eric Ritchie (eric@zend.com)




                                  © All rights reserved. Zend Technologies, Inc.

Más contenido relacionado

La actualidad más candente

Breaking IO Performance Barriers: Scalable Parallel File System for AWS
Breaking IO Performance Barriers: Scalable Parallel File System for AWSBreaking IO Performance Barriers: Scalable Parallel File System for AWS
Breaking IO Performance Barriers: Scalable Parallel File System for AWSAmazon Web Services
 
Planning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationPlanning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationLai Yoong Seng
 
Bcache and Aerospike
Bcache and AerospikeBcache and Aerospike
Bcache and AerospikeAnshu Prateek
 
Right-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual MachineRight-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual Machineheraflux
 
Scalable Resilient Web Services In .Net
Scalable Resilient Web Services In .NetScalable Resilient Web Services In .Net
Scalable Resilient Web Services In .NetBala Subra
 
Scaling Out Tier Based Applications
Scaling Out Tier Based ApplicationsScaling Out Tier Based Applications
Scaling Out Tier Based ApplicationsYury Kaliaha
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data centerHoward Marks
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Andrew Miller
 
As fast as a grid, as safe as a database
As fast as a grid, as safe as a databaseAs fast as a grid, as safe as a database
As fast as a grid, as safe as a databasegojkoadzic
 
Choosing right data store & processing
Choosing right data store & processingChoosing right data store & processing
Choosing right data store & processingGovind Kanshi
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Web20expo Filesystems
Web20expo FilesystemsWeb20expo Filesystems
Web20expo Filesystemsroyans
 
Backup and Archiving in the AWS Cloud
Backup and Archiving in the AWS CloudBackup and Archiving in the AWS Cloud
Backup and Archiving in the AWS CloudAmazon Web Services
 
Storage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, WhiptailStorage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, WhiptailInternet World
 
Hybrid Storage Pools (Now with the benefit of hindsight!)
Hybrid Storage Pools (Now with the benefit of hindsight!)Hybrid Storage Pools (Now with the benefit of hindsight!)
Hybrid Storage Pools (Now with the benefit of hindsight!)ahl0003
 
09 yong.luo-ceph in-ctrip
09 yong.luo-ceph in-ctrip09 yong.luo-ceph in-ctrip
09 yong.luo-ceph in-ctripYong Luo
 
HBase: Extreme makeover
HBase: Extreme makeoverHBase: Extreme makeover
HBase: Extreme makeoverbigbase
 

La actualidad más candente (19)

Breaking IO Performance Barriers: Scalable Parallel File System for AWS
Breaking IO Performance Barriers: Scalable Parallel File System for AWSBreaking IO Performance Barriers: Scalable Parallel File System for AWS
Breaking IO Performance Barriers: Scalable Parallel File System for AWS
 
Planning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationPlanning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft Virtualization
 
Bcache and Aerospike
Bcache and AerospikeBcache and Aerospike
Bcache and Aerospike
 
Right-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual MachineRight-Sizing your SQL Server Virtual Machine
Right-Sizing your SQL Server Virtual Machine
 
Scalable Resilient Web Services In .Net
Scalable Resilient Web Services In .NetScalable Resilient Web Services In .Net
Scalable Resilient Web Services In .Net
 
Scaling Out Tier Based Applications
Scaling Out Tier Based ApplicationsScaling Out Tier Based Applications
Scaling Out Tier Based Applications
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data center
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
 
IaaS for DBAs in Azure
IaaS for DBAs in AzureIaaS for DBAs in Azure
IaaS for DBAs in Azure
 
As fast as a grid, as safe as a database
As fast as a grid, as safe as a databaseAs fast as a grid, as safe as a database
As fast as a grid, as safe as a database
 
Choosing right data store & processing
Choosing right data store & processingChoosing right data store & processing
Choosing right data store & processing
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Web20expo Filesystems
Web20expo FilesystemsWeb20expo Filesystems
Web20expo Filesystems
 
Backup and Archiving in the AWS Cloud
Backup and Archiving in the AWS CloudBackup and Archiving in the AWS Cloud
Backup and Archiving in the AWS Cloud
 
Storage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, WhiptailStorage and performance- Batch processing, Whiptail
Storage and performance- Batch processing, Whiptail
 
Hybrid Storage Pools (Now with the benefit of hindsight!)
Hybrid Storage Pools (Now with the benefit of hindsight!)Hybrid Storage Pools (Now with the benefit of hindsight!)
Hybrid Storage Pools (Now with the benefit of hindsight!)
 
09 yong.luo-ceph in-ctrip
09 yong.luo-ceph in-ctrip09 yong.luo-ceph in-ctrip
09 yong.luo-ceph in-ctrip
 
HBase: Extreme makeover
HBase: Extreme makeoverHBase: Extreme makeover
HBase: Extreme makeover
 

Similar a Enhancing scalability with intelligent caching

Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend serverEric Ritchie
 
High performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructureHigh performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructuremkherlakian
 
PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud  PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud RightScale
 
Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)Andrejs Prokopjevs
 
Data center Technologies
Data center TechnologiesData center Technologies
Data center TechnologiesEMC
 
EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...
EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...
EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...Brian Boyd
 
The HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple PlatformsThe HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple PlatformsThe Linux Foundation
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructurexKinAnx
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructuresolarisyourep
 
Docker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. ServerlessDocker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. ServerlessLogicworksNY
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Amazon Web Services
 
Scaling AEM (CQ5) Gem Session
Scaling AEM (CQ5) Gem SessionScaling AEM (CQ5) Gem Session
Scaling AEM (CQ5) Gem SessionMichael Marth
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcachedJurriaan Persyn
 
In-Memory Databases, Trends and Technologies (2012)
In-Memory Databases, Trends and Technologies (2012)In-Memory Databases, Trends and Technologies (2012)
In-Memory Databases, Trends and Technologies (2012)Vilho Raatikka
 
Backup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix BarbeiraBackup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix BarbeiraCeph Community
 
Scalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCMScalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCMZend by Rogue Wave Software
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matterTomas Doran
 

Similar a Enhancing scalability with intelligent caching (20)

Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend server
 
High performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructureHigh performance PHP: Scaling and getting the most out of your infrastructure
High performance PHP: Scaling and getting the most out of your infrastructure
 
PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud  PHP Apps on the Move - Migrating from In-House to Cloud
PHP Apps on the Move - Migrating from In-House to Cloud
 
Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)
 
Data center Technologies
Data center TechnologiesData center Technologies
Data center Technologies
 
EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...
EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...
EMC Symmetrix VMAX: An Introduction to Enterprise Storage: Brian Boyd, Varrow...
 
The HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple PlatformsThe HaLVM: A Simple Platform for Simple Platforms
The HaLVM: A Simple Platform for Simple Platforms
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
 
Docker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. ServerlessDocker vs. Kubernetes vs. Serverless
Docker vs. Kubernetes vs. Serverless
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
 
Scaling AEM (CQ5) Gem Session
Scaling AEM (CQ5) Gem SessionScaling AEM (CQ5) Gem Session
Scaling AEM (CQ5) Gem Session
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
In-Memory Databases, Trends and Technologies (2012)
In-Memory Databases, Trends and Technologies (2012)In-Memory Databases, Trends and Technologies (2012)
In-Memory Databases, Trends and Technologies (2012)
 
Backup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix BarbeiraBackup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
Backup management with Ceph Storage - Camilo Echevarne, Félix Barbeira
 
Scalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCMScalable High-Availability Session Storage with ZSCM
Scalable High-Availability Session Storage with ZSCM
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
PaaS with Java
PaaS with JavaPaaS with Java
PaaS with Java
 
Performance tuning PHP on IBMi
Performance tuning PHP on IBMiPerformance tuning PHP on IBMi
Performance tuning PHP on IBMi
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
 

Enhancing scalability with intelligent caching

  • 1. Enhancing Scalability With Intelligent Caching By Eric Ritchie (eric@zend.com) © All rights reserved. Zend Technologies, Inc.
  • 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. Why am I here? • Most caching is badly implemented • Allow me to explain... © All rights reserved. Zend Technologies, Inc.
  • 4. Hey, it works! • A new website is born... Internet LAMP Server © All rights reserved. Zend Technologies, Inc.
  • 5. ...or at least it used to work. • the smoke begins... Internet LAMP Server © All rights reserved. Zend Technologies, Inc.
  • 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. 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. Page Caching © All rights reserved. Zend Technologies, Inc.
  • 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. 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. 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. 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. 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. 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. Demo... The Great Cache Performance Head to Head © All rights reserved. Zend Technologies, Inc.
  • 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. Distributed de-caching • With Zend Server‘s Job Queue • ...and the job itself © All rights reserved. Zend Technologies, Inc.
  • 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. So long... • …and thanks for all the fish. © All rights reserved. Zend Technologies, Inc.
  • 20. Enhancing Scalability With Intelligent Caching By Eric Ritchie (eric@zend.com) © All rights reserved. Zend Technologies, Inc.