My Understanding of the CAP Theorem

With the technical landscape being distributed, you will have heard of the CAP Theorem, as it related to the systems that you work on to be 99.99999% up. These are my $0.02 on my understanding of the CAP Theorem.

* Consistency – read/write guarantee between nodes
* Availability – nodes respond and do no error out
* Partition Tolerance – system still functions when network goes berserk

Let’s face it: networks are unreliable. Period. So, the theorem states that you can only really guarantee 2 out of the 3 above, specifically:

CP – consistency and partition tolerance
AP – availability and partition tolerance

The difference is which one to to choose, and it all depends on your business requirements.

* CP when requirements dictate atomic read and writes
* AP when data consistency is flexible around data synchronization

How-to: Git Rebase

Adding here for my own purposes, but may be helpful to others. This rebases to master (or whatever branch) and then squashes all your commits into one commit! Sexy. πŸ™‚

> git fetch --all
> git checkout [master]
> git pull
> git checkout [working branch name]
> git merge-base HEAD [master] 
> git reset --soft [hash] e.g.: 43e87200b8375fc5eba022ced353ab2917f2a746
> git status
> git commit -a -m "NOTES"
> git rebase [master]

Note: Only needed if conflicts between branch commit and master
> git add .
> git status
> git rebase --continue

> git diff origin/[working branch name]
> git push -f origin [working branch name]