Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

ServerGrove.com:
MongoDB TTL collections
Aug 26, 2013 @ 14:30:47

On the ServerGrove blog today there's a new post talking about TTL collections in MongoDB - queries with a time-to-live set on the indexes - and includes how to use them in PHP.

MongoDB (v. 2.2+) provides a mechanism to expire data from collections by setting a TTL -time to live- on indexes. This is a great feature if you have data that needs to persist in the database for a specific period of time. The TTL feature allows you to expire data using the MongoDB daemon instead of having to create cron jobs to delete expired data. [...] The MongoDB daemon (mongod) checks regularly for documents in collections with a TTL and removes the expired documents.

Using it from PHP is relatively simple - all that's needed is a configuration parameter on the "ensureIndex" call setting an "expireAfterSeconds" value. There's also a bit included in the post for the Doctrine users out there, showing the docblock comment to use to set the value.

tagged: mongodb ttl timetolive collections expire seconds tutorial

Link: http://blog.servergrove.com/2013/08/23/mongodb-ttl-collections/

Vinu Thomas' Blog:
MemProxy 0.1 - Memcache Proxy Server in PHP
Jun 25, 2008 @ 16:13:27

Vinu Thomas points out a new "server" project that's been created to aid in caching for your app - MemProxy.

A pretty cool project in PHP - Memproxy is a caching proxy "server" that uses memcached for storing the cache. This project uses PHP scripts to handle caching using memcache.

The server uses memcached to store the information and automatically manages things like TTL, custom headers and is "application agnostic" all wrapped up in a small codebase with minimal dependencies.

tagged: server proxy project memcached storage ttl header custom

Link:


Trending Topics: