Aaron Scherer's Blog

Symfony 2 and Memcached: A new Bundle

Introduction

user

Aaron Scherer


Symfony2, php, PHP, programming

Symfony 2 and Memcached: A new Bundle

Posted by Aaron Scherer on .
Featured

Symfony2, php, PHP, programming

Symfony 2 and Memcached: A new Bundle

Posted by Aaron Scherer on .

Introduction

So, I started work on a personal project of mine that I wanted to be able to use Memcached. The project is using the Symfony2 PHP framework, so I decided to look around a little bit to see if I could find a bundle that does what I needed.

I stumbled upon the LswMemcacheBundle at first, and it looked quite nice, having features like Anti Dog Pile, and Profiling attached to the Web Profiler Toolbar. I started looking at the code however, and it had a lot of bloat that I didnt want, some of the terminologies werent right, and it was missing a feature that I wanted. So I took it and decided to write my own.

The Result

So now, I give you the AequasiMemcachedBundle! This takes a lot of the core logic, and features of the LswMemcacheBundle, but removes the ability to use the Memcache extension, and the compatibility with Memcached versions below 2.0.

Features

  • Cluster Support
    • Can have mutlple clusters
  • Doctrine Support
    • Supports all doctrine cache types (metadata, query, and result)
  • Session Support
  • Injectable Service
    • Can be used (as a service) wherever the container is.
  • Mysql Key-Map support
    • When storing values in Memcached, a row is added to a mysql table, showing the key, the size of the value, how long the ttl is, and when it should expire.

Installing

To install this bundle, check out the source here, and follow the instructions in the readme.

user

Aaron Scherer

http://aaronscherer.me