View Source

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

{zone-data:component-name}
Zend_Cache_Backend_Mongodb
{zone-data}

{zone-data:proposer-list}
[Simon Harris|mailto:zftracker@pointbeing.net]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 18 August 2010: Initial Draft.
{zone-data}

{zone-data:overview}
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.
{zone-data}

{zone-data:references}
* [Zend_Cache|http://framework.zend.com/manual/en/zend.cache.html]
* [MongoDB|http://www.mongodb.org/]
* [mongodb-user at Google groups|http://groups.google.com/group/mongodb-user]
{zone-data}

{zone-data:requirements}
* This component *will* implement a fully funtional and configurable Zend_Cache backend using MongoDB
{zone-data}

{zone-data:dependencies}
* Zend_Cache_Backend
* Zend_Cache_Backend_Interface
* Zend_Exception
{zone-data}

{zone-data:operation}
The component is instantiated and used in a manner consistent with existing Zend_Cache backends
{zone-data}

{zone-data:milestones}
* Write proposal
* Gather feedback
* Review by the Zend team
* Develop full implementation and unit tests
* Documentation
{zone-data}

{zone-data:class-list}
* Zend_Cache_Backend_Mongodb
{zone-data}

{zone-data:use-cases}
||UC-01: Simple Caching Example||

{code:php}<?php

$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',
'MongoDB',
$frontendOptions,
$backendOptions
);

$cacheKey = 'my_cache_key';

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

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

}

do_something_with($data);{code}


{zone-data}

{zone-data:skeletons}
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.
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>