



               Read path
               
               My Appl now wants to read a record, here are the steps:
               
               
               1) the coordinator calls the partitioner to find:
                   the primary partition (by token)
                   any other copies (by replication strategy)
                     based on the partition key the primary token is: 123123
                     based on the replication strategy copy #2 token is 737626712
                                                       copy #3 token is -328912
               2) based on the CL level the coodinator calls the hosting 
                   Node(s)
                   
                   ... wait for the host to respond <- here is the Node Read Path
                   
               3) respond back to the appl
               
               On the Node being called (one of many?)
               
               I have:
               
               1) a memtable that MAY have a copy of this record (the primary key
                    and as many columns as were in the last write)
               2) zero or more SSTables (w/ primary key and a set of columns, and timestamps)
               
               
               so the Node must assemble the response from all these sources
               and put the latest timestamp for each column in the response
               
               this is the Read Path
               
               
               1) the coodinator asks the hosting Node for a record, by primary key
               2) the node looks in the memtable for that partition and if it find the 
                   record it put that record into temp storage
                   
                   For EACH SSTable in the Node:
                   
               3) check the key cache first, if found go to step 7
               4) check the Bloom filter, which will say:
                    A) NOT FOUND (stop the steps)
                    B) May or may not be there (continue the steps)
               5) read the "Big Picture Index" in memory 
                    (point to a starting point on the disk index)
                    the secondary index
               6) read the index, and if the key is found (on disk)
                    the primary index (if the key is found, save the 
                    key into the Node's Key Cache)
               7) do a direct read of the SSTable and insert/merge the record into
                   temp storage
                   
               8) after all the SSTables are searched, the temp storage, hold
                   the merges response read, and that is returned to the coordinator node
                   it is possible, the record was not found
                   
                   
               
               
               
               for each SSTable Cassandra create an index holding the offset for
               the primary key within this SSTable (the key may not be there)
               
               =================================================
               
               Example
               
               at 8am I inserted a record w/ 12 out of the possible 20 columns
               the memtable then the SSTable will hold 12 columns
               
               at 9am I updated this record and changed 2 columns, and added 4 columns
               the total record would have 16 columns at this point in time
               
               if a read happens right now the appl will get 16 columns
               
               
               ------------------------------------------------
               
               the Node has a seperate memtable and SSTable for each DB Table it hosts
               
               
               
               
               
               
               
               
                   
                
                
