dagblog.
← Archive

Theory and practice in the J2EE world


Does the J2EE stack seem complicated to you? It does to me. I always explain it by saying it was designed for genuinely enterprise-scale challenges such as scalability and failover. EJB exists for a reason, and so do distributed transactions and RMI. Every application needs some way to manage transactions, a component model it can manage, and remote calls that look local. If clever books and tutorials have washed your brain with lessons like those, a dose of practice might sober you up.

First, most of those technologies have their place in the J2EE stack. That’s beyond dispute. Unfortunately, practice sometimes shows that some have had their day. Does eBay count as a big enough reference point for what’s usable from the J2EE stack in the very largest applications? If eBay doesn’t sound like a good reference, here are some numbers from its operations.

  • One billion page views served daily
  • 26, that’s twenty-six, billion SQL statements executed a day
  • Three billion API calls a month

Now, what would you choose from the J2EE stack if you were eBay’s architect? Make a little list of your own…

Got it? Let’s cross off what eBay doesn’t use. I’d have guessed JTA first, especially distributed transactions. Wrong. eBay uses nothing of the sort. Most database operations run in auto-commit mode! Next I’d use EJB. It has to scale properly, after all, and surely down to each API call. Wrong again. Keep guessing if you like, then compare your results with the presentation on eBay’s architecture by eBay’s Dan Pritchett.

All told, servlets are the only J2EE technology named in the presentation. Though it doesn’t say so outright, I’d guess JMS, JMX and perhaps JCA as well. The presentation is fascinating. You rarely get a look under the hood of an application you didn’t build. A few more points caught my eye.

  • The entire application is stateless
  • CPU-heavy work moves from the database to the application, including referential integrity, joins and sorting
  • The business logic produces XML, which XSL transformations turn into HTML for output
  • An in-house object-relational mapping tool

If you’ve gone through the presentation, you may not believe your eyes. It overturns most of what the clever books on J2EE tell you. There are two possibilities. Either something is wrong with J2EE, or eBay is so unusual that even J2EE and all it offers fall short there. I’ll leave the answer to the esteemed reader…

Medium version

Related articles

Related CZ Podcast episodes