简体   繁体   English

SOA(面向商业智能和服务的体系结构)中的报告

[英]Reports in SOA (Business Intelligence & Service Oriented Architecture)

I have SOA with a Employee service and a Travel Service. 我的SOA具有员工服务和旅行服务。 The travel service will create a travelID entry for the employeeId in the [Travel] database. 旅行服务将在[旅行]数据库中为employeeId创建一个travelID条目。 The employee will be using a “TravelUI” website (which calls the Travel Service to store details in DB) to request for a travel. 员工将使用“ TravelUI”网站(该网站将调用Travel Service在DB中存储详细信息)来请求旅行。 There is a “ManagerUI” website which will be used by manager to approve the travel request. 有一个“ ManagerUI”网站,经理将使用它来批准旅行请求。 The “ManagerUI” website uses the Travel service as well as the Employee Service to get the details. “ ManagerUI”网站使用差旅服务以及员工服务来获取详细信息。 When the manager approve the travel, the travel record (in [Travel] database become approved by using operations in Travel service. 当经理批准旅行时,旅行记录(在[旅行]数据库中)将通过使用旅行服务中的操作得到批准。

Note: Employee details are stored in [Employee] database and the Employee service uses this data. 注意:员工详细信息存储在[Employee]数据库中,并且Employee服务使用此数据。

Now, we need to generate a report with TravelID, Travel Request Date, EmployeeID, EmployeeName, EmployeePhone. 现在,我们需要生成一个包含TravelID,旅行请求日期,EmployeeID,EmployeeName,EmployeePhone的报告。 The first three information are from [Travel] database and the remaing are from [Employee] database. 前三个信息来自[旅行]数据库,其余信息来自[员工]数据库。 The report is to be generated using SSRS. 该报告将使用SSRS生成。

Here the problem is NOT abou whether it is possible to generate a report by combing two databases; 这里的问题不是关于是否可以通过合并两个数据库来生成报告。 but it become a complicated problem due to the introduction of SOA. 但是由于引入了SOA,这成为一个复杂的问题。

  1. How can we resolve the problem 我们如何解决问题

  2. What are the mistakes in my design that made the problem complex? 我的设计中有哪些错误使问题变得复杂?

  3. Do you have any suggestions for any good articles on handling such a problem? 您是否对处理此类问题的任何好的文章有任何建议?

Note: SOA is planned using WCF here. 注意:此处计划使用WCF计划SOA。

EDIT : Though the title mentions about Business Intelligence, I am looking for an answer that does not involves datamart/datawarehouse primarily. 编辑 :尽管标题提到了有关商业智能的问题,但我正在寻找一个主要不涉及datamart / datawarehouse的答案。 Datawarehouse answer is also welcome - but the primary aim is without datawarehouse. 数据仓库的答案也很受欢迎-但主要目的是没有数据仓库。

READING: 读:

  1. Service-Oriented Business Intelligence http://msdn.microsoft.com/en-us/library/bb245659.aspx 面向服务的商业智能http://msdn.microsoft.com/en-us/library/bb245659.aspx

  2. A Service-oriented Architecture for Business Intelligence http://www.hpl.hp.com/personal/Claudio_Bartolini/download/soca07.pdf 商业智能的面向服务的体系结构http://www.hpl.hp.com/personal/Claudio_Bartolini/download/soca07.pdf

  3. Service-Oriented Architecture and Business Intelligence http://www.servicetechmag.com/I53/0811-2 面向服务的体系结构和商业智能http://www.servicetechmag.com/I53/0811-2

  4. Microsoft on the Enterprise Service Bus (ESB) http://msdn.microsoft.com/en-us/library/aa475433(v=bts.10).aspx Microsoft在企业服务总线(ESB)上http://msdn.microsoft.com/zh-cn/library/aa475433(v=bts.10).aspx

  5. https://stackoverflow.com/questions/41353/net-esbs-out-there https://stackoverflow.com/questions/41353/net-esbs-out-there

The problem from what I can see is that SSRS violates the Contract Centralisation Pattern . 从我看到的问题是,SSRS违反了合同集中化模式 Instead your report should be generated from either the services you have created, or by extending those services. 相反,您应该通过已创建的服务或通过扩展这些服务来生成报告。 Otherwise you create a tight technology based coupling between your report and your databases, which will make it more difficult to modify, migrate or re-implement your travel and employee systems when the need arrises. 否则,您将在报表和数据库之间建立基于紧密技术的耦合,这将使在需要时修改,迁移或重新实现差旅和员工系统变得更加困难。 The more reports you add this way, the more difficult it will become to change your Travel and Employee implementation. 通过这种方式添加的报告越多,更改差旅和员工实施的难度就越大。

If you haven't already, I would create reporting operations on the travel service, eg, if you are using SOAP based services, add a GetTravelRequests operation, which accepts some sort of querying and pagination parameters, that just returns the TravelID, Travel Request Date, EmployeeID of the matching records. 如果还没有,我将在旅行服务上创建报告操作,例如,如果您正在使用基于SOAP的服务,则添加GetTravelRequests操作,该操作接受某种查询和分页参数,该操作仅返回TravelID,旅行请求日期,匹配记录的EmployeeID。 Then create a GetEmployeeTravelRequests , which composes GetTravelRequests with a GetEmployeeDetails operation from the Employee service. 然后创建一个GetEmployeeTravelRequests ,它由Employee服务中的GetTravelRequestsGetEmployeeDetails操作组成。

This will be slower that an SSRS based report, but you are free to then change the underlying implementation of the Travel and Employee services, so long as you don't change the service contract. 这将比基于SSRS的报告要慢,但是只要您不更改服务合同,就可以随意更改差旅和员工服务的基础实现。

I've kind-of assumed you are using SOAP, which is what the answer above is based upon, however if RESTful services are an option, then I would recommend the following. 我有点假设您使用的是SOAP,这就是上面的答案所基于的,但是,如果可以选择RESTful服务,那么我将建议以下内容。 Instead of exposing numeric TravelID s and EmployeeID s, instead use URIs . 与其公开数字TravelIDEmployeeIDTravelID 使用URIs For instance, the travel service will create a travel resource for the employee URI in the Travel database. 例如,旅行服务将在Travel数据库中为员工URI创建旅行资源。 Then create an Atom based feed of travel requests. 然后创建基于Atom的旅行请求提要 You can either stop there and where the report user needs employee details, they can follow the employee URI link. 您可以在此处停下来,报表用户需要员工详细信息的地方,他们可以点击员工URI链接。 Otherwise, you can use the employee URIs to create a composed Atom feed that includes the employee details for each travel request. 否则,您可以使用员工URI创建组合的Atom提要,其中包括每个差旅请求的员工详细信息。

The main advantage of this latter approach is the reduced DB load through the use of HTTP Caching; 后一种方法的主要优点是通过使用HTTP缓存减少了数据库负载。 HTTP GET is the most optimised operation in the world. HTTP GET是世界上最优化的操作。 Your report is now a live report, rather than only as current as when it was last generated, which may be once a day or once a month and if you structure your feed correctly, then the non-head pages never change and can be cached for a year or longer. 您的报告现在是实时报告,而不是最新的报告,它可能是每天一次或每月一次,并且如果您正确地构造了Feed,则非首页不会更改并且可以被缓存一年或更长时间。 If you assume that employee details change infrequently, then you can set the max-age to 1 day, in which case a query for a particular employees details will only hit the database once a day. 如果您假设员工详细信息很少更改,则可以将最大年龄设置为1天,在这种情况下,对特定员工详细信息的查询每天只会在数据库中进行一次。

Finally, another nice benefit, is that it become trivially easy to add a TravelRequests collection resource to the Employee resource, which contains an Atom based paginated list of all the travel requests for that employee. 最后,另一个不错的好处是,将TravelRequests集合资源添加到Employee资源变得非常容易,该资源包含该Employee的所有旅行请求的基于Atom的分页列表。

I don't think your design is wrong. 我认为您的设计没有错。 Your architecture just seems to be missing a data mart or warehouse or some sort of way to support business intelligence in addition to transaction processing. 除了事务处理之外,您的体系结构似乎还缺少数据集市或仓库或某种支持商业智能的方式。

BI in SOA is a complex topic and it's impossible to give advice without knowing some details about your architecture. SOA中的BI是一个复杂的主题,如果不了解有关体系结构的一些细节,就不可能给出建议。 But here are some articles to get you started: 但是这里有一些入门指南:

Have you considered ESB for your SOA? 您是否考虑过将ESB用于您的SOA? It could make integrating a data mart easier into your SOA. 它可以使将数据集市轻松集成到您的SOA中。 See this article: http://www.b-eye-network.com/view/3018 看到这篇文章: http : //www.b-eye-network.com/view/3018

One of the potential users of an ESB is a data integration service. ESB的潜在用户之一是数据集成服务。 In fact, several vendors have modified their data integration and ETL (extract, transform and load) tools to be event-driven so that they can consume event messages from an ESB. 实际上,一些供应商已将其数据集成和ETL(提取,转换和加载)工具修改为事件驱动的,以便他们可以使用来自ESB的事件消息。 These events can carry information about source data changes, which can be used by the data integration service to incrementally update an operational data store (ODS) or data warehouse. 这些事件可以携带有关源数据更改的信息,数据集成服务可以使用这些信息来增量更新操作数据存储(ODS)或数据仓库。 This approach is particularly useful for operational BI applications that require intra-day data. 对于需要日间数据的可操作BI应用程序,此方法特别有用。

This is a good example of the kind of confusion that can result when you aren't clear about your design priorities. 这是当您不清楚设计优先级时可能导致的混淆的一个很好的例子。 And in particular, for my taste, there is too much concern with the technical issues and not enough with the user requirements. 特别是,就我的口味而言,对技术问题的关注过多,而对用户要求的关注却不够。

I would start out by working with the stakeholders to build a good set of user stories sufficient to identify the scope of the project, and to list the capabilities that will be used for a first phase acceptance test. 首先,我将与利益相关者合作,建立一套足以确定项目范围并列出将用于第一阶段验收测试的功能的用户故事。 Your chances for a successful project, and for reducing the likelihood for redesign later, is to agree on a description for a complete deliverable that is immediately useful and provides obvious value once the first phase is complete. 一个成功项目的机会,以及减少以后重新设计的可能性,是要达成一个完整交付物的描述,该交付物将立即有用并在第一阶段完成后提供明显的价值。

It should be composed entirely from the user's point of view, without even using the words "database", "SOA", "web service", "API", etc. 它应该完全从用户的角度组成,甚至不使用单词“数据库”,“ SOA”,“ Web服务”,“ API”等。

What you will be building will be a kind of contract agreement between you and the customer for a service of value to them; 您将要建立的将是您与客户之间的一种合同协议,旨在为他们提供有价值的服务; and once it's agreed, it shouldn't change except to increase its value to the customer in his/her terms. 并且一旦达成协议,就不应更改它,除非以他/她的名义增加对客户的价值。 So your best bet is to try to defer consideration of the "how" issues until you have the "what" firmly nailed down. 因此,最好的选择是尝试推迟对“如何”问题的考虑,直到您牢牢确定了“什么”。

Then you'll have the freedom to consider various technical options that might be used to deiiver the same result. 然后,您可以自由考虑可能用于获得相同结果的各种技术选择。 Often there's a phase-one design that just provides enough to make it work; 通常,有一个第一阶段设计可以提供足够的功能来使它工作。 and you want to preserve the flexibility to learn and adjust the back end in any way you see fit as long as the conceptual contract/logical design is unchanged. 并且您希望保留只要您认为合适的任何方式来学习和调整后端的灵活性,只要概念合同/逻辑设计不变即可。

In my experience everyone will be happier if you put your first attention on being able to react to user expectations (which will fill out as everyone learns from the process) rather than pre-optimizing the technology. 以我的经验,如果您首先关注能够对用户期望做出反应(随着每个人从过程中学习而来的话),而不是预先优化技术,那么每个人都会更快乐。 Microsoft gives you lots of ways to mix and match and evolve an enterprise design. Microsoft为您提供了多种混合,匹配和改进企业设计的方法。 If you're into Agile, remember to start with the least development that works and then iterate like mad. 如果您喜欢敏捷,请记住从最有效的开发开始,然后疯狂地迭代。

There is no way I can see from the design that the Travel service will not need access to the Employee service in some way, shape or form. 从设计中我无法看到Travel服务不需要以某种方式,形状或形式访问Employee服务。 If they are operated in virtual isolation then you'll have a master data management issue just waiting to bite. 如果它们是在虚拟隔离中运行的,那么您将有一个主数据管理问题,只是要等待一下。

I've recently designed the architecture for a T&E system with the HR data within the corporate infrastructure and the T&E front end hosted as SaaS. 我最近为T&E系统设计了体系结构,并在公司基础结构中使用了HR数据,而将T&E前端托管为SaaS。

In that scenario the T&E system required a base level of HR data primarily to ensure that the employee was validated. 在那种情况下,T&E系统需要基本水平的HR数据,主要是为了确保对员工进行验证。 It was also required to allow the system to correctly process travel bookings without requiring the employee to re-enter key data. 还需要允许系统正确处理旅行预订,而无需员工重新输入关键数据。

This was achieved by delivering the base employee data to the travel system, first as a bulk load and then through updates as employee data changed. 这是通过以下方式实现的:首先将基本员工数据提供给差旅系统,然后将其作为批量加​​载,然后通过更新员工数据来进行更新。 This does require careful design as you are transporting some PII data but a secure transport protocol and good encryption between the source and destination mitigates for that. 在传输某些PII数据时,这确实需要进行仔细的设计,但是源和目标之间的安全传输协议和良好的加密会减轻这种情况。

Reporting on the travel bookings and activities are then entirely within the Travel system. 这样,关于旅行预订和活动的报告就完全在旅行系统中了。 They need to be held in a semi-warehouse state to ensure that changes in the base employee records don't pollute the historical travel records. 必须将它们保存在半仓库状态,以确保基本员工记录中的更改不会污染历史旅行记录。 These are 'transactions' and need to be stored as such. 这些是“交易”,需要照此存储。

With that in mind, while your design isn't exactly wrong, it's not exactly right. 考虑到这一点,虽然您的设计并非完全错误,但并非完全正确。 You are quickly going to hit issues that you need to revisit your design to resolve. 您很快就会遇到需要重新设计以解决的问题。 My overarching recommendation would be to follow @le dorfier's advice and go back to the beginning. 我的总体建议是遵循@le dorfier的建议,然后重新开始。 Design to meet all user requirements, make sure they are real requirements not just 'wants' (ie nice to have). 设计满足所有用户要求,确保它们是真实的要求,而不仅仅是“想要”(即很高兴)。 The natural design will then include the requirements for not only the externally hosted front end but also the reporting required to satisfy the backend. 自然的设计将不仅包括对外部托管前端的要求,而且还包括满足后端要求的报告的要求。

Virtually everything we design today has to be done so with interoperability in mind, we build modular software using components and patterns that deliver loose coupling. 实际上,我们今天设计的所有内容都必须做到互操作性,我们使用提供松散耦合的组件和模式来构建模块化软件。 That flexibility saves us untold effort later and although it takes longer to design, it's so worth the effort. 这种灵活性为我们节省了后来的大量工作,尽管设计花费了更长的时间,但这样做还是值得的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM