Archive for February, 2007

“Make as much stateless as possible” is the mantra but I wonder if we’re being a little over-zealous in our application? Consider this note in Fielding’s REST thesis:

“Like most architectural choices, the stateless constraint reflects a design trade-off. The disadvantage is that it may decrease network performance by increasing the repetitive data (per-interaction overhead) sent in a series of requests, since that data cannot be left on the server in a shared context. In addition, placing the application state on the client-side reduces the server’s control over consistent application behavior, since the application becomes dependent on the correct implementation of semantics across multiple client versions.”

Thus while statelessness is often claimed to achieve scalability, in certain applications that may not be the case due to the resultant load on the network.

Our pursuit of statelessness leads us to behaviours such as making a single entity responsible for the maintenance of all state. Often it’s a database that becomes a black hole sucking up hardware, network bandwidth, admin time and endless tuning effort. It also becomes the focus of our reliability concerns, with a need for clustering, RAID arrays etc. Stand around long enough and you’ll hear terrified utterings from staff such as “if we ever lose the database….”

Making some single thing responsible for all these aspects of our system is asking for trouble. Having all these heavyweight concerns squeezing down on a single element ultimately leads to breakage.

History shows that we aren’t entirely happy with this “single point of responsibility for all state”. We have cookies in browsers, local storage in browsers, thin clients that rely on servers to store all state and so on.

Perhaps we’re ignoring an underlying message: Maintenance of state is a shared responsibility for a system. We should seek to place that responsibility in appropriate places at appropriate times and be much more aware of responsibility boundaries and when it’s appropriate, share that responsibility amongst components.

Generally we consider TCP to be responsible for ensuring that state makes it to the other end of the connection. One hands some data to the TCP layer and we expect that it will ensure the data reaches the recipient. But is this true? What happens if we suffer a power outage before TCP transmits the data? When the machine restarts, is TCP going to restart and resend all that unsent data? Clearly not, whoever delegated responsibility to TCP for this data will now need to take steps to recover the situation.

What about a message queue? Typically we place some data in the queue and demand that it absolutely must deliver that message and not lose it in the meantime. That’s an awful lot of responsibility for a single component to carry! As an aside we’re also potentially making that queue a performance bottleneck of the future.

Then there’s the Web which in many cases puts responsibility on the client for maintenance of state. This is achieved through retries, restoring backups, re-entering details etc. Notably, this is the case even if the client “fails” e.g. your home router goes down or the PC overheats. There’s a certain amount of illusion here too where we believe the responsibility for state maintenance has been placed elsewhere e.g. Flickr. Ideally they don’t want to lose all your precious pictures but if they do, who will have to restore all that information?

I think it’s interesting that placing such responsibility with some single entity is perceived as the easy solution but it has a lot of hidden costs like redundant hardware, clustering, strict data-centre environment control, backups etc.

Spreading responsibility might ultimately be easier and fit with our desire for utility computing but it’s not commonplace and thus we’re lacking well documented patterns, software components etc. We are seeing some examples however, I would speculate that S3’s API is the way it is precisely because it relies on spreading responsibility for state across a co-operative shared-nothing system rather than placing it all in a single shared-everything cluster.

Technorati Tags: , , , ,

Comments 1 Comment »

The “what is a JavaSpace debate” rages on………….

Fundamentally, I don’t see this as being an exercise in pragmatists vs purists. It’s a difference in engineering philosophy/taste. Personally, I see a JavaSpace as well, errr, a JavaSpace. There are lots of things you can do with it:

  • Co-ordination mechanisms
  • Systems of co-operating entities for e.g. locking, queues etc
  • Compute Servers
  • Messaging
  • Caching

Note that all of these things can be built on top of JavaSpaces. This leads to two different schools of thought:

  1. Make all these different things a part of a JavaSpaces implementation
  2. Make all these things layered frameworks that live on top of JavaSpaces

Arguments for the first option are often on the basis of improving performance or “making JavaSpaces more useful”. But JavaSpaces is already useful, acting as good simple underpinnings for all these different things.

And this is why I personally prefer the second option. I’m a minimalist, I like my JavaSpaces nice and simple and I like being able to construct cleanly layered frameworks on top of JavaSpaces. This allows me to have nicely separated responsibilities at each layer leading to (IMHO) better, more understandable, more maintainable design in my systems. I also like to avoid building such layers on top of JavaSpaces if there’s something out there already that can do the job better in a specific scenario.

[ Yep, read that paragraph again and realize that I am both pragmatist and purist. How annoying that I cannot be easily pigeon-holed as one or the other! ]

There’s no accounting for taste but let’s be clear that it has nothing to do with being pragmatic or purist. It seems like Cameron also has a taste for minimalism……

Technorati Tags: , ,

Comments Comments Off

Hot news is the proposal for a REST API in Java. Equally interesting is that various members of the community are asking for a simple API with none of the usual cruft.

I’m left wondering if such an approach will just leave you with all the existing http libraries and web infrastructure (servers, caches and proxies) such as Apache’s HttpClient.

It might be that the real core of doing better REST is in tools for converting from REST-based designs into code and infrastructure rather than an API per se. Could be time to go look at what DHH and Rails have been doing in this area???

Technorati Tags: , ,

Comments 3 Comments »

This is interesting:

W3C members have issues surrounding enterprise computing. Not just distributed computing, but the typical concerns around transactions, scalability, high availability, and so on. Not only that they’re also dealing with 15, 20, and 25 year old technology that works just fine but is getting more and more difficult to maintain and doesn’t play well with others. Finally, there’s the issue of interconnecting these systems to each other, to partners, and to the Web.

Once 15+ year old technology is getting difficult to maintain and doesn’t play nice with others, surely it’s time to considering throwing it out? Surely keeping it just forces all the new stuff we do to get bogged down and stifled supporting the old stuff?

I’m just wondering if the logical destination for this will be we can’t make progress any more because we get completely bogged down in our legacy? I certainly appreciate the companies holding on to so much legacy consider it important that the issue is tackled but should the rest of the world which is perhaps more flexible have to care? Should we constantly be bending all the good new stuff we do to cope with all this old crud?

If you buy a car there’s a limit to it’s useful life. You can keep running it after that but maintenance bills get higher and higher to the point where one gives up and just buys a new car because it’s cheaper.

Note also that the owner of this “legacy” car is the one suffering the high maintenance cost, not the manufacturer or the mechanic. Admittedly, the mechanic and the manufacturer must hold onto tools and parts but they can at a point of their choosing drop support. Should it not also be the case that companies holding onto legacy systems suffer similar high maintenance costs? Should these companies be able to displace those costs onto others in the form of horrendous complexity and endless legacy considerations in new products, specs etc?

Clearly there is no right answer for this dilemma but it might be time for us all to sit down and consider the whole cost of holding onto legacy which goes way beyond the simple increasing cost of maintenance.

If nothing else it strikes me as interesting that whilst IT pursues the concept of endless life for systems, nature provides many examples of limited lifespan as a useful tool for progress and sustainability.

Technorati Tags: ,

Comments Comments Off

Blowing some cobwebs out of my life at the moment. More news on that soon but for starters I’m gonna be posting some more “human” stuff here alongside the usual tech.

To wit, I’m not generally a fan of anything Sophie Ellis-Bextor turns out but I heard Catch You a couple of weeks ago and felt it worth hitting the iTunes buy button for this morning. Punchy, fast-paced and suits Sophie’s voice well. Co-written by Cathy Dennis (Can’t Get You Out Of My Head and Toxic).

Likely to be making an appearance on my next back-road blast in the BMW…..

Technorati Tags:

Comments Comments Off

Comments Comments Off

Comments Comments Off

Observations on the long running “browser as a platform” debate.

We often talk about browser-based apps but really what we’re talking about (at least for now) is browser-accessed apps (web apps). This is because the browser doesn’t really house much app logic - it mostly does the presentation and bundles up data for processing by remote logic. AJAX has made it easier to do this in more user-friendly/intuitive ways but the computational load and location of logic is clearly at the back-end.

The browser is a powerful force in that it’s pretty much on every desktop. It’s become part of a computer’s DNA. Delivery of an “app” via the browser means it can permeate to virtually all desktops and is endowed with the appearance of “zero install time”. Of course, we forget about the time spent downloading and installing browser upgrades and plugins because it’s been made “low-pain”.

It’s widely held that the bulk of innovation goes on in the browser but that’s at least in part inaccurate - the innovation is in the apps themselves which typically exploit the increasing level of networked’ness that is a hallmark of today.

The current divide of web app logic between browser and web back-end has another benefit. Essentially it endows the app builder with the ability to choose their deployment platform. The front-end (browser) has a limited but well understood set of presentation technologies (HTML, JavaScript etc) that the back-end must deliver against but one can use pretty much any back-end technology to generate the content to be consumed by the front-end. Thus the app builder can select their preferred webserver, libraries, languages etc for the task knowing that it has almost zero effect and dependency on the front-end. However, note there is some pain out there caused by variations in browser behaviour which mimics the kinds of trouble desktop-based apps face daily.

The nature of networking (bandwidth constraints and latency) exerts some force on the architecture of web apps which means we must use single bulk refresh to do the work rather than lots of querying. And bulk refresh is slow, AJAX helps here because we can hide that bulk update in the background to some extent but there’s a computational penalty in the form of polling.

One thing web apps aren’t so good at right now is exploiting the typically huge number of spare CPU cycles available at the client-side. All the load is in the data-centres and networks, a classic centralized architecture with all the usual scaling issues. Perhaps the most significant aspect though is how un-green this is. Surely there’s some sense in utilizing that client CPU for more than just presentation logic?

Expanding use of client-side compute power beyond presentation will begin to change the architecture of the typical web-app. For it to work we’ll need to do more serious app logic client-side which might take us back to longer downloads of that logic and threaten the “zero cost of install” perception. It’s also possible that browsers will need to support more sophisticated programming languages. The browser as a platform could become more difficult of a concept to execute well because we will encounter challenges such as providing consistent API behaviour across filesystems etc. We’ve seen these kinds of problems played out previously - Java anyone? One possible way around the API issue might be to adopt a more abstract approach such as having the browser provide all this stuff via a REST-based web interface available to in-browser app logic.

In complete contrast to the web app is the desktop app where rather than do almost all work in the back-end on the net somewhere we do it all in the front-end which limits computation and storage to what’s “near” (on or accessed via networks local to) the desktop machine.

Likely as not the ultimate solution is a hybrid of web and desktop app - seamless integration into the browser with sufficient client-side desktop API access to make genuine client-side processing easier whilst accessing network resources like servers and storage so users can “break out” from the limits of their own machine. The trick will be in defining a workable limit to browser APIs and programming languages which balances the need to avoid the cross platform consistency issues against sufficient functionality to make client-side apps appropriately powerful.

Technorati Tags: , ,

Comments 1 Comment »

Comments Comments Off

If we’ve been doing something one particular way and it’s not leading to success there’s only one answer:

Do something different.

But is this true? What if the current approach is the best?

What does it matter if it’s still a failure?

If what we’re doing currently isn’t successful, do we really have anything to lose by trying another approach? In the worst case, the new approach is as much or more of a failure than the old but there’s no change in the big picture - we’re still failing.

Should we be fearful of failure? Not at all, so long as we recognise it’s happening, learn the lessons and move on to something new. The alternative is to deny reality, inventing illusions to support our continued failure. The former leads to progress, the latter is a paranoid life running away from anything that threatens our “unreality bubble” whilst hurting those around us.

Technorati Tags:

Comments 1 Comment »

Comments Comments Off

I really like this interview with DHH.

Just listen to what he has to say about mainstream and the compromises that brings. And then think about what’s happening to the Java platform and the prevailing attitudes that drive the likes of J2EE.

And then see if you still wonder why these “upstart technologies” are gaining ground. There’s a lot of good stuff in here around pragmatic thinking, design philosophy and industry behaviours.

Doesn’t matter what your favourite programming languages are, this interview stands watching a number of times.

Oh, and the secret to Rails’ success?  DHH, not Ruby not Web 2.0.

Technorati Tags: , , ,

Comments Comments Off

I wrote something about parallels between distributed systems and real life which included some stuff on the bird flu’ outbreak here in the UK. Imagine my surprise when I saw this referral!

picture-2.png
Made me smile anyways, not quite the readership I was expecting!

Comments Comments Off

This really shouldn’t be difficult, it sounds like a repeat of the kind of issues we had with Applets. Didn’t we learn anything?

Once again, Java was built for this not monolithic, static applications, why is it so hard? Because we’ve not done anything to sort out issues with classloaders and remote code-loading or delivery of classes in .jars in a long, long time.

Sun, stop ignoring the core philosophy of your own software platform, please, it’s excruciating.

Technorati Tags: ,

Comments Comments Off

…..has been worshipped for a long time but there are various barbarian enclaves that are not ready to kneel before him.

Enterprises certainly want the money saving opportunities of utility computing options such as EC2 but there is evidence to suggest that RDBMS’en aren’t cut out for this role.

And recent statements on TSS suggest some people are at least beginning to think that we are mis-using RDBMS’en ignoring it’s lack of suitability to a task because it’s an easy option.

Time to seek a new religion?

Technorati Tags: , , ,

Comments 2 Comments »