0


私はmysqlを使用してPHPでプロジェクトを実装しています。現在、私は多くのデータを持っていませんが、将来、大きなデータセットを持っているときにそれを疑問に思っていました。テーブルでの検索が遅くなります。そのため、検索時間を短縮するために、キャッシュ手法を考えていました。大規模なデータセットには、クライアントとサーバーのどちらのキャッシュが適していますか?

ありがとう、アビー

4

2 に答える 2

2

Server, in my opinion.

A client-side cacheing technique will have one of two negative outcomes depending on how you do it:

  1. If you cache only what the user has searched for before, the cache won't be of any use unless the user performs exactly the same search again.
  2. If you cache the whole dataset the user will have to download the whole thing, and that will slow your site down and incur bandwidth expenses.

The easiest thing you can do is just add appropriate indexes to the table you're searching. That will be sufficient for 99% of possible applications and should be the first thing you do, before you think about cacheing at all.

Apologies if I've pitched this answer below your level, I'm not sure exactly what you're doing, what you're planning to cache or how much experience you have.

于 2011-04-17T18:12:39.303 に答える
0

Pay close attention to indexing in your database schemas. If you do this part right, the database should be able to keep up until your data and traffic is large. The right caching scheme will depend significantly on what your usage patterns are like. You should do testing as your site grows to know where the bottlenecks are and what the best caching scheme will be for your system.

于 2011-04-17T18:25:45.713 に答える