There are two windows services written in C #. The first serves as a wcf-service for clients and handles all business logic. The second is assumed simply as a data storage, conditional cache from the database. The question is how to implement fast data collection of the first service from the second? A simple option - using wcf, but it is believed that you can lose in speed. What are some more convenient options?
- 6"but there is an opinion that you can lose in speed": you should not trust the opinion, take it and measure it. I don’t know what will be faster: go to the MSSQL database for a bulky object or go to the WCF service for the cache of the same calculated object. But in general, I would probably think a hundred times on the subject of whether this caching service is needed at all. And if you go without a profiler, and poke at random, it is easy to degrade the architecture of good intentions. Numbers, numbers where? At first they made the cache "probably, it can slow down", then we think "if the cache is not too slow" - and all this without accurate measurements, Karl! - AK ♦
- You understand everything wrong. Cache is needed. Now the cache is hanging in the first service, which is very inconvenient, because every time the service is restarted, the cache rises for about five minutes. I want to separate the cache from the main service because of this. And yes, measurements were made - with the cache, and without the cache directly from the base. And measurements of sending our data on wcf were made. So really looking forward to answers on the topic - Vlad
- oneYou can try the named pipe. MSDN Example - arndtdv
|
1 answer
Convenient - a subjective concept.
If I were you, I would take Redis for the cache + StackExchange.Redis from the service / consumer side. And used protobuf-net for serialization.
If the process of settling the cache at the same time remains difficult, and you want to separate it from the main service - take it to a separate service that will only deal with cramming updated data into redis.
- Offtopic: seen: ru.stackoverflow.com/q/782857/10105 ? - VladD
- @VladD seen. I had two weeks of debugging the problems of connecting StackExchange.Redis with Azure Redis, I will not go into this hellish code without urgent need :) - PashaPash ♦
|