344
Boxcar A self-balancing distributed services protocol

[@IndeedEng] Boxcar: A self-balancing distributed services protocol

Embed Size (px)

DESCRIPTION

Video available at: http://www.youtube.com/watch?v=E1ok08TVxDw Indeed's flagship job search product has evolved over the years to meet new challenges. It began as a single, monolithic web application. This grew larger and increasingly complex as we built new features. To remedy this growing problem, we implemented a service-oriented architecture to improve system availability, scalability, and maintainability. We examined common practices for service-oriented architectures, and we discovered ways to improve on the state of the art. We developed these ideas into a new framework called Boxcar. In this talk, we will discuss the scaling problems we solved, the innovative ideas behind boxcar, and how we built the scalable architecture that we now use throughout our systems. R.B. Boyer is a Software Engineer who has been with Indeed since late 2007. Over the years he has worked on a variety of projects, including distributed storage, authentication, and service architectures.

Citation preview

Page 1: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

BoxcarA self-balancing distributed services protocol

Page 2: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

R.B. BoyerSoftware Engineer

Resume

Page 3: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

I help people get jobs.

Page 4: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

I solveinteresting problems.

Page 5: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar was the solutionto a problem:

Page 6: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Building

Page 7: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

How we build products

Simple

Fast

Comprehensive

Relevant

Page 8: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

How we build products

Simple

Fast

Comprehensive

Relevant

Page 9: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

How we build systems

Simple

Fast

Resilient

Scalable

Page 10: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

“I want my application to be more complicated”

- No one ever

Simple

Page 11: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Complexity creates confusion

Page 12: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Complexity creates confusion

Confusion breeds bugs

Page 13: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

“I want my application to be slower”

- No one ever

Fast

Page 14: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

conducted a speed test

Page 15: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

+500 milliseconds of latency per search

Page 16: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

20% fewer searches

Page 17: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Speed is a feature

Page 18: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

“I want my users to experience outages”

- No one ever

Resilient

Page 19: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Programs crash

Page 20: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Programs crash

Machines die

Page 21: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Minimize vulnerability toany failure

Page 22: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

“My system will only need to support 10 users”

- No one ever

Scalable

Page 23: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Scale with MORE machines

Page 24: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Scale with MORE machines

Not BIGGER machines

Page 25: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

TL;DR:

Page 26: [@IndeedEng] Boxcar: A self-balancing distributed services protocol
Page 27: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Jobs Sites Job

Seekers

Indeed

Page 28: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Aggregation Job Search

Jobs Sites Job

Seekers

Page 29: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Aggregation

Job Search

Page 30: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Aggregation

Job Search

Challenge!

Page 31: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Challenge: SimpleFastResilientScalable

keep this

Page 32: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Options:

Page 33: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Share data access?

Page 34: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Example:Shared Database

Page 35: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Shared Database

Page 36: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Shared Database

Page 37: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

Shared Database

Page 38: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

Shared Database

BillingApplication

Page 39: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

BillingApplication

Intern Project

Shared Database

Page 40: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

BillingApplication

Intern Project

Other Intern Project

Shared Database

Page 41: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

BillingApplication

Intern Project

Other Intern Project

Email Tool

Shared Database

Page 42: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

BillingApplication

Intern Project

Other Intern Project

Email Tool

Shared Database

This is an anti-pattern

Page 43: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

On a long enough timeline...

Page 44: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Maintenance Nightmare

Page 45: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Share data access

Page 46: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Share data accessInsulate data from

consumers

Page 47: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Database

Main Application

Analysis Tool

BillingApplication

Intern Project

Other Intern Project

Email Tool

Shared Database

Page 48: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Main Application

Analysis Tool

BillingApplication

Intern Project

Other Intern Project

Email Tool

Insulated Database

Main Database

Main Service

Page 49: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Service?

Page 50: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Service

ClientClientClientClient

Page 51: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Service

NET

WO

RK

ClientClientClientClient

Page 52: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Service

NET

WO

RK Icky

TechnicalStuff

ClientClientClientClient

Page 53: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Service

Caches

Databases

Logging

Business Logic

...

Icky TechnicalDetails

Client API

ClientClientClientClient

NET

WO

RK

Page 54: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client API

Service.getJobs([12345, 62])

Page 55: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Icky Technical Details

SELECT * FROM jobs AS jLEFT JOIN companyinfo AS ci ON j.id=ci.job_idLEFT JOIN locations AS loc ON loc.id=j.location_idWHERE j.id IN (12345, 62)

Page 56: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Service Oriented

Architecture

Page 57: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

ServiceOriented

Architecture

Page 58: [@IndeedEng] Boxcar: A self-balancing distributed services protocol
Page 59: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar

Page 60: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar is a...self-balancing

distributed

services

protocol

Page 61: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Origin Story

Page 62: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

There was a life before Boxcar

Page 63: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

There were services before Boxcar

Page 64: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Pick one:

Page 65: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Doc Service

Page 66: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Document Serving Serviceaka “Doc Service”

http://go.indeed.com/docservice

Page 67: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Doc Service controlsaccess to JOBS

Page 68: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Building Blocks

Webapp

DocService

Docstore

Wants jobs

Controls access to jobs

Stores jobs

Page 69: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Build it

Page 70: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Page 71: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Page 72: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Page 73: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Mission Accomplished

Page 74: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

But is it good?

Page 75: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

How we build systems

Simple

Fast

Resilient

Scalable

Page 76: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Goodness Metric

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Page 77: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Page 78: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Page 79: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Resilient✘

Page 80: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Add Resilience

Page 81: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Page 82: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Page 83: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Front-end Load Balancer

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Page 84: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Siloed Stacks

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Front-end Load Balancer

Page 85: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Siloed Stacks

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

?✓

Page 86: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Scaling Silos

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Front-end Load Balancer

Page 87: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Scaling Silos

Webapp Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Front-end Load Balancer

Page 88: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Scaling Silos

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Front-end Load Balancer

Page 89: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Need bigger and

bigger machines

Page 90: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Vertical Scaling

Page 91: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Siloed Stacks

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable✘

Page 92: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Siloed Stacks

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable✘

✓ Services Version 1

Page 93: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Improve scalability

Page 94: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Webapp

Doc Service

Docstore

Front-end Load Balancer

Page 95: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Doc Service Load Balancer

Page 96: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Per-Service Balancer

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Doc Service Load Balancer

Page 97: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Per-Service Balancer

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

~

??

Page 98: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

2x Bandwidth✘

Webapp

Doc Service

Doc Service Load Balancer

Proxying isn’t free

Page 99: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Per-Service Balancer

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

~

?✘

Page 100: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Resilience

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

SINGLE POINT OF FAILURE

Page 101: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Need two balancers

Page 102: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Need two balancers

...and a way to balance between them?

Page 103: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Load Balancer Balancing

Master / Slave

Share IP address

Heartbeat between nodes

Complex

Page 104: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Resilience

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Doc Service Load BalancerDoc Service Load Balancer

Page 105: [@IndeedEng] Boxcar: A self-balancing distributed services protocol
Page 106: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Best explained by our Operations folks:

“Redundant Array of Inexpensive Datacenters”

http://go.indeed.com/raid

Page 107: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Per-Service Balancer

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

~

Page 108: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Per-Service Balancer

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

~

✓ Services Version 2

Page 109: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Reduce network waste

Page 110: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Doc Service Load Balancer

Page 111: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Page 112: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Page 113: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

??

Page 114: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Direct Connections

1x Bandwidth✓

Webapp

Doc Service

Page 115: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

?

Page 116: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

Page 117: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

Page 118: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

REQUEST

Page 119: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

REQUEST✘

Page 120: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

REQUEST✘

Page 121: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

REQUEST

Page 122: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A Server B

REQUEST

Page 123: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable✓

Page 124: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable✓

Page 125: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

?

Page 126: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 127: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 128: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 129: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 130: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 131: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 132: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 133: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 134: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 135: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 136: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 137: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Can’t keep up

Slow Fast

Page 138: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

Page 139: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

NOPE

Page 140: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Ensure balance

Page 141: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Doc Service Load Balancer

Page 142: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

Distribute!

Page 143: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Webapp WebappWebapp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

B BB

Page 144: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

WebApp

WebApp

WebApp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

B B B

Page 145: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

WebApp

WebApp

WebApp

Doc Service

Docstore

Doc Service

Docstore

Front-end Load Balancer

B B B

Boxcar

Page 146: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Naive Round Robin

Per-Service Balancer

Page 147: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

The Boxcar balancing algorithm is simple

Page 148: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Servers assign numeric value to connections

Clients use the connection with the lowest numeric value to service each request

Gist

Page 149: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A

Page 150: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server A

Server A

Page 151: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server ASlot 0

Slot 1

Slot 2

Slot 3

Slot 4...

Page 152: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Just numbers

No limit

NOT a priority

ONLY used for balancing

Server ASlot 0

Slot 1

Slot 2

Slot 3

Slot 4

...

Slot Numbers

Page 153: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

LOW slot numbers

are the

BEST slot numbers

Page 154: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server ASlot 0 USEDSlot 1 USEDSlot 2

Slot 3

Slot 4 USED

...

Client 2

Hello!

Page 155: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Server ASlot 0 USEDSlot 1 USEDSlot 2 USEDSlot 3

Slot 4 USED

...

Client 2Slot 2

Page 156: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2

Page 157: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2

Page 158: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2

Page 159: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 12

Slot 29

Slot 30

Slot 57

Server

A

Server

B

Page 160: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 12

Slot 29

Slot 30

Slot 57

Server

A

Server

B

long-lived connections

Page 161: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Clients are greedy

205

MINE!

Page 162: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Clients are greedy

205MINE!

Want best connections

Continually look for better connections

Close worst connections

Page 163: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Background thread maintains the

connection pool

Page 164: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 12

Slot 29

Slot 30

Slot 57

Server

A

Server

B

Page 165: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 12

Slot 29

Slot 30

Slot 57

Server

A

Server

B

Slot17

Page 166: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 12

Slot 29

Slot 30

Server

A

Server

B

Slot17

Slot 57✘

Page 167: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 12

Slot 29

Slot 30

Server

A

Server

B

Slot17

Page 168: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 29

Slot 30

Server

A

Server

B

Slot17

Slot 12

Page 169: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 17

Slot 29

Slot 30

Server

A

Server

BSlot 12

Page 170: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0

Slot 2

Slot 17

Slot 29

Slot 30

Server

A

Server

BSlot 12

Continues forever

Page 171: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0 ACTIVESlot 2 ACTIVESlot 12 [idle]

Slot 29 ACTIVESlot 30 [idle]

Slot 57 [idle]

GetJobs()

Incoming Requests

Page 172: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0 ACTIVESlot 2 ACTIVESlot 12 ACTIVESlot 29 ACTIVESlot 30 [idle]

Slot 57 [idle]

GetJobs()

Incoming Requests

Page 173: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Connections NOTestablished on-demand

Page 174: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0 ACTIVESlot 2 ACTIVESlot 12 ACTIVESlot 29 ACTIVESlot 30 ACTIVESlot 57 ACTIVE

GetJobs()

Requests to Busy Pool

Page 175: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client 2Slot 0 ACTIVESlot 2 ACTIVESlot 12 ACTIVESlot 29 ACTIVESlot 30 ACTIVESlot 57 ACTIVE

GetJobs()✘ERROR!

Requests to Busy Pool

Page 176: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Sizing the pool properly is imperative!

Page 177: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Servers assign numeric value to connections

Clients use the connection with the lowest numeric value to service each request

Gist Redux

Page 178: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Balanced load is emergent behavior

Page 179: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Load Balancing Simulations

Page 180: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client XServer A

Server B

Page 181: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

0Client XServer A

slot 0

Server B

Page 182: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client X0

Server Aslot 0

Server B

Page 183: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client X0

0

Server Aslot 0

Server Bslot 0

Page 184: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client X00

Server Aslot 0

Server Bslot 0

Page 185: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

1

Client X00

1

Server Aslot 0slot 1

Server B

slot 1slot 0

Page 186: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Steady-state balance

Client X00

Server Aslot 0

Server Bslot 0

Page 187: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client X00

Server Aslot 0

Server Bslot 0

New Clients Join

Page 188: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y

Client X00

Server Aslot 0

Server Bslot 0

Page 189: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y

Client X00

1

1

Server Aslot 0slot 1

Server B

slot 1slot 0

Page 190: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client X00

Server Aslot 0slot 1

Server B

slot 1slot 0

Page 191: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client X00

2

2

Server Aslot 0slot 1slot 2

Server B

slot 1slot 2

slot 0

Page 192: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client X00

Server Aslot 0slot 1

Server B

slot 1slot 0

Page 193: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z

Client X00

Server Aslot 0slot 1

Server B

slot 1slot 0

Page 194: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z

Client X00

2

2

Server Aslot 0slot 1slot 2

Server B

slot 1slot 2

slot 0

Page 195: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z22

Client X00

Server Aslot 0slot 1slot 2

Server B

slot 1slot 2

slot 0

Page 196: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z22

Client X00

3

3

Server Aslot 0slot 1slot 2

Server B

slot 1slot 2slot 3

slot 3

slot 0

Page 197: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z22

Client X00

Steady-state balance

Server Aslot 0slot 1slot 2

Server B

slot 1slot 2

slot 0

Page 198: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z22

Client X00

Server Aslot 0slot 1slot 2

Server B

slot 1slot 2

slot 0

Server Failure

Page 199: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z2

Client X0

Server Aslot 0slot 1slot 2

Server Bslot 0

Page 200: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z2

Client X0

Server Aslot 0slot 1slot 2

Server B

Page 201: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z2

Client X0

Server Aslot 0slot 1slot 2slot 3

3

Server B

Page 202: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z23

Client X0

Server Aslot 0slot 1slot 2slot 3

Server B

Page 203: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z23

Client X0

Server Aslot 0slot 1slot 2slot 3

4

slot 4

Server B

Page 204: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4

Server B

Page 205: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3

5

slot 4slot 5

Server B

Page 206: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server B

Page 207: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Steady-state balance

Server B

Page 208: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Steady-state balance

Server B

Page 209: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server B

Server Restored

Page 210: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server B

Page 211: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z23

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server Bslot 0

0

Page 212: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z2

0 < 3

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server Bslot 0

Page 213: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z20

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server Bslot 0

Page 214: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z20

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server Bslot 0

Page 215: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z02

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server Bslot 0

Page 216: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y15

Client Z02

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server B

slot 1slot 0

1

Page 217: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y1

1 < 5

Client Z02

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4slot 5

Server B

slot 1slot 0

Page 218: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X04

Server Aslot 0slot 1slot 2slot 3slot 4

Server B

slot 1slot 0

Page 219: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X04

Server B

slot 1slot 2

slot 0

2

Server Aslot 0slot 1slot 2slot 3slot 4

Page 220: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X0

2 < 4

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2slot 3slot 4

Page 221: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X02

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 222: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X02

Steady-state balance

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 223: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X02

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Client Shutdown

Page 224: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Y11

Client Z02

Client X02

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 225: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z02

Client X02

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 226: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z02

Client X02

1

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 227: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z0

1 < 2

Client X02

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 228: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X02

Server B

slot 1slot 2

slot 0

Server Aslot 0

Page 229: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X021

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1

Page 230: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X0

1 < 2

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1

Page 231: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 232: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Steady-state balance

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 233: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Server B

slot 1slot 0

Server Aslot 0slot 1

Client Rejoins

Page 234: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Client Y

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 235: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Client Y2

2

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 236: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Client Y22

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Page 237: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Server B

slot 1slot 2

slot 0

Server Aslot 0slot 1slot 2

Client Y22

Steady-state balance

Page 238: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Why does this Balance?

Page 239: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Connections are like running water

seeking lower ground

Page 240: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 241: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 242: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 243: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 244: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 245: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 246: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 247: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 248: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 249: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 250: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 251: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 252: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Roughly Equal Distribution

Connections

Page 253: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Edge cases

Page 254: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z01

Client X01

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 255: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Balancedbut not ideal

Client Z01

Client X01

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 256: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z

Client X01

Server Aslot 0slot 1

Server Bslot 0

Page 257: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z

Client X01

Server Aslot 0slot 1

Server Bslot 0 EMPTY

POOL!

Page 258: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z

Client X01

Server Aslot 0slot 1

Server Bslot 0 EMPTY

POOL!

Resilient✘

Page 259: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Fix by adding entropy

Page 260: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Fix by adding entropy

aka “Table Shaking”

Page 261: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Servers regularly hang up on connections

Table Shaking

Page 262: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Servers regularly hang up on connections

Clients expect failed connections

Table Shaking

Page 263: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Servers regularly hang up on connections

Clients expect failed connections

Failures are retried on new connections

Table Shaking

Page 264: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Servers regularly hang up on connections

Clients expect failed connections

Failures are retried on new connections

Bad configurations are less likely

Table Shaking

Page 265: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Table Shakingturns this

Client Z01

Client X01

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 266: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Into this

Client Z01

Client X01

Server B

slot 1slot 0

Server Aslot 0slot 1

Page 267: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z

1

Client X0

Server Aslot 0slot 1

Server Bslot 0

Page 268: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Client Z

1

Client X0

Server Aslot 0slot 1

Server Bslot 0

YAY!

YAY!

Page 269: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Balancing Tricks:

Handicapping

Page 270: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Handicapping isServer Self-quarantine

Page 271: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Handicapping

Exploit slot number assignment

Page 272: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Handicapping

Exploit slot number assignment

Unhealthy servers inflate slot numbers

Page 273: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Handicapping

Exploit slot number assignment

Unhealthy servers inflate slot numbers

Clients naturally avoid these servers

Page 274: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 275: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Unhealthy

Page 276: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 277: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 278: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 279: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Unhealthy

Page 280: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 281: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

Page 282: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slots

Servers

Connections

graceful degradation

Page 283: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Is Boxcar good?

Page 284: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

?

?

Page 285: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Clients are pessimistic

Page 286: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Clients are pessimistic

Failure is expected

Page 287: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

?

Page 288: [@IndeedEng] Boxcar: A self-balancing distributed services protocol
Page 289: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Balance ConnectionsNot Requests

Page 290: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Balancing Review:

Naive Round Robin

Page 291: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 292: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 293: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 294: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 295: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 296: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 297: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 298: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 299: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 300: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 301: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow Fast

Page 302: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Can’t keep up

Slow Fast

Page 303: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

The problem was thatrequests (connections)

piled up

Page 304: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar has a fixed number of connections

Page 305: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar has a fixed number of connections

there’s nothing to pile up

Page 306: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Page 307: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Client

Slot 9Slot 7

7 9

Page 308: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 309: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 310: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 311: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

0 1

Slot 9Slot 7

Client

7 9

Page 312: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 313: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 314: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 315: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 316: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 317: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 318: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 319: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 320: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 321: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 322: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 323: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 324: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 325: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 326: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 327: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 328: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 329: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

Page 330: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

SlowServer

FastServer

Slot 9Slot 7

Client

7 9

2 requests 4 requests

Page 331: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Slow servers handle fewer requests

Page 332: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

No overloaded servers

Page 333: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

All requests are serviced

Page 334: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Load balancing is probabilistic

Page 335: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

Page 336: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Boxcar

Simple deploys

Efficient networking (Fast)

Resilient

Horizontally scalable

Balanced

Page 337: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Good enough for Indeed

Page 338: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Services well over a

BILLION requestsevery day

Page 339: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Fundamental technology

Page 340: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Powering over 20 different services

Page 341: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

In production since 2009

Page 342: [@IndeedEng] Boxcar: A self-balancing distributed services protocol
Page 343: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

ServiceOriented

Architecture

Page 344: [@IndeedEng] Boxcar: A self-balancing distributed services protocol

Q & A