面向服务的架构建议 [英] Service Oriented Architecture suggestions

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

问题描述

出于个人和大学研究的原因,我正在考虑使用面向服务的架构构建一个简单的 CRM.其含义只是解释架构本身,不用于商业用途.

For personal and university research reasons I am thinking of building a simple CRM using a service oriented architecture. Its meaning is just to explain the architecture itself, not commercial use.

我正在考虑实施一个 CRM,提供简单的分析服务和客户服务(用户存储、个人评论和其他一些东西).

I was thinking of implementing a CRM that offers a simple analytics service and customer care (user storing, personal comments, and few other things).

我正在设计的架构定义了:- WebGUI(其他服务的客户端)- AnalyticsService(接收数据、分析和收集数据的服务)- CustomerCareService(一种使用 RESTful API 来应用 CRUD 操作的服务).

The architecture that I'm designing defines: - WebGUI (a client of the other services) - AnalyticsService (a service that receives data, analyzes and collect it) - CustomerCareService (a service that uses RESTful APIs to apply CRUD operations).

每个服务都有自己的数据库,完全独立于其他服务.他们公开了一个公共接口.接口当然必须提供某种身份验证,以拒绝未经授权的请求.

Each service has it own database, being completely independent from others. They expose a public interface. The interface of course must provide some sort of authentication, to deny unautorized requests.

我想在这种架构中解释的优点是可以让所有事物独立,并且能够将它们组合起来以提供新服务(例如,如果有一个 OrderService 来处理订单,则很容易使用公共 API 将其与客户结合).对我而言,最大的优势是可以轻松构建使用这些服务的其他客户端.

The advantages I'd like to explain in this kind of architecture is the possibility to have all things indepentent and the ability to combine them to offer new services (for example if there was an OrderService to handle orders it would be easy to combine it with Customer using the public APIs). The big advantage to me is that it'd be easy enough to build other clients that use these services.

我不知道什么是好的身份验证方法,它可能易于实现,我也不确定如何制作此 API(使用 XML 或带有 GET/POST 数据的普通 REST API).我曾与亚马逊、贝宝和其他公司的 API 合作过,他们似乎使用 REST 服务(贝宝使用丑陋的 _cmd GET 参数,而亚马逊使用更好的 URI)来知道该怎么做,但是阅读有关 SOA 的一些内容似乎人们也使用XML.当然,我还需要考虑到 Web 界面必须能够识别登录用户、获取权限(令牌或其他任何内容)并将其与服务一起使用以显示信息.所以我不确定 SOA 是我真正构建的那种架构……它是 SaaS 而不是 SOA?我认为最好使用 RESTful 应用程序,使用 JSON 或类似的东西来实现它(我不是 XML 的忠实粉丝,我觉得它太冗长了).

I don't know what is some good Authentication method, that could be easy to implement, I'm also not sure about how to make this APIs (use XML or plain REST APIs with GET/POST data). I've worked with Amazon, PayPal and other company APIs, they seem to use REST services (paypal uses an ugly _cmd GET parameter while Amazon uses better URI) to know what to do, but reading something about SOAs it appears that people also use XML. Of course I also need to take into account that the web interface must be able to recognize the logged in user, get the permissions (token or whatever else) and use it with services to show information. So I'm not sure SOA is the kind of architecture I'm really building up... is it SaaS instead of SOA? I think it would be better to use RESTful applications, with JSON or something like that to implement it (I'm not a big fan of XML, I find it to be too verbose).

为了清楚起见,我在这里列出了我的问题:

For clarity I'm listing here my questions:

  1. 这种架构是称为 SOA 还是 SaaS(或两者)?
  2. 对于我想要获得的东西,什么是好的实现?(请尽可能详细地解释)
  3. 哪种身份验证更适合客户端(用户令牌与 OAuth 或类似)
  4. 您对此类项目有什么建议吗?

我有大约 3 个月的时间来做这件事,所以我不能做一些真正复杂的事情(除了这对单个程序员来说是不现实的).

I've about 3 months to do it, so I cannot do something real complex (beside the fact that it would not be realistic for a single programmer).

我知道 Python(WSGI 框架)、Ruby on Rails、C/C++ 和其他语言(不包括 .net),我想在 Linux 环境(MySQL 或 Postgres,甚至 NoSQL,如果你有的话)下开发它任何关于正确选择的建议),我也可以将几种语言组合起来作为这些服务独立程序.

I know Python (WSGI frameworks), Ruby on Rails, C/C++ and other languages (.net excluded) and I'd like to develop it under a Linux environment (MySQL or Postgres, or even a NoSQL if you have any suggestion for the right choice), I could also combine several languages being these services independent programs.

我想在这里有一些好的观点和一些好的建议.

What I'd like here is to have some good point of view and some good suggestion.

谢谢!

推荐答案

我将 SaaS 定义为一种业务模型而不是一种架构;然而,就像所有业务领域需求一样,它会影响系统架构,但它本身不会.您所定义的内容对于面向服务的架构至关重要.

I would define SaaS as a Business model rather than an architecture; however like all business domain requirements it will influence systems architecture but it, itself is not. What you have defined is essential a Service Oriented Architecture.

您的陈述独立并且能够将它们结合起来以提供新服务"是建议 SOA 的基本非功能性设计要求.

Your statement "independent and the ability to combine them to offer new services" is the essential non-functional design requirement that suggests SOA.

良好的 SOA 实现是关于拥有定义明确且灵活的接口,以及非常明确的职责划分.然而,很难对主题进行规定.证据在吃;它是否提供了灵活的重用.我的建议是花时间阅读 SOA 设计模式资源,并了解有关适当使用上下文的定义特征.然后应用单一职责原则适当的抽象级别.比照(领域)基于空间的架构是一种 SOA 元模式.

Good implementation for SOA is about having well defined and flexible interfaces, with very clear delineation of responsibilities. However it is difficult subject to be prescriptive about. The proof is in the eating; does it provide that flexible reuse. My suggestion is spend time reading SOA design pattern resources, and understand the defining characteristics with regard to the appropriate context for use. Then apply the Single Responsibility principle appropriate level of abstraction. c.f. (Domain) Space Based Architecture is kind of SOA meta-pattern.

关于授权,我建议遵循服务方法,使用分布式目录服务系统,如开放 LDAP,并注意服务提供者和用户拥有自己的凭据是完全合理的,您可以使用公私密钥进行签署消息.

In regard to Authorisation, I recommend following the service approach, use a distribute directory services system like open LDAP, and note that is entirely reasonable for service provides and users to have their own credentials and you can use Public-Private keys for signing messages.

主要建议是学习和借鉴他人的经验:

The main suggestion is study and learn from experience of others:

这篇关于面向服务的架构建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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