This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Building a scalable performant web application

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

We are building a web application that would use the following technologies:
1) Spring
2) Hibernate
3) Tomcat
4) MySQL database

The site would have 120K to 140 K users. We need to build a scalable server that can support so many users and one that has a good
response time. Can anyone please pool in suggestions, tips, etc on how to go about this.
Which design patterns we could use, what sort f optimizations can be applied while building the site?
Thanks,
 
author & internet detective
Posts: 40797
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Natalie,
It's not just the number of users that matters. How often are they doing things? What do they do (read vs update)? How many are concurrent? etc.

There are a few general pieces of advice:
  • cache read only data if you can
  • don't put too much in the session - memory constraints
  • make sure you don't rely on there being only one JVM in case you need to add clones later
  • performance test early - you don't have to be done to test one function to make sure it is architecturally scalable
  •  
    Saloon Keeper
    Posts: 24545
    168
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    One of the most important things you can do is remain flexible. For example, MySQL may or may not be the most appropriate database. Fortunately, Hibernate - or better yet, Hibernate JPA can abstract the database details in case you need to replace it with Oracle or even PostgreSQL. Additionally, there are commercial plugins to JPA technology such as as the Tangesol cache that might prove useful. This is one of the reasons that ORM is better than raw JDBC as you scale up - it's easier to install a plugin that it is to do a massive low-level code re-architecting.

    Spring is also beneficial in such instances, since it makes it easier to plug-replace underperforming components.

    Very likely you'll need clustering capabilities, so design accordingly. But overall, it's more important to keep the design clean. It's easier to optimize a clean system than to clean up an "optimized" system that wasn't clean and wasn't even optimal.

    As we've said here before, don't optimize prematurely. The bottlenecks are rarely where you expect them to be, so you'll just make for a dirtier design and a lot of useless effort.
     
    Ranch Hand
    Posts: 308
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    these 100K+ users, how many of them are supposed to use the site concurrently? what state does the application have? how distributed are the users (just one country, worldwide)?

    For general hints also have a look at: book . It is a bit old (2002) but gives you a good overview on the concepts.

     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic