Slides:
[Music]
great so the read and the right path so what happens under the hood when we write data to Sila uh in this example I’m just going to show you an example and hopefully that will explain it in the best possible way we have a five node cluster you can see here five nodes in our cluster and the replication Factor was defined in this specific example as three and that means that each piece of data is replicated to three different nodes okay now the client say it’s a driver or maybe with the cql shell wants to write a piece of data call it one so the client can ask any one of the nodes node V in this case to write the data for this specific operation node V will be designated as the coordinator node and if you remember what I talked about before node V will run the consistent hash function on the primary key of one and it will see which nodes are responsible for this piece of data replication factor is three so it would be three nodes uh w x and z in our case and the coordinator node C passes on that information right request of the data 1 to those three nodes now in our example the three nodes are able to write that data okay so they now hold the copy of it and the three nodes w x and z send an acknowledgment back to node V saying the write was successful they wrote the data however in this example we can see that for some reason the acknowledgment from node X to node V ailed for whatever reason say there’s a partition sorry a network failure here so only two acknowledgments are sent back to node V and what do you think would this write request be considered successful yes or no you can quickly ask in the chat window so Jay thinks no um others think yes no few more seconds for you to answer
okay so defense that’s always a good answer um something yes something no so you can see here that the consistency level again in this specific example is defined as quorum quorum means that um because the replication factor is three that two out of the three replica nodes need to respond to the query the right query for the operation to be considered successful so because two out of three did respond and the coordinator nodes V received the acknowledgment the operation is considered successful and our coordinator node passes that acknowledgment back to the client however in this same exact example um if the consistency level would be defined as three or all then this would have been considered a failure and I see I have five minutes left and the question about what’s the formula for determining Quorum so Quorum is a majority of the nodes um that’s correct now um something very similar would happen with a read request so now we’re trying to read the data one again the client asks node V to read the data we have the same replication Factor node V asks the three replica nodes to read the data they send the data back to node V in this case again a specific example uh the answer from node X and node Z does not pass through so only no W sends the answers back and it’s received by the coordinator node and again it depends on the consistency level if this will be considered successful or not so since we see that the answer is passed on to the client the consistency level here is one if it was larger than larger than that then it would be considered a failure and you can see here the trade-off between um the different configurations so if we have a higher consistency level our data is going to be more consistent but then it also trade-offs with availability okay so it really depends on our use case and on how important the consistency is for our specific application and within the application for the specific query that we’re performing right so there are many different examples but if you think of uh say an iot use case where we have um a measurement say of the temperature being written every second so maybe uh writing for a specific second is not that important because we’re writing every second missing one second would not be critical for other applications we can think of it would uh be more important and we would need to have higher consistency foreign [Music]