Choosing Java Spring as a scalable server-side framework for a large website

我与影子孤独终老i 提交于 2019-12-03 08:00:51

Spring is a good framework. However, by itself it is not going to solve your scalability problems (and no other framework would).

To scale heavy load on servers you need to make sure that your servers are stateless or use load balancers with sticky sessions. To reduce load on database you will need caches. No framework will solve it for you.

In other words, think about overall system design rather than specific coding framework.

I would prefer the following.

  1. Spring Framework (MVC architecture and DI Principle).
  2. Hibernate Framework.
  3. Caching mechanisam using memcache / Infinispan for reducing load on servers.
  4. Horizontal Load balancing using multiple server/db instances.

Another good choice - and a standards based one at that - would simply be Java EE. EE 6 is a good option, and JBoss AS 7 - which supports EE 6 - has made great headway, is small, efficient and lightning fast. And is free and open source.

Java EE 6, as a standard, has pretty much all you'd need: CDI as a programming model, web front-end based on JSF, JAX-RS for RESTful web services, JPA2 for object-relational mapping, and if you so need it, JMS messaging, etc etc. Sun/Oracle's Java EE 6 tutorial is probably the place to start if you want to learn about this tech.

And if you choose to go with JBoss as a runtime environment, you have great tooling as well - a set of Eclipse plugins to make building Java EE apps a snap.

Almost any framework, if used properly, will do. Spring / Spring MVC is a good choice:

  • it supports custom url mappings
  • ORM support
  • Caching support - this will be very important for your scalability

Web Server: -Static Contents to be hosted by Web server: http://nginx.org/en/. -A lot of assets could be hosted in a Content delivery network. -Enabling gzip compression @ web server and application server. -The GUI should be thick client and only fetch data from the server once initialized. -Reduce the # of trips to server. -Compress the contents (HTML,CSS,JS,Embed images in the html itself etc.)

Application Server: -Ensure you using pooling techniques for all the resources that are involved like DB, message processors etc. -Good coding practices which are optimized for garbage collection. -Using NBIO application servers (JBoss Wildfly,Netty,Tomcat 8 etc.)

Database: -Clustering the DB. -Denormalizing the database and maintaing soft integrity in the code rather then in the DB. Referential integrity & constraint checks have a huge cost in querying (Join, insert,updates etc.) -You can look @ migrating to ACID NoSQL databases like Orient DB.

I would go for Spring.

  • Simple
  • Supports all features you need + lot more
  • Good community support
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!