25
Continuous Delivery In Practice Lessons from Kenshoo’s RTB project

Continuous delivery in practice (public)

Embed Size (px)

DESCRIPTION

10 practical field-proven tips for building a continuously delivered service, based on Kenshoo's experience with its RTB service - a critical, high throughput, highly available component, serving millions of requests per minute in under 50 milliseconds. From coding practices to test automation, from monitoring tools to feature A/B testing - the entire development chain should be focused around removing blockers and manual steps between your code and your clients, without ever settling for quality. Join to see what makes our clients and developers happy and effective.

Citation preview

Page 1: Continuous delivery in practice (public)

Continuous Delivery In Practice

Lessons from Kenshoo’s RTB project

Page 2: Continuous delivery in practice (public)

Who, What, Where

Tzach Zohar:● System Architect● [email protected]

Kenshoo: ● Founded 2006● Online Marketing Technology● ~450 employees● 12 World Wide locations

Page 3: Continuous delivery in practice (public)

Continuous Delivery: Why bother?

Faster development, delivery and feedback makes our clients and us happier.

The “us” alone is worth it.

Page 4: Continuous delivery in practice (public)

Continuous Delivery: Why bother?

Better suited productResponsiveness

Less wasteHigher quality

Page 5: Continuous delivery in practice (public)

Background: RTB Project

● ~1.5 years ● ~4 developers● ~Dozens of paying clients● ~50 servers (AWS)● ~1.5M requests per minute● ~7ms average response time● ~99.9% availability● ~5-10 deployments / week

Page 6: Continuous delivery in practice (public)

How?

Page 7: Continuous delivery in practice (public)

1.The Obvious

● Single branch● Full, Fast, Reliable coverage● Full deployment automation● Fast feedback● ABCD - Always Be Continuously

Deploying

Page 8: Continuous delivery in practice (public)

● Unit: complete functional coverage● Integration: with external systems - thin!● Behavioral: we use Cucumber● Staging: verify actual server upgrade

2. Four-Layer Test Suite

Page 9: Continuous delivery in practice (public)

2. Four-Layer Test Suite

Page 10: Continuous delivery in practice (public)

Staging: verify compatibility of new build with other components’ production builds

2. Four-Layer Test Suite

Page 11: Continuous delivery in practice (public)

3. Keep Builds Stable

Do not overlook a test that “sometimes fails”, trusting build status is crucial

Page 12: Continuous delivery in practice (public)

3. Keep Builds Stable

Be Suspicious of:● Random data tests● Asynchronous tests● Integration tests

Page 13: Continuous delivery in practice (public)

4. Master Is Always

Shippable

On every commit? Not Quite:Use GitHub Pull Requests

“Merge” == Build and Deploy

credit: [email protected]

Page 14: Continuous delivery in practice (public)

5. Rigorous Code Reviews

● Remember “merge” means “deploy”!● Insist on proper coverage● Insist on code cleanliness● Insist on consistent design● Insist!

Page 15: Continuous delivery in practice (public)

5. Rigorous Code Reviews

https://github.com/tzachz/github-comment-counter

Page 16: Continuous delivery in practice (public)

6. Real-Time Feedback

Detect issues immediately and visually

Page 17: Continuous delivery in practice (public)

7. Keep Upgrade in Mind (1)

Use the “Parallel Change” pattern when changing cross-node APIs / Data

1.Write: oldRead: both

2.Write: new Read: both

3.Write: new Read: new

deploy deploy

Page 18: Continuous delivery in practice (public)

8. Keep Upgrade in Mind (2)

Verify backward compatibility in tests

Page 19: Continuous delivery in practice (public)

9. A/B Testing

Apply new features to a limited user-group Measure business results per-group

(Not by branching)

Page 20: Continuous delivery in practice (public)

10. Own It

Constantly check buildsConstantly collect feedbackConstantly check monitorsAnswer the phone at 3am

Page 21: Continuous delivery in practice (public)

10. Own It

Page 22: Continuous delivery in practice (public)

That’s It.

Page 24: Continuous delivery in practice (public)

Appendix B. Are You Ready?

Unit Coverage > 90%?

Good Staging Tests?

Informative Monitors?

Builds Are Kept Green?

No API Breaking Changes?

Rigorous Code Reviews?

Support Has Your Phone Number?

Do You Own it?

Not Ready

No Yes

credit: [email protected]

Page 25: Continuous delivery in practice (public)

Thanks. Questions?