Scaling Up Your Java EE Applications

A decent article on scaling up your java applications: Scaling Your Java EE Applications

Here’s a list of tips:

  1. Make synchronized blocks as short as possible
  2. Reduce lock granularity
  3. Avoid lock on static methods
  4. Use lock free data structure in Java SE 5.0
  5. Be ware of race conditions: HashMap bug / consider using ConcurrentHashMap
  6. Use Non-Blocking I/O for high concurrency (Tomcat uses Blocking I/O, Glassfish uses Non-Blocking)
  7. Parallelize single-thread tasks if possible by seeking independence in order of operations. JOMP or Parallel Java may be used to simplify this task.
  8. To scale up in memory use multiple JVMs and limit the memory allocated to each to about 3GB or less.
  9. Database - pay attention to isolation levels. keep stored procedures to a minimum.
  10. Be ware of operating system and disk I/O limitations such as have a large number of files in one directory.
  11. Synchronous logging

Python up front. Java in the back.

I’ve always thought that the ideal web development platform would be comprised of a dynamically typed language in the presentation tier supported by a statically typed language where the business and persistence logic lives. It just never made sense to me to use a statically typed language for building web user-interfaces considering that there’s very little gain to be had from type-safety.

The news today that Sun hired two key Python programmers makes me hopeful that they’re thinking what I’m thinking.