i love apis 2015: implementing an api tier to enable a new mobile platform

33
IMPLEMENTING AN API TIER TO ENABLE A NEW MOBILE PLATFORM Thiago Catoto, Magazineluiza

Upload: apigee

Post on 08-Jan-2017

838 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

IMPLEMENTING AN API TIER TO ENABLE A NEW MOBILE PLATFORM

Thiago Catoto, Magazineluiza

Page 2: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Magazine Luiza 700+ STORES 8 FULFILMENT CENTERS 20k+ EMPLOYERS 43 MILLION CONSUMERS MULTI-CHANNEL STRATEGY

Page 3: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

The Legacy API

Monolithic

• ~ 150k lines of code

• ~ 1k classes

Page 4: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

The Legacy API

Slow deployments

• Deploy affects all API paths

• Hard to scale

Page 5: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

The Legacy API

Hard to make new features

• A lot of mixed responsibility

• Poor code coverage

Page 6: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Legacy Architecture

Based on two layers: •  Legacy Core API

•  Legacy Mobile API (dedicated)

Page 7: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

TEAM / API

MOBILE CORE

Page 8: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Legacy API

Page 9: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Legacy API

MOBILE-API

CORE-API

PUSH

Page 10: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Our Challenge

• New API on the way

• Needed a clean transition

• Native app development as mobile strategy evolution

Page 11: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Native App Development

Premises

• Frictionless

• Multichannel

• Personalization

Page 12: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Frictionless

• Buy with one touch

• Human Interface Guidelines

• Material Design

Page 13: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Multi channel

• Store Lookup

• Store's inventory

Page 14: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Personalization

Recommendations

• Abandoned cart

• Last user actions

• Trends

Page 15: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
Page 16: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Edge

Page 17: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Edge

Page 18: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Microservices

•  Separation of Concerns

•  Latency for the win

•  Benefits for all involved

Page 19: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Blue Print 6 SPRINTS 64 STORIES 208 POINTS 4 TEAM MEMBERS 1 APIGEE DEV CONSULTANT

Page 20: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Blue Print

Pros •  Able to make things on the right way

•  See the Legacy API as micro services

Page 21: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Blue Print

Cons •  Lack of knowledge

•  Want to do all with JS

Page 22: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Proxies

Stack

• Grunt

•  Use policy where you can

•  Integration test ( chai )

Page 23: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Proxies

• Grouped fully from path

•  Format update

•  Less request for the client

Page 24: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
Page 25: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform
Page 26: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Proxies

oAuth

• Unauthenticated

• Authenticated / Login

•  Integrated with Social Login

Page 27: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

• Easy to use

• Well documented

•  Plugins

Grunt

Page 28: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Grunt

Tasks

•  Validate code style

•  Validate swagger

•  Deploy on dev, test and prod

Page 29: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Test

•  Don't mock

•  CI with travis

•  Black box

Page 30: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Test

•  Behavior-Driven Development

•  Test-Driven Development

• More at 11:40 - 12:20 Wednesday End to End testing: Bug squashing got api developers

Page 31: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Transition

Migration per group of proxies

•  Basket

• Catalog

•  Customer

Page 32: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Conclusion

• API Management provided the flexibility to make the architectural transition to microservices

• When transitioning to microservices think about decoupling both the mobile and core APIs

Page 33: I Love APIs 2015: Implementing an API Tier to Enable a New Mobile Platform

Thank you

[email protected]