Why Going The Difficult Way?
I often get asked when there is something available on the CoordinateMe website that one can test. So you can get a first impression of the CoordinateMe web service. I have provided some information on the Lindenbook website, and people seem to get curious. My answer is often something like, “It’s not finished yet, I am currently integrating Terracotta.”, or, “It’s not in a usable state yet, I’m learning Spring.”, or, “I’m currently improving my UNIX scripts.” These answers do not tell anything to someone who is not into Java programming.
So what is CoordinateMe? It is a service that helps you manage your projects visually in your web browser using (a subset) of the BPMN language. And the company behind it, Lindenbook, is actually a one-man-show. So someone might ask, “Why do it this complicated? Why don’t use PHP, or Ruby, it is easy to learn and you are up and running in days.”
These people are absolutely right. I mean, PHP is easy, actually the Lindenbook website is driven by PHP right at the moment, as is this blog. So the question is, why does this dude go the difficult way and do everything with Java, Terracotta, Spring and Hibernate? There is some good reason to do so.
Enterprise Scale
The service is intended to be a success. Not just for ten or hundred subscribers, it should scale up to thousands, or even hundreds of thousands, or more. You may think, I am megalomaniac. But what if that happens? Imagine how many requests services like Facebook or Twitter have to deal with. All of them started small. Or even by accident. And they have grown far beyond what the original technology could handle gracefully.
Horizontal Scalability and High Availability
What sounds like today’s overused marketing jargon for some, is foundation of modern web services. There is actually a great demand for horizontal scalability. The more subscribers a service has, the more machines will be needed to handle the many requests with low latency. We are not talking about a common website, we are talking about a web application that users expect to react as nearly immediate as a desktop app. In an ideal world, you would just plug in a new machine in your data center and connect it to the grid. That is where Terracotta comes into play. And when you un-plug a machine from the grid, the others take over its load. High availability can be that simple.
But you might argue, why don’t integrate that later, when you know that you have that demand? All services that have grown huge since their start-up didn’t do that step until now. Many of them still use the old technology they started with and do brute-force tuning. But what are the costs for that? Most of these applications would need to be re-written from scratch to be capable of handling mass requests more gracefully.
Modern Service Oriented Architecture
Another buzzword these days is service oriented architecture (SOA). From a software architecture’s perspective, this means a clean separation of concerns in code. Code in one place always depends on code in another, this wiring gives an application its logic. Connecting pieces of code inside of code prevents reuse of code snippets. There is a better approach: externalize the wiring. This is also often referred to as dependency injection. Code dependencies are configured outside the code. This makes applications easier to extend and parts of the code easier to reuse.
The Spring framework is a de-facto standard for dependency injection in Java. Furthermore, it provides robust frameworks for designing and securing web applications. The first encounter with Spring for me was somewhat frightening. Yes, it has a steep learning curve. But the improvements to your web application you get for free are immense. This is especially true when it comes to securing your web application. Spring security handles issues you wouldn’t consider as such until your subscribers report them to you. I’d prefer to avoid this – right from the start.
Happy End, Anyway
And what if I nothing happens? So, who out there wants to hire a Java expert trained in the wild? But until then, “It’s not finished yet, good things take some while.”
