QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

37
November 2014 Managing Service Integration for High Uptime In a Lean Startup Shobana Radhakrishnan Vice President of Engineering, Mindflash

Transcript of QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

Page 1: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

November 2014

Managing Service Integration for High Uptime In a Lean Startup

Shobana RadhakrishnanVice President of Engineering, Mindflash

Page 2: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

2

Agenda

• Services at Scale• Mindflash Customer API• Mindflash Integration with External Services• Approach and Lessons Learned

Page 3: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

3

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 4: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

4

Mindflash At a Glance

Mindflash App

Mindflash Customer API Services

Course Videos

Player

DeveloperManagerTrainer/

Prospect

Page 5: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

5

Lean Startup**

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

Page 6: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

6

Lean Startup Principles at Mindflash

• Minimum Viable Product (MVP)

• Ship Frequently• Monitor Outcome• Iterate

Page 7: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

7

Typical Constraints

• Budget• Resources• High Release

Frequency

Page 8: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

8

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 9: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

9

Our Journey

• Started with a monolithic service – FLEX, .NET• Independent service and middle layers• Shared database with read rep• 20+ external services -> microservices

architecture

Page 10: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

10

Our Goals

• Uptime and Response Time• High website performance• Low error rates

Page 11: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

11

Key Metrics for Mindflash

• Course Creation Rate• Course Completion Rate• Uptime and Response Time

Page 12: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

12

Mindflash API

Page 13: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

13

Why

• Bulk Operations with UX flexibility• Varied needs for same functionality• Users more self-sufficient

Page 14: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

14

API Functionality

• REST Services• User and User Group

Management• User Enrollment • Reporting

Page 15: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

15

API Call FlowAPI

Customer 1API

Customer 2API

Customer 3API

Customer 4API

Customer 5

Services Layer

API Gateway

Page 16: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

16

API Considerations

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

Page 17: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

17

Mindflash External Service Integration

Page 18: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

18

Trends

• Growth of PaaS Services• Evolution of Hub and Data

Analysis Solutions• Public API and Open Source

Page 19: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

19

Services we Integrate With

Page 20: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

20

Integration

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

Page 21: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

21

Approach and Lessons Learned

Page 22: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

22

Mindflash Development Philosophy

• Reuse, don’t reinvent• Action and Iteration• Upgrade continuously

Page 23: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

23

System Design Best Practices

• Loose Coupling• Chain-of-responsibility pattern• Single Responsibility Principle

Page 24: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

24

Programming Best Practices

• Defensive Programming• Critical vs. non-critical

operations• Real-time vs. Asynchronous• Feature Flags

Page 25: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

25

Real-time Vs. Asynchronous

MF

Trainers and Prospects

Trainees

Hydra

Billing

RDS

Analytics

File Conversion

Feature Integration

Developers

MF API

Gateway

Page 26: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

26

Critical vs. Non-Critical

MF

Trainers and Prospects

Trainees

Hydra

Billing

RDS

Analytics

File Conversion

Feature Integration

Developers

MF API

Gateway

Page 27: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

27

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 28: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

28

Feature Flipping in Node/* Defining a Feature */

var flipper = require(‘flipper’);flipper.add (‘newPlayer’);

/* Testing for a Feature */Var flipper = require(‘flipper’);If (flipper.newPlayer) {}Else {}

/* Another Way */Flipper.isEnabled(‘newPlayer’);

Page 29: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

29

Enabling and Disabling

/* Enable */flipper.enable(‘newPlayer’);

/*Disable */Flipper.disable(‘newPlayer’);

/* Finding out all current features */flipper.allFeatures();

Page 30: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

30

Continuous Deployment

Build

Deploy to QA

Check in

Run Tests

Deploy to PROD

Rule-based subset that needs to be rebuilt/deployed

Page 31: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

31

Process Best Practices

• Agile, Continuous Deployment

• Early customer beta• Automate, automate more• Monitor, monitor more

Page 32: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

32

Results

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

Page 33: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

33

Lessons Learned

• Chain-of-responsibility pattern effective

• Design for easy migration• Comprehensive monitoring• Failure Detection and Recovery• Environment Convergence

Page 34: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

34

Future Improvements

• Staging Environment• Blue Green Deployment• Nightly Performance

Testing

Page 37: QConSF 2014 Managing Services in a Lean Startup - Shobana Radhakrishnan

Questions?