Using Redis to Scale Web Services

℡╲_俬逩灬. 提交于 2019-12-07 02:37:32

I'd try to test and tune your layers separately. Test the web services with dummy data not involving the db, but with similar data size and concurrent connections. Same with the database, tuning your queries again with realistic load and table sizes, using synthetic data (or real if you can) to match the size of your expected user base. Test these two together, making careful measurements so you can verify how your changes affect overall performance and where the bottlenecks are. Finally, add the caching layer, again testing for effectiveness. If the db is the bottleneck, caching may help, but if the web services layer is the issue, caching likely won't. If you're only using Redis for a cache, you might like the simpler memcached better.

You could also check if using .NET 4 which I think you should the System.Runtime.Caching library.

Gives you great flexibility as soon as you use 1 server. If you need a web farm, or when things can be more tricky like synchronization, invalidation, expire etc, meaning some distributed cache (memory in my opinion), supporting Local store (in-memory usually, local) and distributed store. You could use this namespace too with AppFabric to get the desired caching.

Hope this works for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!