CipherCloud Microservice Meetup - Managing Services in a Lean Startup

44
February 2015 Managing Service Integration for High Uptime In a Lean Startup Shobana Radhakrishnan Vice President of Engineering, Mindflash

Transcript of CipherCloud Microservice Meetup - Managing Services in a Lean Startup

Page 1: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

February 2015

Managing Service Integration for High Uptime In a Lean Startup

Shobana RadhakrishnanVice President of Engineering, Mindflash

Page 2: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

2

Agenda

• Introduction• Managing External Service Integration• Mindflash API• Microservice Architecture at Mindflash

Page 3: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

3

Mindflash At a Glance

Mindflash App

Mindflash Customer API Services

Course Videos

Player

DeveloperManagerTrainer/

Prospect

Page 4: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

4

Some Numbers

• 1000+ Enterprise Customers• Thousands of trainees/program• 2 million courses completed• Increasing mobile adoption• Increasingly global programs

Page 5: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

5

Lean Startup**

**Eric Weis: http://theleanstartup.com/principles

Page 6: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

6

Lean Startup Principles at Mindflash

• Minimum Viable Product (MVP)

• Ship Frequently• Monitor Outcome• Iterate

Page 7: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

7

Questions

• How do you manage service deployment for high uptime and quality?

• How can you guarantee high uptime when relying on several external services?

• How can you do these in a lean startup?

Page 8: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

8

• Monthly releases• Somewhat automated• Multi-hour deployment, fall-out after releases• Test vs. Production not completely aligned

2013 and Prior

Page 9: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

9

• Ability to make multiple releases a day (Major features still monthly)

• Highly automated• Deployment in minutes, major fall-outs rare• Test vs. Production more completely aligned

Mid 2014 on

Page 10: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

10

• Continuous feature releases• Full deployment automation• Deployment in minutes, major fall-outs rare• Test vs. Production fully aligned

Next

Page 11: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

11

Microservice Architecture

Microservices is a software design pattern, in which complex applications are composed of small, independent services communicating with each other using highly decoupled language-agnostic APIs

Page 12: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

12

Architectural Difference

Monolithic App Microservice-based App

Presentation Layer (View)

Middleware/Business Logic Layer (Controller)

Database (Model)

Page 13: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

13

Monolithic vs. Microservices

Monolithic• N-tier Application• Code dependencies• Shared database• Larger units of deployment

Microservices• Independent services• Easier to manage and

deploy• Loose Coupling

Page 14: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

14

When to Consider Microservices?

• Team working on the application• Quick Ramp-up for new Team Members• Continuous Deployment• Take advantage of emerging technologies

Page 15: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

15

Three Angles For Microservice Architectures

Page 16: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

16

Integration with SAAS/PAAS Services

Page 17: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

17

Exposing API

Page 18: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

18

Internal Microservices

Page 19: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

19

Mindflash External Service Integration

Page 20: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

20

Trends

• Growth of SaaS/PaaS Services• Evolution of Hub and Data

Analysis Solutions• Public API and Open Source

Page 21: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

21

Architectural View

Page 22: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

22

Services we Integrate With

Page 23: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

23

Integration

• Building and Maintaining Component• API Migration and Upgrades• Security and Bug Patches

Page 24: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

24

API Call FlowAPI

Customer 1API

Customer 2API

Customer 3API

Customer 4API

Customer 5

Services Layer

API Gateway

Page 25: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

25

API Considerations

• Heterogeneous Needs• User release cycles vary• Backwards compatibility• Objects evolve continuously

Page 26: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

26

Approach and Lessons Learned

Page 27: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

27

Automate – BrowserStack, Jenkins, Selenium

Page 28: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

28

Fail Fast and Recover Quickly – Pingdom, Crittercism, AWS Monitoring and Alerting

Page 29: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

29

Measure and Iterate – Optimizely, Gainsight, Pingdom, Google Analytics, KISSMetrics,

Internal reporting

Page 30: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

30

Upgrade Continuously

Page 31: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

31

Deploy Small and Continuously

Build

Deploy to QA

Check in

Run Tests

Deploy to PROD

Rule-based subset that needs to be rebuilt/deployed

Page 32: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

32

Implementation Best Practices

• Loose Coupling• Chain-of-responsibility pattern• Single Responsibility Principle• Defensive Programming• Clear separation of real-time

vs. asynchronous• Feature Flags

Page 33: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

33

Real-time Vs. Asynchronous

MF

Trainers and Prospects

Trainees

Hydra

Billing

RDS

Analytics

File Conversion

Feature Integration

Developers

MF API

Gateway

Page 34: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

34

Feature Flags – our implementation

• Feature Flags persisted in DB• Set per account and pricing tier• Common Uses

– Manage rollout for risky changes– Adjust feature offering based on pricing tier– Enable limited testing of a feature

Page 35: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

35

Be Aware of Cultural Factors

Page 36: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

36

Results

• Releases without fallout• Shorter deployment cycles• Much lower error rates• Consistently high uptime• Consistently low response

time

Page 37: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

37

Internal Microservices

Page 38: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

38

Our Initial Implementation

Emails

All Applications – TraineeWeb, TrainerWeb, Player etc.

Video Conversion Jobs

Async updates with Third Party Systems

Page 39: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

39

Characteristics

• High Performance and Uptime• Easy Error Tracking• Highly Scalable System• Achieved Decoupling (sort of)• Achieved independent deployment (again,

sort of)• Independent code base (not really)• Decoupled deployment (not really)

Page 40: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

40

New Approach

• Independent Verticals ie. Services• Hapi framework• Common Services across Verticals• Incremental code migration• Integrate tools such as Docker, Stackato,

Ansible, Kubernetes• More to come!

Page 41: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

41

Coming Up

• Fully decoupled microservice implementation

• Integrate automated container management

• Fully automated backward compatibility testing

Page 42: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

42

References

• Product Blog – http://www.mindflash.com/blog

• Developer Blog – http://www.mindflash.com/developers

Page 43: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

43

Thank you!

• https://www.linkedin.com/in/shobanaradhakrishnan

• Twitter: #shobanarad, #mindflash

• We’re hiring!

Page 44: CipherCloud Microservice Meetup - Managing Services in a Lean Startup

Questions?