- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我们软件环境中的当前方法是在分布式 SOA 基础结构中拥有多个 WCF 服务。有不止一种服务向前端网站提供来自证券交易所的信息,例如股票、债券、货币、共同基金。
Web 服务查询数据库,我们有直接来自 .net 框架的 ThreadCache,它可以将信息缓存 3-5 分钟。如果缓存过期,最终用户将调用将从数据库中检索新信息的方法。因此,该网站非常快,除了使用过期数据调用网络服务的网站之外......该用户的响应时间非常慢......可能大约 10-20 秒 :/
我想每 5 分钟将此市场信息提供给在 Windows 服务器上运行的 Redis 服务。 WCF 服务将从 REDIS 而不是数据库中获取信息。
我的一个大问题是,如何让使用新信息更新 REDIS 服务的数据馈送器在同一台机器上运行的最佳方法是什么?
给你意见! :)
最佳答案
这是我的看法
The webservices query the database and we have ThreadCache straight from .net framework which caches the information for 3-5 minutes. If the cache is expired, it would be the enduser that invokes the method that is going to retrieve new information from the database. So the website is pretty fast except for the one that invokes the webservice with expired data....that user will have a pretty slow reponse time... probably about 10-20 second :/
为什么需要服务层?如果仅用于缓存数据,我强烈建议您使用 AppFabric 或简单的 Redis 直接查询分布式缓存。另一层似乎对您的情况毫无用处,尤其是当代码似乎与您的网站耦合不佳时。
- Windows service running in every 5 minutes
- Daemon running every 5 minutes from an workload scheduler ..
- Or maybe I can implement some method in Redis and he himself (REDIS) would check if the data has expired and then invoke some methods that updated the REDIS data storage.
Windows Service 或 Daemon,它们完全相同,并且是设置后台处理的推荐方式。我熟悉topshelf ,我发现它真的很强大。即使 Redis 现在支持键空间通知,也无法直接调用用 .net 编写的内容。
您的数据在 5 分钟后过期?好的,但每分钟在后台运行一次任务以预加载/预缓存数据。对于最终用户来说,它总是很快,因为您永远不必重新加载它。
最后,Redis 的另一个重要特性是 PubSub .当 Redis 发生变化时,很容易通知所有订阅者。只需几行代码,它就可以让您在所有网站上实现本地缓存失效,并避免不同步的节点。
I want to feed this market information to a Redis service running on windows server in every 5 minutes. The WCF services would the get information from REDIS instead of database.
目前,Windows 上的 Redis 端口不是生产质量,但可用于 Windows(服务器)环境中的开发目的。我使用了几个月,发现它非常稳定,但建议在 Linux 环境中运行 Redis。
关于.net - Redis 用于频繁更改的市场信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20947936/
我有一个包含值的字符串数组(duh...)。 有没有一种简单的方法可以获取出现次数最多的条目?有点像 values[37].getMostOften(); 干杯:) 最佳答案 您可以使用GroupBy
我目前正在将一款用 C#(适用于 Windows Phone)开发的游戏移植到 Java (Android)。 我们在 Java 版本中遇到了内存问题,在分析之后,似乎是由于内存中的大量 String
对于播放音频文件的 iPhone 应用程序,我正在开发一个系统来跟踪用户在他们听过的任何一集中的进度(例如,他们听 file1 的前 4:35,然后开始另一个文件,然后返回到文件 1,它从 4:35
如果您按下 UIbutton 显示 UITextView,将请求代码 Ì 再次按下 UIbutton 再次显示 UITextView :/ 最佳答案 .h 文件中只有一个 int 变量,如下所示..
我在 Application_End 上处理的项目中使用临时数据库: protected void Application_End() { if (_db != null) _db.Dispo
我是一名优秀的程序员,十分优秀!