1 of 27

The Clojure brain behind

40 billion req/day

a story of deploying clojure into production

2 of 27

About

World's largest, 100% self-serve, mobile demand-side platform (DSP) for programmatic mobile.

Dapeng, backend tech lead

http://verydapeng.com

3 of 27

Exchange

yes! I will pay $0.01

ad needed

do you want?

4 of 27

problem

5 of 27

Customer

Campaign

Order

Region

Bidder

Campaign

Order

Region

Bidder

$

Buffer

$

Spending

6 of 27

λ (pyramid, spend, buffer, when) => [allocation]

7 of 27

Java

8 of 27

9 of 27

10 of 27

11 of 27

12 of 27

(def software (+ data functions))

13 of 27

Clojure to the rescue!

14 of 27

json mapping like a boss

15 of 27

data => λ => data

16 of 27

testing

17 of 27

transaction w/o db

18 of 27

logging

19 of 27

Deployment - upstart

description "start the brain!!!"

chdir "/opt/brain/"

start on runlevel [2345]

exec java -server -jar brain.jar >> logs/brain.log 2>&1

20 of 27

21 of 27

22 of 27

23 of 27

Challenge - Tools

Cursive, CCW, Emacs, Vim

24 of 27

Challenge - Developers

no more accumulators, no more loops

map, filter, reduce are your new friends

less HOW, more WHAT

think in data

25 of 27

Challenge - Bus factor

Keep it simple

26 of 27

))))))))))))

27 of 27

Q&A

We are hiring!