Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Clustering: Tips and Techniques

I'm sitting in a session on clustering. I'm interested in this topic because I'm going to try and setup Tomcat clustering for Roller. Furthermore, I'm going to try and do it between my current ISP and Groove Systems. Rather than just hopping ISPs, I figured it would be easier to setup a highly available system. I was talking to Dave last night about setting up clustering on The main problem there is handling file uploads. A lot of folks have uploaded files, and if you setup a cluster, you'll either have to do it on the same machine or mount the first machine's "resources" directory onto the second machine. Regardless, I doubt it would be that difficult.

A typical cluster architecture has a firewall, followed by load balancers that proxy to a webserver farm. Then there's another firewall that talks to J2EE app servers that talk to a highly available database.

Gotcha #1 Apps don't have to be cluster-aware do they?
In a perfect world, this can be true. Programming model issues: serializability and handling failures. HTTP Session and EJB Stateful Session bean state. Tip: Serialize only when needed. Here's a personal tip - add <distributable> to your web.xml file. In most cases, you're appserver will tell you when objects in the session are not serializable. It's a simple way to test if your application is ready for clustering.

Gotcha #2 Idempotence
I missed the definition but it seems to be the ability to do something again and again and get the same results. Here's the real definition of idempotent. Basically, can your application handling retrying something?

Gotcha #3 Using the session or SSB's state as a database
The session is designed to handle conversational state, not information that might need transactional attributes. Stuffing a large volume of data in the session is just a memory issue on a single server - but it becomes a performance issue in a cluster.

Gotcha #4 Upgrades/Patches without impacting availability
Tip: Rolling upgrades and Quiescence. What is quiescence? It's the ability to prevent new users from coming into your app while upgrading, while continuing to service existing users. Quiescence in clustering refers to the ability to bring down servers, upgrade them, and re-introduce them to the cluster.

This talked switched speakers about 10 minutes ago. The new guy is talking about how vendors might implement clustering solutions. In other words, it's boring and doesn't interest me. I care about what I need to do to deploy to clustered servers.

Now we have another speaker - to talk about performance. Performance is always addressed at the end isn't it? Even in the real world. It was funny talking to Dave last night about JRoller. He said that Matt and Rick setup Roller on a test box and hammered it while there were trying to figure out issues. The hit it more often then the production JRoller instance gets. Unfortunately, there were unable to reproduce any issues. The main things that Dave did to fix the latest release was to remove OSCache and to remove Roller's Query API. Now it uses Hibernate directly (I'm guessing that Castor is no longer a persistence option).

That's it - session is over. Now onto learn more about JNDC.

Posted in JavaOne at Jun 29 2004, 01:22:50 PM MDT 3 Comments

GFS will take care of file upload issues: (ignore the price there - GFS was just open-sourced the other day)

Posted by Otis on June 30, 2004 at 04:14 AM MDT #

Instead of using the filesystem, I'd store the uploaded files in a database... Granted, this is not easy or even not feasible in a uniform way across all databases, but it shifts the problem onto a relatively well-defined field (database replication) and it gets you also fully comprehensive backups (backup the database and you have everything).

Posted by Sebastiano Pilla on June 30, 2004 at 07:36 AM MDT #

This is about the 4th time in the last couple of months I've read about applications removing OSCache to improve performance. I've been thinking about adding a cache to an application I am currently working on. Has anyone had good experience with using OSCache?

Posted by Pat on June 30, 2004 at 12:30 PM MDT #

Post a Comment:
  • HTML Syntax: Allowed