Clustering in Go

[Pages:42]5/26/2016

Clustering in Go

Clustering in Go

May 2016

Wilfried Schobeiri MediaMath



1/42

5/26/2016

Who am I?

Clustering in Go

Go enthusiast

These days, mostly codes for fun

Focused on Infrastruture & Platform @ MediaMath ()

We're hiring!



2/42

5/26/2016

Why Go?

Clustering in Go

Easy to build services

Great stdlib

Lot's of community libraries & utilities

Great built-in tooling (like go fmt, test, vet, -race, etc)

Compiles as fast as a scripting language

Just "feels" productive

(This is not a language pitch talk)



3/42

5/26/2016

Clustering in Go

Why "Clustering in Go"?



4/42

5/26/2016

Why "Clustering in Go"?

Clustering in Go

Clustering is not batteries included in Golang Lots of newer libraries, none very mature More often not, services roll it themselves

So, here's one way of building a clustered, stateful service in Go.



5/42

5/26/2016

Clustering in Go

And now, for a (fake-ish) scenario

Multiple datacenters

Separated by thousands of miles each (eg, ORD - HKG - AMS),

With many events happening concurrently at each one.

We want to count them.



6/42

5/26/2016

With some constraints:

Clustering in Go

Counting should be fast, we can't a ord to cross the ocean every time Counts should be correct (please don't lose my events)

Starting to look like an AP system, right?



7/42

5/26/2016

Let's get started

First, a basic counter service One node Counter = Atomic Int Nothin Fancy

$ curl 0 $ curl 1

Clustering in Go



8/42

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download