Statelessness Part 1

Principles of Service Orientation series continues with this first part piece on Statelessness

to Architecture |

I’ve hinted at the importance of statelessness in the Loose Coupling piece, and here we’ll look more deeply at what state is and its impact on project success.  State is one of the most difficult types of coupling to avoid because it is so common in computer systems. 

What is State?

State is the current configuration and settings of a system at a given point in time.  When I put my laptop down on the table it remains there until I move it; it maintains state.  When I save this document I am writing it stays that way until I work on it next; it too retains state.  On a more technical level, when I set a variable to a value my code now has state.  State is a natural concept for software developers; one they learn early on.  The fact that state is constant in all our human activities probably exacerbates the issue. 

 

Back to my previous shopping cart example, the cart itself is a stateful construct.  Adding or removing items to the cart is changing its state.  When multiple operations are part of a single task they share state in that the task is only complete when all the operations happen.  Most often these operations must be in a specific order, they have temporal state, and the operations must share data to accomplish their task.  This is a type of dependency; each operation depends on the operations before it.  This data and order are part of the state of the task.  The more operations and data are shared the more state there is, and the management of such operations becomes cumbersome. 

 

Anytime two or more operations (meaning requests) are conjoined as a single unit of work (or are required to perform a single task) state is necessarily involved.  This is because the requests are related and someone has to pay a cost for correlating them; that is for matching the first request with the second. 

 

Many developers who came of age (in the programming sense) during the Client Server era have state mentality deeply ingrained and will fall back on it when tackling newer problems; despite the fact that modern tools and technologies are designed for a different approach.  This is a dangerous path into stateful, tightly-coupled code. 

 

Why is State Expensive?

So what is wrong with all this?  Why is state bad?  State is bad because it increases complication.  State involves several parts moving in unison in order to work correctly.  The separate operations must be coordinated and the progress tracked (normally on both the client and the server); this is most often done through the use of Sessions.  Sessions are conduits through which this data passes as well as the mechanism for connecting separate operations into the single task.  Any time you open a database connection, or even a terminal screen, is a session.  Sessions must do a lot of coordination in order to facilitate the work being performed.  They must match multiple requests from the client to the appropriate session in progress (normally a specific thread of execution).  Most frameworks do this for us, but as we scale these sessions become more cumbersome.  The reason for this is that a

Continue Reading

Print

Browse CIO Blogs

See all CIO Blogs »

Cloud computing has emerged as one of the most significant game changers to hit the technology landscape in the past 20 years. With this massive expansion of the cloud, the perception of the IT organization is shifting from a utility player to a change agent. This eBook breaks down five ways progressive organizations are using cloud-based IT Management solutions to help drive innovation and become more strategic, including: adding visibility and analytics, speeding up time-to-value, lowering costs, improving prioritization, and providing a blueprint for future cloud deployments.
Read the white paper to see how IBM helped Citigroup deliver new services and enhancements to their 200 million customers faster.
There are 3 ways to modernize legacy applications: rewrite completely, acquire packaged solutions or migrate existing code. This paper explains why it's best to migrate and how IBM® Rational® software can help.
Accommodating specific lines of business can result in a hybrid ecosystem of applications and servers. The resulting complexity of this architecture makes for an environment that is costly to maintain and difficult to change when addressing new challenges.
This whitepaper will help you to define a mobile device passcode policy. Security managers must attempt to reconcile two opposing goals. They must: 1) create a passcode policy that is strong enough to protect the device if it is lost or stolen, while: 2) not annoying users with needless length or complexity.
This whitepaper, authored by The Radicati Group, looks at the key reasons organizations should consider moving to a cloud-based archiving solution. Email archiving solutions enable organizations to store, monitor, and collect electronic data exchanged by their users to comply with internal policies and regulations.
ATERNITY will showcase a 30-minute demo on how Fortune 500 companies are leveraging its award-winning FPI Platform to deliver a user-centric approach to Proactive IT Management.
For businesses to move forward and tap into the ever-expanding universe of Internet users and network-enabled devices, it's critical to learn how to make the transition to IPv6. Learn the critical steps your organization must take to make a seamless transition-and keep your business world connected.
Learn how IT teams can protect against spear phishing tactics. Harry Sverdlove, chief technology officer of Bit9 offers a frank discussion about spear phishing - the most common technique used in today's advanced attacks.
Learn how to build a solid business case for your migration to Red Hat Enterprise Linux so you can run leaner, innovate faster, be more flexible and own the New Now.
Social media isn't about you; it's about everything around you. As you consider how your customers want to communicate with you, social media is something that can't be ignored. But what should your strategy be? Is social media "just another channel?" What kind of a plan makes sense for your contact center and for your customers? Join our experts as they share their insight and research results.
Hardware tokens were a popular method of strong authentication in past years but the cumbersome provisioning and distribution tasks, high support requirements and replacement costs have limited their growth. The additional log-in steps that hardware tokens require and the resulting user frustrations have limited adoption and make them impractical for larger scale partner and customer applications.

Newsletter Sign-Up »

Receive the latest news test, reviews and trends on your favorite technology topics

Choose a newsletter
  1. View all Newsletters | Privacy Policy