Skip to content

Instantly share code, notes, and snippets.

View Krasnyanskiy's full-sized avatar

Sasha Krasnyanskiy

  • Cupertino, California
View GitHub Profile
@Krasnyanskiy
Krasnyanskiy / crdt.md
Created December 7, 2015 14:52 — forked from stonegao/crdt.md

CvRDTs are as general as they can be

What are you talking about, and why should I care?

Now that we live in the Big Data, Web 3.14159 era, lots of people want to build databases that are too big to fit on a single machine. But there's a problem in the form of the CAP theorem, which states that if your network ever partitions (a machine goes down, or part of the network loses its connection to the rest) then you can keep consistency (all machines return the same answer to

@Krasnyanskiy
Krasnyanskiy / gist:fdbd6c28617e63eab674
Last active September 18, 2015 11:05 — forked from skroah/gist:9c22697521626c7b388b
Reactive Systems Design

##Reactive System Design Links

#Articles and Papers

class A
class A2 extends A
class B
trait M[X]
//
// Upper Type Bound
//
def upperTypeBound[AA <: A](x: AA): A = x
// Reduction: We can sum all the elements
// with the usual recursive schema
def sum(xs: List[Int]): Int = xs match {
case Nil => 0
case y :: ys => y + sum(ys)
}
// But this can be abstracted out using 'reduceLeft'
// That will perform these operations LINKING to the left
def sum(xs: List[Int]) = (0 :: xs) reduceLeft ((x, y) = x + y)
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns