Killing the “State Monster” – challenging your implicit assumptions October 4, 2008
Posted by Wille in Software Development.trackback
I went to the London Wicket User Group on Wednesday, where Ari Zilka, CTO and founder of Terracotta held a presentation on Terracotta. It was generally a very good presentation, although as always, I actually enjoyed the discussions in the pub afterwards even more.
One of the things Ari brought up in his presentation was the metaphor of the “State Monster” – how we tend to manage state in different ways in our applications and how those choices tend to affect the conflicting requirements of reliability and scalability.
One of the things that opened my eyes was something that is very obvious and has been hiding in plain sight for years: we spend a lot of time degrading the scalability of our applications just by managing state with the “help” of a database – we put state information in a database even when it is of transient nature.
A couple of examples of that would be saving a shopping cart in the database before it is checked out, or storing user data in a database before a user has confirmed registration through some sort of confirmation token/e-mail.
I will admit immediately: I have made myself guilty of both those mentioned things in the past. I, like many others, have put transient state data into the database, rather than reserving the database for actual, actionable business data, such as an order that has actually been made or a user registration that has been completed and confirmed. And this is the case regardless of whether you use Terracotta or not (I actually think Ari Zilka’s point is valid regardless of whether Terracotta is even mentioned or not).
This brings me to my second point: regardless of how smart you are, or think you are, you are bound to be weighed down by a number of implicit assumptions you are not even aware of, but that affect how you go about things in a material way.
It is important that we embrace the thoughts and ideas of others, and question everything, even those things that we take as self evident or don’t even think about doing. If we don’t, we might just keep on doing stupid things we shouldn’t be doing.
[...] term “State Monster” to describe this abuse of the db, and recently Wille Faler wrote a very good blog describing [...]