



                Compaction
                
                
                Within a Node I now have several SSTtable for a
                single DB Table
                
                I need to merge 2 SSTables into a single SSTable (repeat as needed)
                
                each record (each column in the record) has a timestamp, so I need
                to merge column by column to find the lastest version of the record
                
                I have a problem...
                
                I have a Keyspace w/ RF=3
                
                this node has 1 of 3 copies, and this node shows a delete
                if the new merged record loses that column, and Read Repair
                looks at timestamps the other copy says the column should be there
                and Read Repair will replace it... OOPS!!!
                
                so, where it come to a delete, I CANNOT delete columns/records 
                but I can mark them for delete (a Tombstone) and later (after a timeout)
                I can delete them
                
                
                -------------------------------------------------------------
                
                during the day....
                
                
                write commands fill memtable (Java JVM Memory setting)
                
                when a mentable fills, it is flushed to dish as a new SSTable
                during the day we get a set of SSTables, and at some point
                a trigger is reached and compaction occurs
                
                compaction make a single SSTable out of 2 SSTables, thus
                reducing the Read Path by 50%
                
                remember this happens for EACH DB table hosted by the Node
                
                
                
                
                
                
                
