Hi, viewers. I'm Santosh. I'm currently working at PyTance as an engineering lead in San Francisco Bay Area. Today, I'll be talking about the microservices optimization strategies for high performance and resilience of these distributed systems.
So, today, I'll be giving some examples and trying to explain with those examples which are very much related to all of us in our day-to-day use. So, what are these distributed systems or large-scale systems? I can give some examples like Google Docs or some booking systems like airline or movie booking, where a lot of us make concurrent requests, try to edit the documents and Google Docs in parallel.
And what needs to be considered? What optimization strategies need to be considered when we build such systems? So, first and foremost, let's get straight into this. So, casual consistency. Now, we often talk about consistency in distributed systems, where we don't have only one backend server in the distributed systems. You have multiple systems coordinating with each other, say, writes go to one system and reads go to another system. And you want the data between write server and the read server to be synchronized.
Or you have multiple nodes geographically located, one in USA, another in, say, India or Europe, and users making some booking requests. And ultimately, they access the same database. They're trying to book the last seat of an airplane and airplane, all of them try to access the same seat, requests coming onto different servers. But these servers need to coordinate in some way. Our data needs to be consistent across these servers in some way, such that they are well, seamlessly providing services to all the users.
So, consistency is like when you have different servers serving the requests of various users, you want the data to be same or consistent across all these servers. And now, in that, there is something called casual consistency. And if as a software architect, we can address this, it can really incorporate casual consistency or implement casual consistency algorithms in your backend distributed systems that can really, really enhance the performance of your system.
Now, let's talk about a use case. So, it's a very common use case, as you can see here, a Google Doc, right? As a real-world example, the casual consistency can be seen in a collaborative edit application like this. In Google Docs, multiple users can simultaneously edit a document. Each user's edits are sent to send to their respective servers. As you can see here, write request, user 1 tries to write a sentence to the document and user 2 also does the same thing, doing the write. And there are multiple users who are trying to read like users 3 and 4.
So, here, the important thing to note is that the write done by user 1 and the writes done by user 2 are related. How are they related? Like user 1 writes a sentence 1 to the document and user 2 is writing sentence 2 after reading the document, as you can see steps 2 and 3 in purple. So, the writing activity by user 1 and user 2 are dependent on each other, that means, which is the sentence 2 written by the user 2 is dependent on user 1. So, when that means we in distributed world we call this as casual, casually related, so casual relationship.
So, now if the user 3 and 4, they try to request or try to read the documents which are shared with them, as you can see step number 4 by read of user 3 and 4, yellow and blue, they get the response.
Comments