I personally use MySQL for initially my database, where I keep your actual objects. When an item is made utilizing a template, rendering takes considerable time.
Due to that I have made the decision to cache the created HTML. At this time I keep cache in files, named appropriate, also it works considerably faster. I'm however aware that it's not the easiest method to achieve this.
I want a (ideally key-value) database to keep my cache in. I am unable to make use of a caching proxy because I still have to process the cached HTML. Can there be this type of database having a PHP front-end?
Edit: Basically use memcached, and that i cache in regards to a million pages, will not I exhaust RAM?
Edit 2: And again, I've a great deal of HTML to cache (gb from it).
Basically use memcached, and that i cache about millions of pages, will not I exhaust RAM?
memcached is another real solid product(like redis more) used whatsoever large sites to ensure that they're ready to go. Almost al active tweets(which user fetch) are saved in memcached for insane performance.
If you wish to be fast you ought to have your active dataset in memory. But yeah when the dataset is larger your available memory you need to(must always store data in persistent datastore because memcached is volatile) store data inside a persistent datastore like for instance mysql. When it is unavailable in memory you'll try to fetch it from datastore and cache it memcache for future reference(with expire header).
I like redis since it is a professional key-value store with insane performance
Redis is definitely an advanced key-value store. It is comparable to memcached however the dataset isn't volatile, and values could be strings, the same as in memcached, but additionally lists, sets, and purchased sets. All of this data types can be altered with atomic procedures to push/pop elements, add/remove elements, perform server side union, intersection, distinction between sets, and so on. Redis supports different type of sorting capabilities.
Redis includes a VM so you do not need a seperate persisent datastore. I like redis due to all of the available commands (energy :)?). This tutorial by simon willison shows(lots of) the raw energy which redis has.
Redis is pretty fast!, 110000 SETs/second, 81000 Will get/second in a beginner Linux box. Check the benchmarks.
Redis is insanely simple to install. It's no dependencies. You just perform:
make ./redis-server redis.conf #start redis
to compile redis(Awesome :)?).
Memcached has dependency(libevent) which causes it to be harder to install.
wget http://memcached.org/latest tar -zxvf memcached-1.x.x.tar.gz cd memcached-1.x.x ./configure make && make test sudo make install
not totally true because memcached has libevent dependency and
./configure will fail of
libevent is missing. However again they've packages that are awesome, but require
root to set up.