Choosing Java Spring as a scalable server-side fra

2019-03-30 12:47发布

I'm currently facing a dilema regarding the appropriate server-side framework to use.

Basically, I want to choose the best framework for building a large website to serve millions of page hits. The website itself will be heavily database and ajax reliant, and thus will need to be planned for scalability right from the start.

My wants/needs for a suitable server-side framework are the following:

  • High-Level OO-based language support with some meta programming support.
  • Proper scalability and load balancing on a framework level.
  • MVC architecture.
  • ORM support or atleast Object level mapping support.
  • Proper routing (URL Rewriting) support.

My question finally is that is the Java Spring framework a suitable candidate for a operating a large website based on the wants and needs that were mentioned above? Should I stick to something like Django or Rails?

6条回答
够拽才男人
2楼-- · 2019-03-30 13:25

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.
查看更多
放我归山
3楼-- · 2019-03-30 13:25

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
查看更多
你好瞎i
4楼-- · 2019-03-30 13:28

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.

查看更多
趁早两清
5楼-- · 2019-03-30 13:29

I would go for Spring.

  • Simple
  • Supports all features you need + lot more
  • Good community support
查看更多
在下西门庆
6楼-- · 2019-03-30 13:40

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.

查看更多
神经病院院长
7楼-- · 2019-03-30 13:43

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.

查看更多
登录 后发表回答