用于检索视图数据的 Web 服务与消息传递
我需要从一些外部应用程序获取一些数据以在门户网站中呈现。
我可以通过创建一个简单的 Web 服务来实现此目的,例如使用 REST 或 SOAP,通过访问外部应用程序的数据库以表示形式返回外部应用程序的数据。
我也可以通过使用消息传递和请求-回复模式来实现这一点。
这些是我迄今为止在考虑可扩展性和可用性问题后收获的。如果我错了,请纠正我。
使用 RESTful 方法:
我可以想象无状态 REST 架构很容易扩展,就像可以集群的 Web 服务器一样,其吞吐量可以控制(例如要服务的线程数量等),但我认为瓶颈将是然后就可以在数据库中访问了。
如果外部应用程序的数据库因某种原因不可用,REST 可能会返回一些错误状态,并且门户 Web 应用程序会打印令人安慰的错误消息。
使用消息传递方法:
我可以“缓冲” 通道,如果有很多通道,甚至可以有多个通道 请求,同时可以控制消耗速率 这对于数据库处理能力来说是合理的。
应通过持久性妥善处理不可用问题 通道,但在这种情况下,它是同步访问,并且必须 如果外部应用程序的数据库在时限内响应 不可用。我不认为这对于这种同步需求是有利的。
不知何故,对于这种情况,我更喜欢 RESTful 方法,因为它实际上是同步访问,当然实现起来更简单。 但我仍然有疑问。
请分享您的想法。谢谢 !
I have a need to get some data from some external applications to be rendered in the web portal.
I can achieve this by creating a simple web service, using REST or SOAP for example, returning the external application's data in a representation by accessing the external application's database.
I can achieve this too by using messaging, with the request-reply pattern.
These are what i harvested so far with the consideration of scalability and availability issues. Please correct me if im wrong.
With RESTful approach :
I can imagine that the stateless REST architecture is easily scalable just as the web servers that can be clustered, whose throughput can be controlled (like how many threads to serve, etc), but i think the bottleneck would then be in the database access.
If the external application's database is somehow not available, the REST could just return some error status, and the portal webapp could print soothing error messages.
With Messaging approach :
I can potentially 'buffer' all the messages in the
channels, can even have multiple channels if there are lots of
requests, and in the same time, can control the consumption rate
that is reasonable for the database processing capacity.Inavailability issues should be gracefully handled with persistent
channels, but in this case, it's a synchronous access, and have to
respond within a time limit if the external application's database
is not available. I dont think it is advantegous for this synchronous need.
Somehow i kinda prefer RESTful approach for this case, since it's really a synchronous access and of course much more simpler to implement.
But im still in doubt.
Please share your thoughts. Thanks !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://blogs.msdn.com/b/nickmalik /archive/2005/04/14/408328.aspx
有点旧,但区分了 SOA 和 MOA。您的案例看起来像一个 SOA,您想要获取数据并将其发布到页面上。 MOA 在问题空间方面完全不同。
http://blogs.msdn.com/b/nickmalik/archive/2005/04/14/408328.aspx
Bit old, but demarcates SOA and MOA. Your case looks like an SOA where you wanted get data and just post on a page. MOA is completely different in terms of problem space.