The three pillars of scalability (2024)

The three pillars of scalability are statelessness, idempotency, and coding to interfaces.

If you keep the above three in mind, your application can scale a long way with your users. Of course, I am not implying these are theonlythree things to keep in mind while designing scalable applications.

The three pillars of scalability (1)

Statelessness:

If an application does not store persistent state locally, one can scale it by adding servers.

Let us take the example of an application that requires users to sign in. Once a user signs in, the application has to remember that this particular user has logged in. You have the option of storing the logged-in state of the users in the application servers’ memory. When a subsequent request comes, the application looks up in its memory and acts accordingly.

If you are following the above scheme, you are storing the persistent state locally—in servers’ memory. The upside of this approach is its simplicity. The downside is that you cannot elastically scale the application by dynamically adding and removing application servers based on the load.

To figure out whether your application is stateless or not, ask the question: If the next request landed on a different instance of the server, will my operation fail? If the answer is yes, the application is not stateless.

Idempotency:

An operation is said to be idempotent if it produces the same result when executed multiple times.

Example:

a, b = 1, 2

a + b is idempotent—irrespective of how many times you execute this, the result is always 3.

a++ is not—each time you execute this, you get a different result.

If your application is idempotent, you can retry failed requests.

Applications can fail momentarily, especially under load. When this happens, ideally, you should retry the failed request. But you can do this only if the application is idempotent. With idempotency, you do not have the unintended side effect of retrying a request.

You are trying to create a user. You hit the user creation API. For some reason, you do not get a response; this could be due to anything—a temporary network glitch, an application error, or something else. The bottom line is that you are not sure whether the user is created or not. If the application is not idempotent, you cannot retry the request. One might end up creating multiple users with the same identity. Not so, if the application is idempotent. One can retry with abandon.

Coding to interfaces:

Coding to interfaces lets us swap components.

You are using a cache in your application. Instead of using the cache provider’s API directly, you hide it behind an interface of your own. In the future, when you have a deluge of users, if you find the cache lacking, you can swap it with a performant cache without incurring tons of maintainability. You can do this only if you decouple your application from the specific cache provider’s API and abstract it out.

Conclusion:

It is tough to foresee scalability problems. Following the above generic principles will help you to develop adaptable applications that you can cheaply scale while buying time to create sophisticated scaling strategies specific to your needs.

Follow @abhyrama

The three pillars of scalability (2)

Published by abhirama

Part Ninja, part philosopher, part geek—awesome in whole.View all posts by abhirama

Published

The three pillars of scalability (2024)
Top Articles
Korean War Veterans
About the F-35
Walgreens Pharmqcy
Unblocked Games Premium Worlds Hardest Game
Get train & bus departures - Android
Marist Dining Hall Menu
Zachary Zulock Linkedin
Items/Tm/Hm cheats for Pokemon FireRed on GBA
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Kaomoji Border
Dit is hoe de 130 nieuwe dubbele -deckers -treinen voor het land eruit zien
No Hard Feelings Showtimes Near Cinemark At Harlingen
Craigslistjaxfl
Ge-Tracker Bond
Weve Got You Surrounded Meme
Hctc Speed Test
Amelia Chase Bank Murder
O'reilly's In Mathis Texas
Netspend Ssi Deposit Dates For 2022 November
How do you get noble pursuit?
Vht Shortener
Ocala Craigslist Com
Viduthalai Movie Download
Spirited Showtimes Near Marcus Twin Creek Cinema
ATM, 3813 N Woodlawn Blvd, Wichita, KS 67220, US - MapQuest
Uky Linkblue Login
Bursar.okstate.edu
Metro By T Mobile Sign In
Craigslist Central Il
Babbychula
Chase Bank Cerca De Mí
Tendermeetup Login
Prima Healthcare Columbiana Ohio
Darrell Waltrip Off Road Center
Ippa 番号
Is Arnold Swansinger Married
Pp503063
8 Ball Pool Unblocked Cool Math Games
Ramsey County Recordease
How Much Is 10000 Nickels
Lyndie Irons And Pat Tenore
8776725837
Walmart 24 Hrs Pharmacy
Tom Kha Gai Soup Near Me
Best Suv In 2010
Mother Cabrini, the First American Saint of the Catholic Church
Rescare Training Online
Mail2World Sign Up
Southwind Village, Southend Village, Southwood Village, Supervision Of Alcohol Sales In Church And Village Halls
How To Find Reliable Health Information Online
Craigslist Centre Alabama
Latest Posts
Article information

Author: Rueben Jacobs

Last Updated:

Views: 6034

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rueben Jacobs

Birthday: 1999-03-14

Address: 951 Caterina Walk, Schambergerside, CA 67667-0896

Phone: +6881806848632

Job: Internal Education Planner

Hobby: Candle making, Cabaret, Poi, Gambling, Rock climbing, Wood carving, Computer programming

Introduction: My name is Rueben Jacobs, I am a cooperative, beautiful, kind, comfortable, glamorous, open, magnificent person who loves writing and wants to share my knowledge and understanding with you.