hi guys, what would be a scaleable product catalog design where all the product related information is stored in a rdbms? i've read that hitting the database with each user request is not scaleable. caching the database tables in memory would not be a good idea either. entity ejb? i have not heard many good things about them, at least in ejb 1.1. What would be a scaleable approach? are there any examples to look at?
The most scaleable solution with relatively static data (like catalogs) is to cache the generated HTML pages. Nothing renders faster than static text. Of course, this means you will need to come up with some mechanism for checking when product data changes in the database so you can re-generate the pages.
If you want to go with data caching and you are using EJB, I strongly suggest you use the CMP entities and the data caching features of your EJB server (most have something). If you are not using EJB, then use a good object-to-relational mapping framework, most of which also have some data-caching features.
That's right, hitting the database always isn't scalable, but it's even worse for performance. Users seem to be impatient... And a single database access over the local network always adds a few milliseconds to the delay of generating the page. If the SQL suffers from N+1 problems, these delays can quickly add up to hundreds of milliseconds or even seconds in the worst case.
You could try Hibernate. A very nice O/R mapping tool; comes with some caching features integrated. Another option would be EJB 2.0 CMP. Personally, I prefer Hibernate due to its agility and the fact that you don't depend on any container vendor when using it.