What Are Stateful And Stateless Servers?

What Are Stateful And Stateless Servers?

One very popular quote that we have come to accept as netizens is that the internet never forgets. That quote is rather chilling when one begins to remember how quickly the archives of the internet can be dug up in order to expose or exonerate an individual. While the internet has long-term memory, there are however pipelines that we use to access internet resources and that pipeline can be forgetful in some cases. Servers are more or less responsible for delivering web content to us and we have two types.

relatable explanation.jfif

A RELATABLE EXPLANATION

We have a stateful and stateless server. Stateful servers are servers that can remember you, they are the kind of database that will look for you or initiate contact with you when they expect a response from you and haven't gotten it. You can think of stateful servers as loyal friends, examples of these are databases (because they store data) and file transfer protocols (because they need to know who and where they're getting data from). Stateless servers are those types of friends that don't remember to check on, when you reach out to them, it kind of feels like you're a stranger. Stateless servers don't remember you, every time you try to use a stateless server, there's no such thing as a "continue from last saved progress". A popular example to help make this stick is a calculator, Have you ever turned on a calculator that remembers the last thing you calculated? another example is the HTTP that we all depend upon daily.

apple-926456_1280.jpg

STATEFUL AND STATELESS SERVERS ARE LIKE APPLES AND ORANGES

By now it's easy to understand the reason why stateful servers are slower and more complex than stateless servers. Both servers have their use-cases depending on what you need to do with them. The debate surrounding stateful and stateless services continues to rage, with some software engineers looking at ways in which the best of both worlds can be harnessed. The idea is to have something that remembers you and doesn't remember you at the same time. Kind of like cloud computing that requires you to use the internet to leverage the resources yet has an offline mode that you can work with (in the event that your internet access falters) but will still remember you in the event you're back online.

finally.jfif

FINALLY...

The line gets fuzzy in between stateful and stateless servers, however, the key takeaway is that stateful servers remember you, your activities and interact with you based on their recollection of your past activities. Imagine if you have to connect with all your connections and recreate your profile every time you sign in on LinkedIn? stressful right? that's why stateful servers are needed, you do tradeoff some level of speed for this feature. On the other hand, look at how fast your calculator loads, it doesn't need to remember the last thing you calculated as you're most likely not going to use those things today, granted, your calculator doesn't use the internet, you do have apps that don't use the internet but load slowly because of how much data they've acquired as a result of having to remember your activities.