DZone
Performance Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Performance Zone > PHP Sessions on Steroids

PHP Sessions on Steroids

John Esposito user avatar by
John Esposito
·
Nov. 17, 11 · Performance Zone · Interview
Like (0)
Save
Tweet
5.17K Views

Join the DZone community and get the full member experience.

Join For Free
  • Hello.
  • Hello.
  • I am looking for the broccoli.
  • It's over there.
  • Hello.
  • Hello.
  • I am looking for the spinach.
  • It's next to the broccoli.
  • What's broccoli?


If conversations went like this, everybody would hate their lives. (It's also profoundly opposed to how real conversations go.)

Roughly speaking, however, this is how HTTP (or any other request-response protocol) interactions progress. Which is fine for simple actions (authentication, for instance: just say swordfish and you're in), but not for real life, and therefore not for anything like (a) the web is now, or (b) where the web is going. This is why sessions are so important -- why two-way sessions are now being built into new web standards, for example.

But sessions introduce some real technical problems -- especially when scaled. Sessions are ongoing conversations -- but if the service interlocutor is really just one physical machine, and that one physical machine just happens to be talking to bunches of people at once..or if one server just happens to be having some really intense conversations, say, with a particularly important client..then service will be slow, and unnecessarily so.

To the rescue comes Johannes Schlüter, who proposes:

A nice solution for this would be to store the sessions in a central repository which can be accessed from all web servers.


True; and Johannes already showed how to use MySQL 5.6's memecached API to speed data access from all servers (a post in itself well worth reading).

But for a more scalable, more fundamentally distributed solution, check out his new post on using the MySQL Cluster for PHP session storage. Here's his idea, in a nutshell:

We need MySQL Cluster and an API node. Now instead of building a C++ module specific for that but why built such a specific solution when a more generic one exists? - The mentioned Development Milestone release of MySQL Cluster 7.2 includes a new form of API node: memcached.

And he goes on to explain how and why to use memecached (rather than memecache with no d) for exactly this purpose.

Very practical, very well-explained post. Read it and make your PHP sessions fly like the wind.

PHP Session (web analytics) MySQL Cluster

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is URL Rewriting? | Java Servlets
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB
  • Message Queuing and the Database: Solving the Dual Write Problem
  • What SREs Can Learn From the Atlassian Nightmare Outage of 2022

Comments

Performance Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo