In the project I need to cache the database data fetched from each request.So that from next time onwards the data(table rows) will be picked from cache instead of db thereby improving performance.In DB i have more than 10M data rows. I was going through the beaker cache documentation,from which it seems that it will only cache the function along with the arguments as keys.So how this can store the table data which is my main objective? Or are there any other good database caching modules available in python?
5840 次
2 に答える
2
Beaker は、データベース呼び出しのようなものもキャッシュするように構成可能です。これらは、コントローラ メソッドを介してデータベースと対話する WSGI スタイル アプリケーション用に設計されており、ビーカーはそれらのコントローラ メソッドのラッパーとして位置し、これらのメソッドを介してデータベースから返されたデータをキャッシュします。
データベースからデータにアクセスする方法に応じて、memcachedを探す必要があります。Python API があり、 Djangoなどのさまざまなフレームワークやビーカー拡張機能として利用できます。
于 2012-04-02T07:46:12.873 に答える
2
FWIW、これはシンプルで高速な LRU キャッシュで、DB クエリの結果をキャッシュするのに役立ちます: http://code.activestate.com/recipes/578078
于 2012-04-02T07:48:08.050 に答える