View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}


[Simon Harris|]


1.0 - 18 August 2010: Initial Draft.

The MongoDB backend for Zend_Cache would allow developers to use MongoDB as a backend for content/data caching for the Zend_Cache component. MongoDB is a scalable, high-performance, open source, document-oriented "NoSQL" database.

* [Zend_Cache|]
* [MongoDB|]
* [mongodb-user at Google groups|]

* This component *will* implement a fully funtional and configurable Zend_Cache backend using MongoDB

* Zend_Cache_Backend
* Zend_Cache_Backend_Interface
* Zend_Exception

The component is instantiated and used in a manner consistent with existing Zend_Cache backends

* Write proposal
* Gather feedback
* Review by the Zend team
* Develop full implementation and unit tests
* Documentation

* Zend_Cache_Backend_Mongodb

||UC-01: Simple Caching Example||


$frontendOptions = array(
'lifetime' => 3600,
'automatic_serialization' => true

$backendOptions = array(
'connection_string' => 'mongodb://localhost',
'database' => 'my_caching_db',
'collection' => 'my_caching_collection',
'persistent_connect' => false

$cache = Zend_Cache::factory('Core',

$cacheKey = 'my_cache_key';

if (!$data = $cache->load($cacheKey)) {

$data = perform_some_expensive_operation();
$cache->save($data, $cacheKey);




Class skeletons will follow the current Zend_Cache_Backend_Interface_Extended and to offer a consistent interface and identical functionality to other backends. Class skeletons will be published here as development progresses.