如何构建非常大的Java EE网站? [英] How are very large Java EE web sites structured?

查看:135
本文介绍了如何构建非常大的Java EE网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有兴趣了解部署本身的结构 -



一些可能的答案:




  • 单个耳朵 - 有/没有会话
    共享在组成
    战争之间?

  • 多个战争 - 带/不带
    会话共享?

  • 多个模块
    在部署时被组合成一个大的战争



有没有记录的最佳做法?

解决方案

当你说非常大的网站时,我假设网站有太多的模块和子模块。不是网站流量很大。如果您在交通繁忙的网站上被打扰,请重新表达并发布不同的问题或更新这个。



保持模块化与多个EAR / WAR。使模块化为每个模块独立发展提供机会,除非模块接口发生变化。如果界面发生变化,依赖模块也需要更新。虽然不是网站,但其中一个例子是Eclipse IDE。它的每个模块都是独立开发和维护的,并且具有自己的版本。网站模块化还提供了在单独的机器/服务器上部署单个模块的机会,因此可以单独扩展。



跨EAR / WAR的会话共享将被认为是坏主意。这对于服务器来说太多了。此外,它可以引入将像全局变量一样难以调试的错误。但是让用户一次又一次地为每个模块登录也是非常糟糕的。您需要为此实施一些单点登录(SSO)解决方案。就一个例子而言,www.google.com,www.gmail.com,www.orkut.com等都是google服务,每个服务就像一个单独的模块。但是,如果您登录其中一个服务,然后再打开另一个服务,然后再打开另一个服务,则您自动登录。



尽管组装成一个大战争的模块模块是坏主意,一年一次,您可以将所有模块部署在一起(不是单个WAR,而是单独),并将其命名。类似的东西可以看到与日食。 Eclipse有时间为每个模块更新,但每年都有一个更新版本,其中所有模块都升级(欧罗巴,Ganymede,Galileo ...)。



每个应用程序是不同的,具有不同的要求。大型网站没有具体的最佳做法,因为这取决于正在开发的网站。例如,会话共享不是一个很好的做法,但是业务需求可能会促使你这样做。或者可以使用一些替代方法在模块之间共享信息。


A best practice question - how are very large websites best structured with Java.

I'm interested in knowing how the deployments themselves are structured -

Some possible answers:

  • A single Ear - with/without session sharing in between the constituent wars?
  • Multiple Wars - with/without session sharing?
  • Multiple modules that are assembled into one big War at deployment time?

Is there any documented best practice for this?

解决方案

When you say "very large websites", I assume website that have too many modules and sub modules. Not the site with heavy traffic. If you are intrested in site with heavy traffic, please rephrase and post a different question or update this one.

Keep it modular with multiple EAR's/WAR's. Having it modular gives opportunity for each module to evolve independently of other unless there is change in module interface. If there is change in interface, dependent module needs to be updated as well. Although not a website, one of such example is Eclipse IDE. Each of it's modules are developed and maintained independently and has it's own versions. Having website modular also gives opportunity to deploy individual modules on separate machines/servers and hence can scale individually.

Session sharing across EAR's/WAR's will be considered bad idea. It is too much of a work for server. Further it can introduces bugs that will be hard to debug just like global variables. But having user to log in again and again for each module is also really bad. You would need to implement some "Single Sign On (SSO)" solution for this. As far as example is concerned, www.google.com, www.gmail.com, www.orkut.com etc. are all google services and each service is like an individual module. But if you sign into one of the service and then open another without signing out, you automatically get logged in.

Although modules modules that are assembled into one big War is a bad idea, Once a year you can have all modules being deployed together (not as single WAR but individually) and name it something. Similar thing can be seen with eclipse. Eclipse has time to time updates for each individual modules but one a year they have a major release where by all modules are upgraded (Europa, Ganymede, Galileo ...).

Every application is different and has different requirements. There is no specific best practices for large website as it would depend on the website being developed. Say for example session sharing won't be a good practice but business requirement may drive you to do so. Or some alternate method could be used to share information across modules.

这篇关于如何构建非常大的Java EE网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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