*
The moose likes Performance and the fly likes Building a scalable performant web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Building a scalable performant web application" Watch "Building a scalable performant web application" New topic
Author

Building a scalable performant web application

Natalie Ap
Ranch Hand

Joined: Jan 09, 2009
Posts: 49
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,

Fiona
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

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


  • [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
    Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
    Tim Holloway
    Saloon Keeper

    Joined: Jun 25, 2001
    Posts: 15957
        
      19

    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.


    Customer surveys are for companies who didn't pay proper attention to begin with.
    manuel aldana
    Ranch Hand

    Joined: Dec 29, 2005
    Posts: 308
    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.


    aldana software engineering blog & .more
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Building a scalable performant web application
     
    Similar Threads
    statistics
    How good is to form a Query on the client
    Software Design Engineer - NYC
    Proposed architecture
    BIRT in a Swing Application