SlideShare une entreprise Scribd logo
1  sur  26
Session Storage in
Zend Server Cluster Manager
Shahar Evron
Technical Product Manager, Zend Technologies


To watch the webinar please go to:
http://www.zend.com/webinar/ZSCM/70170000000bLXO-
webinar-scalable-zscm-20100817.flv



                                               © All rights reserved. Zend Technologies, Inc.
Welcome!

    • All Phones are muted – type your questions into the Webex
      Q&A box
    • A recording of this session will be available on-line


    • Today’s Agenda:
         Introducing Zend Server and ZSCM

         An overview of session in PHP

         Zend Session Clustering
               • Session High Availability
               • Scaling up and Scaling down with Session Clustering


2   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Zend Server Cluster Manager
Zend’s leading PHP Web Application Server just got Clustered




                      © All rights reserved. Zend Technologies, Inc.
What is Zend Server?

    • Zend’s Web Application Server for PHP
    • Provides a stable, certified PHP environment as well as
      multiple advanced features
         Some are available for free as part of Zend Server Community
             Edition (but not the clustering features)

    • Consistent environment for Linux and Windows
    • Performance: Opcode Caching, Data Caching, Page Caching
    • Reliability: Monitoring, Security hot fixes, Code Tracing
    • Infrastructure: Job Queuing, Session Clustering


4   the Simple Cloud API Initiative      © All rights reserved. Zend Technologies, Inc.
What is Zend Server Cluster Manager?

    • A central management point for a cluster of Zend Servers
    • Central Configuration Management
    • Central Monitoring
    • Session Clustering




5   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
PHP and Sessions
Representing state over a stateless protocol




                       © All rights reserved. Zend Technologies, Inc.
User Sessions in HTTP

    • HTTP is a stateless protocol – there is no “user session”
         Compare HTTP to FTP or SSH

         The HTTP protocol does not define any way to correlate between
             a series of requests and a single user session
         Requests from a single user may be sent through one or more TCP
             connections, and even through multiple connections in parallel


    • The good news: this makes HTTP highly scalable and
      versatile
    • The bad news: representing user state is left to the
      implementation


7   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
User Sessions in HTTP

    • A basic use case: identifying logged in users
         If I get two consecutive HTTP requests, how can I know that they
             are from the same user?
         How can I know if that user has logged in or not, before I
             authorize some actions?


    • I need some way to identify that a set of requests are
      related to each other, and come from the same user


    • I need some way to store and access information related to
      this user which will persist between requests

8   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
PHP Sessions to the Rescue!

    • PHP provides a built-in mechanism for handling user
      sessions
    • A Session ID identifies a series requests as belonging to a
      specific user session
    • The Session ID is sent by the browser to the server through
      a Cookie or a GET/POST parameter
    • A Session Save Handler is used by PHP to store semi-
      persistent session data
    • There are multiple Session Save Handlers out there, and
      switching between them usually requires no code changes



9   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Session Handling in PHP




10   Session Clustering with Zend Server   © All rights reserved. Zend Technologies, Inc.
Sessions vs. Cookies

     • HTTP Cookies can also be used to store user-specific semi-
       persistent data and through this represent state


     • Unlike PHP Sessions, Cookies are stored on the client side
          Data stored in a cookie should not be trusted by the application


     • Cookie data is sent back and forth between the browser
       and the server on each request
          Storing larger amounts of data in a cookie is impractical


     • Cookies are a very good way to pass a session ID

11   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Different Session Handling Mechanisms

     • By default PHP stores session data in local files
          Other save handlers can be implemented as extensions or in user
              space PHP code


     • In most cases it is very hard to scale beyond one server
       using local files storage
          A sticky load balancer can help, but has downsides

          NFS is a bad idea


     • There are several “Cluster worthy” session save handlers
       out there


12   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Zend Session Clustering
Designed and built for serious session handling




                       © All rights reserved. Zend Technologies, Inc.
What Session Clustering Does?

     • Session Clustering is a PHP Session storage mechanism
          Session Clustering is scalable

          Session Clustering is fault-tolerant

          Session Clustering is relatively fast

          Session Clustering is Cloud ready



     • Session Clustering is a part of Zend Server Cluster Manager


     • Session Clustering can be used transparently by almost any
       PHP application


14   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
How Session Clustering Works?

     • Session Clustering is composed of two main parts:
          The Session Clustering Extension (mod_cluster save handler)

          The Session Clustering Daemon (“SCD”)

     • Most of the work is done by the daemon
          The extension is mostly responsible for getting PHP to talk to the
              daemon
     • Sessions are stored either in memory or on disk
     • Daemons in a cluster talk to each other to share sessions
     • Each session is stored on two servers: a master and a
       backup server

15   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Architectural Overview




16   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Storing and Fetching Session Data

     • When a new session is started by a user, it will be created
       on the server which received the request


     • This server will pick a backup server, and will copy the
       session to it


     • The user’s Session ID has a special format: it identifies the
       session’s Master and Backup server


     • If the request ends up at any server which is not the
       master, the session is requested from the master


17   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Normal Operation




18   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
High Availability

     • If the Master Server goes down…
          The server receiving the request will get the session from the
              backup server instead
          The backup server will designate itself as the new master

          The backup server will pick a new backup server



     • If the Backup Server goes down…
          The master server will pick a new backup server



     • The user’s Session ID is changed to reflect these changes

19   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Failure Handling




20   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Scalability & Cloud Readiness

     • Session Clustering provides a Graceful Shutdown
       mechanism
          When a machine is shut down, it will transfer all it’s sessions to a
              different server in the cluster
          All cluster members will know to use the replacement server
              while the original owner is down
          This process rarely takes more than 30 seconds


     • Graceful Shutdown allows shutting down machines
       permanently or for maintenance without losing sessions
     • Allows scaling down in addition to scaling up – Cloud ready!


21   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Tuning Tips

     • Default settings will work for most people, but…


     • If you intend to use Session Clustering in Amazon EC2:
          zend_sc.ha.use_broadcast=0


     • To switch to disk storage:
          zend_sc.storage.use_permanent_storage=1


     • Session Lifetime:
          zend_sc.session_lifetime=3600



22   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Recap




        © All rights reserved. Zend Technologies, Inc.
Recap

     • PHP offers a native mean to handle user sessions


     • PHP allows you to use different session storage
       mechanisms, and each has pros and cons


     • With Zend Server Cluster Manager, you get Session
       Clustering – a scalable, fault-tolerant session handler


     • If you need to scale up or down and use sessions to store
       important data, Session Clustering may be right for you!



24   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.
Where do I go from here?

• Read the Session Clustering Whitepaper:
  http://zend.com/products/server-cluster-manager/resources



• Download and try Zend Server and ZSCM – evaluation is free


• Questions? Email me: shahar.e@zend.com
  Twitter: @shevron, IRC: shevron in #zendserver on FreeNode



• Meet me at ZendCon in Santa Clara, CA, Nov 1-4, 2010


                       © All rights reserved. Zend Technologies, Inc.
Webinar

     To watch the webinar please go to:
     http://www.zend.com/webinar/ZSCM/70170000000bLXO-
     webinar-scalable-zscm-20100817.flv
     or
     http://bit.ly/pQGrdl


     (short registration required)




26   the Simple Cloud API Initiative   © All rights reserved. Zend Technologies, Inc.

Contenu connexe

Tendances

Tendances (20)

Xen server 6.1 technical sales presentation
Xen server 6.1 technical sales presentationXen server 6.1 technical sales presentation
Xen server 6.1 technical sales presentation
 
Xen server 6.1 technical sales presentation
Xen server 6.1 technical sales presentationXen server 6.1 technical sales presentation
Xen server 6.1 technical sales presentation
 
Xen server 6.1 technical sales presentation
Xen server 6.1 technical sales presentationXen server 6.1 technical sales presentation
Xen server 6.1 technical sales presentation
 
Citrix Day 2014: XenApp / XenDesktop 7.6
Citrix Day 2014: XenApp / XenDesktop 7.6Citrix Day 2014: XenApp / XenDesktop 7.6
Citrix Day 2014: XenApp / XenDesktop 7.6
 
OSSEU18: NVDIMM and Virtualization - George Dunlap, Citrix
OSSEU18: NVDIMM and Virtualization  - George Dunlap, CitrixOSSEU18: NVDIMM and Virtualization  - George Dunlap, Citrix
OSSEU18: NVDIMM and Virtualization - George Dunlap, Citrix
 
Co je nového v XenDesktop 7.6 a XenApp 7.6
Co je nového v XenDesktop 7.6 a XenApp 7.6 Co je nového v XenDesktop 7.6 a XenApp 7.6
Co je nového v XenDesktop 7.6 a XenApp 7.6
 
Webinar : Microservices and Containerization
Webinar : Microservices and ContainerizationWebinar : Microservices and Containerization
Webinar : Microservices and Containerization
 
Webinar : Docker in Production
Webinar : Docker in ProductionWebinar : Docker in Production
Webinar : Docker in Production
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
Towards the Cloud: Architecture Patterns and VDI Story
Towards the Cloud: Architecture Patterns and VDI StoryTowards the Cloud: Architecture Patterns and VDI Story
Towards the Cloud: Architecture Patterns and VDI Story
 
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
XPDS14: Xen and the Art of Certification - Nathan Studer & Robert VonVossen, ...
 
Webinar Docker Tri Series
Webinar Docker Tri SeriesWebinar Docker Tri Series
Webinar Docker Tri Series
 
Licensing 2013 v1.0
Licensing 2013   v1.0Licensing 2013   v1.0
Licensing 2013 v1.0
 
Citrix xa xd cloud provisioning webinar
Citrix xa xd cloud provisioning webinarCitrix xa xd cloud provisioning webinar
Citrix xa xd cloud provisioning webinar
 
Xen 10th anniversary Status Report (at SELF 2013)
Xen 10th anniversary Status Report (at SELF 2013)Xen 10th anniversary Status Report (at SELF 2013)
Xen 10th anniversary Status Report (at SELF 2013)
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)
 
Xen and Apache cloudstack
Xen and Apache cloudstack  Xen and Apache cloudstack
Xen and Apache cloudstack
 
SYN405: Best practices for implementing, administering and troubleshooting Xe...
SYN405: Best practices for implementing, administering and troubleshooting Xe...SYN405: Best practices for implementing, administering and troubleshooting Xe...
SYN405: Best practices for implementing, administering and troubleshooting Xe...
 
Maintaining and Troubleshooting your XenApp 7.5 Environment
Maintaining and Troubleshooting your XenApp 7.5 EnvironmentMaintaining and Troubleshooting your XenApp 7.5 Environment
Maintaining and Troubleshooting your XenApp 7.5 Environment
 
Securing Your Cloud with Xen (CloudOpen NA 2013)
Securing Your Cloud with Xen (CloudOpen NA 2013)Securing Your Cloud with Xen (CloudOpen NA 2013)
Securing Your Cloud with Xen (CloudOpen NA 2013)
 

Similaire à Scalable High-Availability Session Storage with ZSCM

Zend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applicationsZend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applications
Etisbew Technology Group
 
Birmingham-20060705
Birmingham-20060705Birmingham-20060705
Birmingham-20060705
Miguel Vidal
 
Presentation architecting a cloud infrastructure
Presentation   architecting a cloud infrastructurePresentation   architecting a cloud infrastructure
Presentation architecting a cloud infrastructure
solarisyourep
 

Similaire à Scalable High-Availability Session Storage with ZSCM (20)

Turbocharging php applications with zend server
Turbocharging php applications with zend serverTurbocharging php applications with zend server
Turbocharging php applications with zend server
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applications
 
Achieving Massive Scalability and High Availability for PHP Applications in t...
Achieving Massive Scalability and High Availability for PHP Applications in t...Achieving Massive Scalability and High Availability for PHP Applications in t...
Achieving Massive Scalability and High Availability for PHP Applications in t...
 
Turbocharging php applications with zend server (workshop)
Turbocharging php applications with zend server (workshop)Turbocharging php applications with zend server (workshop)
Turbocharging php applications with zend server (workshop)
 
Zend Server - OSI Days
Zend Server - OSI DaysZend Server - OSI Days
Zend Server - OSI Days
 
Zend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applicationsZend MVC pattern based Framework – Best for Enterprise web applications
Zend MVC pattern based Framework – Best for Enterprise web applications
 
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
 
Performance tuning PHP on IBMi
Performance tuning PHP on IBMiPerformance tuning PHP on IBMi
Performance tuning PHP on IBMi
 
green
greengreen
green
 
Deploying PHP apps on the cloud
Deploying PHP apps on the cloudDeploying PHP apps on the cloud
Deploying PHP apps on the cloud
 
What's new with Zend server
What's new with Zend serverWhat's new with Zend server
What's new with Zend server
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM i
 
Birmingham-20060705
Birmingham-20060705Birmingham-20060705
Birmingham-20060705
 
Zend
ZendZend
Zend
 
Serverless: The future of application delivery
Serverless: The future of application deliveryServerless: The future of application delivery
Serverless: The future of application delivery
 
Getting started with PHP on IBM i
Getting started with PHP on IBM iGetting started with PHP on IBM i
Getting started with PHP on IBM i
 
SAP TechEd 2013 session Tec118 managing your-environment
SAP TechEd 2013 session Tec118 managing your-environmentSAP TechEd 2013 session Tec118 managing your-environment
SAP TechEd 2013 session Tec118 managing your-environment
 
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
 
A Tale of Two Toolkits
A Tale of Two ToolkitsA Tale of Two Toolkits
A Tale of Two Toolkits
 

Plus de Zend by Rogue Wave Software

Plus de Zend by Rogue Wave Software (20)

Develop microservices in php
Develop microservices in phpDevelop microservices in php
Develop microservices in php
 
Speed and security for your PHP application
Speed and security for your PHP applicationSpeed and security for your PHP application
Speed and security for your PHP application
 
Building web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend ExpressiveBuilding web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend Expressive
 
To PHP 7 and beyond
To PHP 7 and beyondTo PHP 7 and beyond
To PHP 7 and beyond
 
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018) Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
 
The Sodium crypto library of PHP 7.2 (PHP Day 2018)
The Sodium crypto library of PHP 7.2 (PHP Day 2018)The Sodium crypto library of PHP 7.2 (PHP Day 2018)
The Sodium crypto library of PHP 7.2 (PHP Day 2018)
 
Develop web APIs in PHP using middleware with Expressive (Code Europe)
Develop web APIs in PHP using middleware with Expressive (Code Europe)Develop web APIs in PHP using middleware with Expressive (Code Europe)
Develop web APIs in PHP using middleware with Expressive (Code Europe)
 
Middleware web APIs in PHP 7.x
Middleware web APIs in PHP 7.xMiddleware web APIs in PHP 7.x
Middleware web APIs in PHP 7.x
 
Ongoing management of your PHP 7 application
Ongoing management of your PHP 7 applicationOngoing management of your PHP 7 application
Ongoing management of your PHP 7 application
 
Developing web APIs using middleware in PHP 7
Developing web APIs using middleware in PHP 7Developing web APIs using middleware in PHP 7
Developing web APIs using middleware in PHP 7
 
The Docker development template for PHP
The Docker development template for PHPThe Docker development template for PHP
The Docker development template for PHP
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
 
Unit testing for project managers
Unit testing for project managersUnit testing for project managers
Unit testing for project managers
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Data is dead. Long live data!
Data is dead. Long live data! Data is dead. Long live data!
Data is dead. Long live data!
 
Optimizing performance
Optimizing performanceOptimizing performance
Optimizing performance
 
Resolving problems & high availability
Resolving problems & high availabilityResolving problems & high availability
Resolving problems & high availability
 
Developing apps faster
Developing apps fasterDeveloping apps faster
Developing apps faster
 
Keeping up with PHP
Keeping up with PHPKeeping up with PHP
Keeping up with PHP
 
Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i  Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Scalable High-Availability Session Storage with ZSCM

  • 1. Session Storage in Zend Server Cluster Manager Shahar Evron Technical Product Manager, Zend Technologies To watch the webinar please go to: http://www.zend.com/webinar/ZSCM/70170000000bLXO- webinar-scalable-zscm-20100817.flv © All rights reserved. Zend Technologies, Inc.
  • 2. Welcome! • All Phones are muted – type your questions into the Webex Q&A box • A recording of this session will be available on-line • Today’s Agenda:  Introducing Zend Server and ZSCM  An overview of session in PHP  Zend Session Clustering • Session High Availability • Scaling up and Scaling down with Session Clustering 2 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 3. Zend Server Cluster Manager Zend’s leading PHP Web Application Server just got Clustered © All rights reserved. Zend Technologies, Inc.
  • 4. What is Zend Server? • Zend’s Web Application Server for PHP • Provides a stable, certified PHP environment as well as multiple advanced features  Some are available for free as part of Zend Server Community Edition (but not the clustering features) • Consistent environment for Linux and Windows • Performance: Opcode Caching, Data Caching, Page Caching • Reliability: Monitoring, Security hot fixes, Code Tracing • Infrastructure: Job Queuing, Session Clustering 4 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 5. What is Zend Server Cluster Manager? • A central management point for a cluster of Zend Servers • Central Configuration Management • Central Monitoring • Session Clustering 5 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 6. PHP and Sessions Representing state over a stateless protocol © All rights reserved. Zend Technologies, Inc.
  • 7. User Sessions in HTTP • HTTP is a stateless protocol – there is no “user session”  Compare HTTP to FTP or SSH  The HTTP protocol does not define any way to correlate between a series of requests and a single user session  Requests from a single user may be sent through one or more TCP connections, and even through multiple connections in parallel • The good news: this makes HTTP highly scalable and versatile • The bad news: representing user state is left to the implementation 7 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 8. User Sessions in HTTP • A basic use case: identifying logged in users  If I get two consecutive HTTP requests, how can I know that they are from the same user?  How can I know if that user has logged in or not, before I authorize some actions? • I need some way to identify that a set of requests are related to each other, and come from the same user • I need some way to store and access information related to this user which will persist between requests 8 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 9. PHP Sessions to the Rescue! • PHP provides a built-in mechanism for handling user sessions • A Session ID identifies a series requests as belonging to a specific user session • The Session ID is sent by the browser to the server through a Cookie or a GET/POST parameter • A Session Save Handler is used by PHP to store semi- persistent session data • There are multiple Session Save Handlers out there, and switching between them usually requires no code changes 9 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 10. Session Handling in PHP 10 Session Clustering with Zend Server © All rights reserved. Zend Technologies, Inc.
  • 11. Sessions vs. Cookies • HTTP Cookies can also be used to store user-specific semi- persistent data and through this represent state • Unlike PHP Sessions, Cookies are stored on the client side  Data stored in a cookie should not be trusted by the application • Cookie data is sent back and forth between the browser and the server on each request  Storing larger amounts of data in a cookie is impractical • Cookies are a very good way to pass a session ID 11 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 12. Different Session Handling Mechanisms • By default PHP stores session data in local files  Other save handlers can be implemented as extensions or in user space PHP code • In most cases it is very hard to scale beyond one server using local files storage  A sticky load balancer can help, but has downsides  NFS is a bad idea • There are several “Cluster worthy” session save handlers out there 12 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 13. Zend Session Clustering Designed and built for serious session handling © All rights reserved. Zend Technologies, Inc.
  • 14. What Session Clustering Does? • Session Clustering is a PHP Session storage mechanism  Session Clustering is scalable  Session Clustering is fault-tolerant  Session Clustering is relatively fast  Session Clustering is Cloud ready • Session Clustering is a part of Zend Server Cluster Manager • Session Clustering can be used transparently by almost any PHP application 14 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 15. How Session Clustering Works? • Session Clustering is composed of two main parts:  The Session Clustering Extension (mod_cluster save handler)  The Session Clustering Daemon (“SCD”) • Most of the work is done by the daemon  The extension is mostly responsible for getting PHP to talk to the daemon • Sessions are stored either in memory or on disk • Daemons in a cluster talk to each other to share sessions • Each session is stored on two servers: a master and a backup server 15 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 16. Architectural Overview 16 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 17. Storing and Fetching Session Data • When a new session is started by a user, it will be created on the server which received the request • This server will pick a backup server, and will copy the session to it • The user’s Session ID has a special format: it identifies the session’s Master and Backup server • If the request ends up at any server which is not the master, the session is requested from the master 17 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 18. Normal Operation 18 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 19. High Availability • If the Master Server goes down…  The server receiving the request will get the session from the backup server instead  The backup server will designate itself as the new master  The backup server will pick a new backup server • If the Backup Server goes down…  The master server will pick a new backup server • The user’s Session ID is changed to reflect these changes 19 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 20. Failure Handling 20 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 21. Scalability & Cloud Readiness • Session Clustering provides a Graceful Shutdown mechanism  When a machine is shut down, it will transfer all it’s sessions to a different server in the cluster  All cluster members will know to use the replacement server while the original owner is down  This process rarely takes more than 30 seconds • Graceful Shutdown allows shutting down machines permanently or for maintenance without losing sessions • Allows scaling down in addition to scaling up – Cloud ready! 21 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 22. Tuning Tips • Default settings will work for most people, but… • If you intend to use Session Clustering in Amazon EC2:  zend_sc.ha.use_broadcast=0 • To switch to disk storage:  zend_sc.storage.use_permanent_storage=1 • Session Lifetime:  zend_sc.session_lifetime=3600 22 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 23. Recap © All rights reserved. Zend Technologies, Inc.
  • 24. Recap • PHP offers a native mean to handle user sessions • PHP allows you to use different session storage mechanisms, and each has pros and cons • With Zend Server Cluster Manager, you get Session Clustering – a scalable, fault-tolerant session handler • If you need to scale up or down and use sessions to store important data, Session Clustering may be right for you! 24 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.
  • 25. Where do I go from here? • Read the Session Clustering Whitepaper:  http://zend.com/products/server-cluster-manager/resources • Download and try Zend Server and ZSCM – evaluation is free • Questions? Email me: shahar.e@zend.com  Twitter: @shevron, IRC: shevron in #zendserver on FreeNode • Meet me at ZendCon in Santa Clara, CA, Nov 1-4, 2010 © All rights reserved. Zend Technologies, Inc.
  • 26. Webinar To watch the webinar please go to: http://www.zend.com/webinar/ZSCM/70170000000bLXO- webinar-scalable-zscm-20100817.flv or http://bit.ly/pQGrdl (short registration required) 26 the Simple Cloud API Initiative © All rights reserved. Zend Technologies, Inc.