Comments (4)
Can you tell me a little bit more about your expectations around such a feature? I have seen it in AppFabric for example, and think I get what you mean (basically a RAM drive), but what do you want to get out of it? It's not particularly cheap or easy to keep the local cache in sync with the remote cache (requires a polling mechanism from client to server or two-way communication that remains open so the server can push back to the client). If you're able and willing to accept some delay (seconds, minutes, hours?) in the locally cache data reflecting the remotely cached data (eventual consistency), it could be done quite easily. Let me know your thoughts!
from dache.
Here's my scenario: I need to keep track of session information (sessionId + some other bits of info) for a REST API in my application. Memory cache is nice for this - I can just store the session info in RAM and retrieve them every time to verify the incoming calls.
The problem is that when IIS recycle, you lose this information. So what we do is create a second storage for these session information in the database. So the logic is
- Check SessionID in local cache.
- If not exist, check the DB store.
- If exists, populate the local cache to be used next time.
Now when I expire the session, I remove the info at the local cache, delete the row in the DB and send message to the other machines to expire their local cache as well.
We can in fact use an external caching to replace the role of DB store.I just need a second RAM storage to survive IIS recycle.
The 2nd scenario is simply API niceties: static lookup data. I really don't want to go out of process to get country list, zip code list, etc.
from dache.
Keeping track of data locally and keeping it up to date would be very expensive... A magnitude of N pushes of data where N is the number of cache hosts... This would be required because if you round-robin'd your web servers and had 20 of them, all 20 would need the latest, most up-to-date session information for each request... Not only that, but race conditions would exist where fast consecutive requests could beat the Session data update to the local RAM... I will definitely implement a "boost mode" that does some local caching, but it will have to start out as eventual consistency in order to be light on the network I/O... After all, you don't save much by storing session locally on each server if you have to constantly send it to every other server. Thank you for the input - scheduling local caching boost for 1.2!
from dache.
I have added this feature in 1.2.0 and am closing this issue. Thanks @dodyg !
from dache.
Related Issues (20)
- Performance Counter Memory Leak HOT 2
- The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly HOT 2
- Client configuration should be injectable instead of reading it from app/web.config HOT 1
- Broken test out of the box
- Install service host fails silently when not run as administrator HOT 1
- Client.Example.Config is a terrible name HOT 1
- Lower the getting started curve for Dache HOT 5
- Install-Package : Failed to add reference to 'System.Configuration'. Please make sure that it is in the Global Assembly Cache. HOT 4
- 'Dache.Client.Exceptions.NoCacheHostsAvailableException' occurred in Dache.Client.dll HOT 8
- TryGet stuck ! 1.4.9 HOT 4
- Create Consistent Hashing For Dache Clients HOT 1
- There are no reachable cache hosts available. Verify your client settings and ensure that all cache hosts can be successfully communicated with from this client HOT 12
- Dache cache host, stuck at most of the times ? HOT 11
- Is it possible to access caches values in dache CacheHost ? HOT 1
- after restarting service all webapp are unable to reconnect HOT 7
- Web App disconnected after some hours? HOT 7
- Is it possible to host dache on IIS? HOT 2
- Start Dache Host on Demand HOT 3
- A few questions HOT 2
- Server force disconnect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dache.