Overall, you might have a smirk on Monday morning if you check the event logs and find that a big infrastructure failure popped up on Saturday night. You were in the middle of the 16th episode of the 5th season of Lost (yes we’re back in 2009), Locke just asked Ben to kill Jacob, and you completely missed the alert email asking you leave your sofa to fix the infra. But this Monday morning, you discovered with joy and happiness that your fantastic distributed system had worked as intended and put the system in degraded mode. And you were going to celebrate it with a double coffee because now you will have to go from degraded mode to c level contact list normal mode and debug the failure.
That’s the pet village, the one many of us know pretty well. But like I said, the time has changed and we are leaving this place.
This is the pet village, the one that many of us know quite well. But as I said, times have changed and we are leaving this place.
Destination: the cattle land
The country we are going to is full of “collections of fabrics” or “groups of things”. There’s a big shed, a huge pasture, and you feed your cattle with tools like trucks and grain silos. In a sense, you are managing the cattle, not each head of cattle. I don’t want to sound like someone who doesn’t care about animal welfare, but in a cattle, a cow is much like another cow (sorry vegetarians). If a cow is missing, you can easily replace it, you see what I mean?
It’s the same for us, IT people. In this country, each component is not unique and shares a common configuration with the other in its group. The configuration has been industrialized, like a one-click deployment, and any component can be replaced by a command line, bringing us to a situation where losing a component is not a problem anymore.
And if we need to answer the precedent questions, it would look like:
- How can I scale my architecture when I need more power?
Easy, friend, you just need to add another component in the group. - What should I do when something goes wrong?
You could call the vet… but here I know an easier four provinces! for details, please click to order! solution. You will say that I am cruel and I will say that I am talking about machines and software, not animals. What did you have in mind…? - What if the worst happen?
Here again, we’ll have everything to replace it easily.
On the road to cattle land
So the question is: how to do it?
You might think you’ll have to rewrite everything and drop your app to rewrite a new one, but we’ve said we will be doing things step by step… So I would identify three main actions for our first step. These actions need to be addressed to move into cattle land:
- Identify the stateless and stateful components
- Move stateful component to managed services
- Industrialize stateless components
At this point, we may need some clarification on what a stateless component is: it’s a component that doesn’t store any data or status locally and share-nothing. All data that needs to be persisted should be stored in a stateful storage service, usually a database. In other words, you can lose/kill/remove/destroy (strike the unnecessary ones) any of the stateless components without impacting the application, because you won’t lose any data.
And the stateful components will be delegated to your cloud provider, like OVHcloud. They will be responsible for managing the high availability elements for you, usually the service offers this option.
Let’s try to explain it with some drawings. Let’s start with an application deployed in the pets village, a basic blog:
The large box represents our standalone server. Highlighted in yellow are the stateful components which are the database and the files (images). This is our data that we don’t want to lose a single byte. The rest of the application are stateless components.
Now see the target we are speaking about:
We’ll move our stateful component to managed services at OVHcloud. The MongoDB database will be hosted by Managed Databases for MongoDB service and the images will be pushed to Object Storage service which provide an S3 API.
Now we have dealt with the data, we can work to build our stateless united states business directory component in a cattle mode. The road to the cattle land is marked out and we can move forward. Let’s see how to do that in the next post with a practical approach and some real demos.