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

6

5

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?

Contributor answered 26/5, 2011 at 7:46 Comment(1)
A more meaningful question would be to compare it to some alternative.Hague
H
14

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.

Helaina answered 26/5, 2011 at 8:4 Comment(0)
J
2

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.
Jamshid answered 26/5, 2011 at 8:43 Comment(1)
Also see this blog post on using Infinispan with Spring.Used
U
2

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.

Used answered 20/6, 2011 at 19:55 Comment(0)
P
1

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
Phox answered 26/5, 2011 at 7:51 Comment(0)
L
1

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.

Lette answered 14/3, 2015 at 16:12 Comment(0)
M
0

I would go for Spring.

  • Simple
  • Supports all features you need + lot more
  • Good community support
Muoimuon answered 26/5, 2011 at 7:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.