如何在WCF服务和托管该服务的进程之间共享缓存的数据? [英] How do I share cached data between a WCF service and the process hosting the service?

查看:106
本文介绍了如何在WCF服务和托管该服务的进程之间共享缓存的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个普通的Windows服务,该服务可以处理大型数据集并将其存储到DB.该Windows服务还充当托管WCF服务的角色,该服务可将处理后的数据提供给一个或多个GUI.

I have an ordinary windows service that processes a large data set and stores it to a DB. This windows service also acts to host a WCF service that serves the processed data up to one or more GUIs.

当前,WCF服务必须至少命中一次数据库才能获取客户端的数据,但是数据集的大小是如此之慢,并且由于重复执行而占用了大量内存.数据.理想情况下,我想与WCF服务直接(在内存中)共享数据处理的结果.有办法吗?

Currently the WCF service has to hit the DB at least once to get the data for the client, but the size of the data set is such that this is extremely slow, and eats up a lot of memory because of the duplication of data. Ideally I would like to share the results of the data processing directly (in memory) with the WCF service. Is there a way to do this?

推荐答案

是,使用分布式缓存引擎.

Yes, using a distributed cache engine.

基本上,分布式缓存引擎是在一个或多个计算机上运行的独立进程,用于管理缓存.该缓存站点位于其自己的进程中,通常,缓存引擎提供用于访问该数据的API

Basically, the distributed cache engine is a separate process running on one or more machines, that manages a cache. This cache sites in it's own process, and typically the cache engine provides an API for accessing that data

主要选项是

  • Windows Server AppFabric caching - http://msdn.microsoft.com/en-us/library/ff383731.aspx
  • Memcachd - http://memcached.org/, the Windows build is here http://code.google.com/p/memcached/wiki/PlatformWindows

这篇关于如何在WCF服务和托管该服务的进程之间共享缓存的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆