为什么我们需要 Java 中的应用程序服务器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4153117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why do we need Application Server in Java
提问by Abdullah
Why do we need Application Server in Java like JBoss or WebSphere. Is it possible that we develop large scale website only with Java (Apache Tomcat). Where thousand of user connect on site at a moment. An example is a website like b2b.
为什么我们需要像 JBoss 或 WebSphere 这样的 Java 应用程序服务器。有没有可能我们只用Java(Apache Tomcat)来开发大型网站。数以千计的用户同时在现场连接。一个例子是像 b2b 这样的网站。
What is the cost of a Application Server? I will be thankful if you compare price among different application server and if there is any free version kindly highlight it.
应用服务器的成本是多少?如果您比较不同应用服务器之间的价格,如果有任何免费版本,请突出显示,我将不胜感激。
回答by Jonas
Application Servers are mostly used if you want to use advanced features like transaction management, hot code swapping and advanced persistence.
如果您想使用事务管理、热代码交换和高级持久性等高级功能,则主要使用应用服务器。
There are application servers that are open source. E.g. GlassFishand JBoss.
有些应用服务器是开源的。例如GlassFish和JBoss。
I don't think you need an application server for building a popular web site, you'll also be fine with a servlet container like Tomcator Jetty.
回答by rgksugan
In short Application Servers provide you with few services like
简而言之,应用服务器为您提供了一些服务,例如
- Transaction Management
- Load Balancing
- Security
- Threading
- 交易管理
- 负载均衡
- 安全
- 穿线
etc.
等等。
You have to take care of these things yourself in a Web Server.
您必须在 Web 服务器中自己处理这些事情。
There are few Open Source Application servers which are free of cost.
很少有免费的开源应用程序服务器。
I have used Glassfish.
我用过玻璃鱼。
回答by Sid
Apart from answers given above, App Servers are required for EJBs.
除了上面给出的答案外,EJB 还需要应用服务器。
回答by Walter Marvin
It is possible to handle the httpheaders yourself. We have done socket servers in java for 20 years. You do not need a container for java swing. Persistence can be done through databases or server side files unless you need real high speed stuff. I have yet to find a real requirement for an ejb except that some systems simply require them
可以自己处理 httpheader。我们在 Java 中做了 20 年的套接字服务器。您不需要 java swing 的容器。除非你需要真正高速的东西,否则持久化可以通过数据库或服务器端文件来完成。我还没有找到对 ejb 的真正需求,只是有些系统只是需要它们
回答by Dead Programmer
You need Application Server as follow:
您需要应用服务器如下:
- It provides you useful services like automatic transaction,Authentication,Authorization,Lifecycle management.
- To remember large user data across pages using ejb's pertaining to a client.
- Load balance the user request and buisness logic.
- To interact with different Client UI like Java Swing,Browsers.
- 它为您提供有用的服务,例如自动交易、身份验证、授权、生命周期管理。
- 使用与客户端相关的 ejb 来记住跨页面的大量用户数据。
- 负载平衡用户请求和业务逻辑。
- 与不同的客户端 UI 交互,如 Java Swing、浏览器。
回答by lonecloud
This may be because jboss can provide better after-sales service, and jboss, etc. can provide operation and maintenance support, etc. This may be the reason why many large companies choose commercial versions of servers. But you must know that tomcat and netty are not bad. For example, many large B2B or C2C or B2C companies still use tomcat, such as Internet companies such as Alibaba. Choose a server
这可能是因为jboss可以提供更好的售后服务,jboss等可以提供运维支持等,这可能是很多大公司选择商业版服务器的原因。但是你要知道tomcat和netty都不错。比如很多大型的B2B或者C2C或者B2C公司还在使用tomcat,比如阿里巴巴等互联网公司。选择服务器
- Operation and maintenance costs
- Scalable costs
- Server cost
- 运维成本
- 可扩展的成本
- 服务器成本