.NET Windows 服务 - 架构决策 [英] .NET Windows Service - Architectural Decisions

查看:24
本文介绍了.NET Windows 服务 - 架构决策的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个全天持续运行的 Windows 服务.它有多个线程启动:

I currently have a Windows Service which continually runs throughout the day. It has multiple threads which kick off:

  • 每天更新缓存的任务
  • 每周执行清理任务
  • 24/7 将 XML 导入 SQL Server 的任务
  • 每天运行约 12 小时的任务启动控制台应用程序来管理 ETL

任务不是这个问题的重要部分,但它让你觉得这个 Windows 服务已经成长为一个怪物.它每天管理大约 3 亿条记录的导入.

The tasks are not the important part of this question but it gives you the idea that this Windows service has grown to be a monster. It manages the imports of somewhere in the region of 300 million records per day.

虽然很忙,但很管用.

这次开发迭代让我有机会审查服务并可能将其分解,以便更易于管理.据认为,这可以是多个服务和一个管理器服务 - 如果需要更新一个组件,那么理想的做法是整个事情不需要被拖累.

This iteration of development is giving me a chance to review the service and possibly break it down so that it is more manageable. It is thought that this could be multiple services with one manager service - ideal if a component needs to be updated then the whole thing does not need to grind to a hault.

有人有这方面的经验吗?我很想听听您的方法,因为这对我来说是一个新领域.

Does anyone have any experience with this? I am keen to hear about your approach because it is new territory for me.

我已阅读这篇 SO 帖子,其中涉及该主题.

I have read this SO post which touches on the topic.

干杯.

推荐答案

你的描述听起来很像我 2 年前写的东西.托管插件并在多线程环境中运行它们的 Windows 服务.使用的架构是 .NET 3.5 中引入的 .NET 插件管道(System.AddIn-namespace).它就像一个魅力,因为我还集成了实时/热更新.实现新插件非常容易,只要我喜欢就可以插入它们.所以我真的推荐使用这个插件.

Your description sounds a lot like the thing I wrote about 2 years ago. A windows service which hosts addins and runs them in multithreaded environment. The architecture used is the .NET addin pipeline introduced in .NET 3.5 (System.AddIn-namespace). It works like a charm as I also integrated live/hot updates. It's so easy to implement new addins and just plug them in whenever I like. So I really recommend using this addin stuff.

请参阅 http://msdn.microsoft.com/en-us/library/cc175292.aspx 快速入门.

这篇关于.NET Windows 服务 - 架构决策的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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