Slide 1

Slide 1 text

Migrating real-time data replication service from PHP to Golang @Maicon @eric_khun

Slide 2

Slide 2 text

Buffer

Slide 3

Slide 3 text

Buffer • 80 awesome people , 12 timezones, all remote • USD ~20 millions Annual Recurrent Revenue • 75,000+ paying customers ~7 millions users

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Quick intro Infrastructure engineer buffer.com @eric_khun

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Infrastructure metrics • 1 Kubernetes cluster | ~60 ec2 instances • ~800,000 “posts” sent per day to social medias • 1000 “external” requests per second • 1400 AWS SQS queue messages to process per second

Slide 9

Slide 9 text

Search - auto completion

Slide 10

Slide 10 text

Identifying 3rd party API errors (FB/Instagram/Twitter/Linkedin…)

Slide 11

Slide 11 text

A system to search users / profile / updates • MongoDB isn’t great for search / auto completion • Elasticsearch is better for that • We use SQS to say we need a message to copy data from mongoDB to Elasticsearch

Slide 12

Slide 12 text

Data pipeline Flow

Slide 13

Slide 13 text

Migrating real-time data replication worker From PHP to Golang WHY ?

Slide 14

Slide 14 text

Number of SQS message to process

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Number of pods And resources used

Slide 17

Slide 17 text

Reasons to migrate • Too frequent paging alerts (using engineering time) • Using 37 CPU cores (8 servers! ), and growing • PHP libraries memory leaks (not PHP!) • Unstable resource usage , pods restarts (OOMKill) • Only used for customer support or troubleshooting - cost not justified

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Benefits * No Price: Happier engineers, no more context switching

Slide 22

Slide 22 text

Questions? @eric_khun (golang) (hugo) (python) ✈