EJB VS WebService?性能观点 [英] EJB Vs WebService? Performance point of view

查看:271
本文介绍了EJB VS WebService?性能观点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯,我们现在有了现在的决定。我想stackoverflow是讨论最好的地方。



背景:



我们有2个JVM企业应用服务器和一个每个应用程序部署了应用程序。我们需要启用从一台机器到另一台机器的业务功能调用。假设一个是客户端,另一个是服务器。



现在从性能点来看,哪种方法更好地设计服务器应用程序。



通过记住以下事项:



我有2个选项:


  1. 纯EJB应用程序意味着EJB客户端和EJB服务器组件


  2. WebService Plain Java方法(没有Webservice在EJB上, )


我的性能指标:速度:哪种设计方法会更快地处理请求。我的业务应用程序肯定会部署在32位机器上。



另请注意,有2个JVM,一个是32位和64位(避免这种情况是不可避免的权利现在)



请提供您的反馈意见



Regards



Chetan

解决方案

如果通过Web服务表示SOAP Web服务,EJB应该更快,无论你怎么做。



优点:




  • Java Web服务

    li>
  • 序列化和解析XML比直接序列化使用更多的内存,EJB节省内存

  • EJB以直接的Java接口和值对象表示。对于Web服务,您可能需要添加映射图层,例如XmlBeans或JAXB。

  • 大多数EJB协议允许您轻松地重用调用之间的TCP / IP连接



缺点:




  • 首先进行适当的设计XML消息定义将解耦客户端和服务器

  • 更新消息格式更容易,因为额外的间接层

  • EJB实现历来是巨大而缓慢的大于Web服务堆栈(但是更新的EJB实现,如Apache OpenEJB是小型,轻量级和可嵌入的)



但是如果你不需要分布式事务处理,只需使用RMI。它有优点,但没有EJB的缺点。它已经存在了很多年了,但它仍然只是花花公子。


Well We have situation to decide now. I thought stackoverflow is best place to discuss.

Background:

We have 2 JVMs Enterprise Application server and one application deployed on each of them. we need to enable the business functionality invocation from one machine to other. Let assume one is client and another is server.

Now from the performance point view which approach is better to design server application.

by keeping following things in mind:

I have 2 options:

  1. Pure EJB application means EJB client and EJB server component

  2. WebService Plain Java approach (no webservice over EJB, coz it is simply mess)

My Performance metrics: Speed : which design approach will process a request faster. My business application will be deployed on 32 bit machine for sure!

Also note that there is 2 JVMs, one is 32 bit and 64 Bit (avoiding this situation is unavoidable right now)

Please provide your feedback

Regards

Chetan

解决方案

If by "Web Services" you mean SOAP web services, EJBs should be faster no matter how you do it.

Pros:

  • Java serialization is faster that XML Web Services
  • Serializing and parsing XML uses more memory than straight serialization, EJBs save memory
  • EJBs are expressed in straight Java interfaces and value objects. For Web Services, you might have to add a mapping layer such as XmlBeans or JAXB.
  • Most EJB protocols lets you easily reuse the TCP/IP connections between calls

Cons:

  • Doing a proper design first XML message definition will decouple the client and server
  • It is easier to change the message formats given that extra layer of indirection
  • EJB implementations have historically been huge and slow, as in bigger than Web Service stacks (but newer EJB implementations like Apache OpenEJB are small, lightweight and embeddable)

But if you don't need distributed transaction handling, just use RMI. It has the pros but none of the cons of EJBs. It's been around for ages, but it still works just dandy.

这篇关于EJB VS WebService?性能观点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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