在Java中开发高度可伸缩的Web应用程序需要做些什么? [英] What needs to be done to develop highly scalable web application in Java?

查看:155
本文介绍了在Java中开发高度可伸缩的Web应用程序需要做些什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道从事过大规模生产系统的经验丰富的Java专业人员,需要做些什么来构建可以每天处理1000万以上请求的Web应用程序?

I would like to know from highly experienced Java professionals who have worked with large scale production systems, what needs to be done to build web application to scale that can handle 10 million plus requests per day?

例如,如果需要进行某种缓存,那么使用哪种生产质量库进行缓存?

For example if some sort of caching needs to be done then what production quality library is used for caching?

推荐答案

这是一个很大的主题,不容易回答 - 一般来说,非常大规模的应用程序需要仔细设计,以满足他们预期要处理的特定类型的负载。

This is a huge topic and can't be easily answered - very large scale applications in general need to be carefully designed for the specific kind of load they are expected to handle.

例如:如果处理大多数只读页面视图(通过复制大量廉价应用程序服务器可以轻松扩展),那么您的架构将会大不相同处理复杂的金融交易(您需要一种协调大量同时交易的方式)。

For example: your architecture will be very different if it is handling mostly read-only page views (easy to scale by replicating lots of cheap application servers) vs. if it is handling complex financial transactions (where you need a way of co-ordinating large numbers of simultaneous transactions).

一些一般性提示:


  • 首选水平扩展 - 您希望通过添加更便宜的方框来实现可扩展性。您可以设计更适合此模型的应用程序越多越好。

  • 对可变状态进行协调更改最终将成为可扩展性的瓶颈,如这是你用水平方便的盒子无法扩展的一件事。弄清楚这些变化将是什么,并进行相应的设计。如果幸运的话,单个数据库实例就足够了。如果没有,您将进入NoSQL /高度自定义数据存储领域的非常昂贵的数据库集群/分层事务语义。

  • 使用可扩展的经过验证的库/组件即可。例如 Netty ,用于高吞吐量通信。

  • 不要在没有团队专业知识的情况下尝试这一点 - 将应用程序扩展到大联盟很难并且需要专业技能。如果你做错了,你可能会遇到需要昂贵重写的瓶颈。雇用之前完成它的人。

  • Prefer horizontal scaling - as far as possible, you want to be able to achieve your scalability by adding more cheap boxes. The more that you can design your application to fit this model, the better.
  • Co-ordinated changes to mutable state will ultimately be your bottleneck to scalability, as it's the one thing that cannot be scaled as far you as you like horizontally with cheap boxes. Work out what these changes will be, and design accordingly. If you're lucky, a single database instance will be sufficient. If not, you're into very expensive database cluster / layering transactional semantics over NoSQL / highly-custom-data-store territory.
  • Use proven libraries / components that can scale. e.g. Netty for high throughput communications.
  • Don't try this without expertise on your team - scaling applications into the "big league" is hard and requires specialist skills. If you do it wrong, you can get stuck with bottlenecks that require expensive rewrites. Hire someone who's done it before.

BTW - 每天1000万个请求实际上并不大。这只是每秒115个请求。通过合理紧密的编码,一个现代服务器可以处理......

BTW - 10 million requests per day isn't actually that big. That's only 115 requests per second. With reasonably tight coding, one modern server can handle that......

这篇关于在Java中开发高度可伸缩的Web应用程序需要做些什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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