C
C
cat_crash2014-02-17 00:27:13
Yii
cat_crash, 2014-02-17 00:27:13

Yii cache + Redis: how to offload MySQL by caching data?

Good day.
There is a huge database with billions of records. There is a fairly loaded project written in Yii.
The architecture is such that all data stored in the database is static, i.e. do not change, but only read. There are a lot of connections in the data through JOINs.
I want to unload MySQL a little due to data caching.
Will a construct like

Model::model()->cache(3600,null,2)->with('one','two','two.one')->findAllByAttributes(array('attr'=>$value));

Or is it necessary to specify the dependency? I repeat that there is no cache dependence as such. All data is static, it's just that their volume is huge and the selections are quite complex due to relationships.
Tested on a test environment. Entries appear in redis/memcache, but judging by the logs, requests to the server still leave.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-02-17
Protko @Fesor

Have you tried caching everything at the DBMS level (I suspect that you are using either mysql or postgres, which do a good job of caching themselves)? it caches requests well if there is a lot of memory.

R
Rowdy Ro, 2014-02-17
@rowdyro

There are several ideas:
1. The caching component is configured incorrectly
2. The Yii database crawls behind the table schema (see schemaCachingDuration)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question