i love apis 2015: implementing an api tier to enable a new mobile platform
TRANSCRIPT
IMPLEMENTING AN API TIER TO ENABLE A NEW MOBILE PLATFORM
Thiago Catoto, Magazineluiza
Magazine Luiza 700+ STORES 8 FULFILMENT CENTERS 20k+ EMPLOYERS 43 MILLION CONSUMERS MULTI-CHANNEL STRATEGY
The Legacy API
Monolithic
• ~ 150k lines of code
• ~ 1k classes
The Legacy API
Slow deployments
• Deploy affects all API paths
• Hard to scale
The Legacy API
Hard to make new features
• A lot of mixed responsibility
• Poor code coverage
Legacy Architecture
Based on two layers: • Legacy Core API
• Legacy Mobile API (dedicated)
TEAM / API
MOBILE CORE
Legacy API
Legacy API
MOBILE-API
CORE-API
PUSH
Our Challenge
• New API on the way
• Needed a clean transition
• Native app development as mobile strategy evolution
Native App Development
Premises
• Frictionless
• Multichannel
• Personalization
Frictionless
• Buy with one touch
• Human Interface Guidelines
• Material Design
Multi channel
• Store Lookup
• Store's inventory
Personalization
Recommendations
• Abandoned cart
• Last user actions
• Trends
Edge
Edge
Microservices
• Separation of Concerns
• Latency for the win
• Benefits for all involved
Blue Print 6 SPRINTS 64 STORIES 208 POINTS 4 TEAM MEMBERS 1 APIGEE DEV CONSULTANT
Blue Print
Pros • Able to make things on the right way
• See the Legacy API as micro services
Blue Print
Cons • Lack of knowledge
• Want to do all with JS
Proxies
Stack
• Grunt
• Use policy where you can
• Integration test ( chai )
Proxies
• Grouped fully from path
• Format update
• Less request for the client
Proxies
oAuth
• Unauthenticated
• Authenticated / Login
• Integrated with Social Login
• Easy to use
• Well documented
• Plugins
Grunt
Grunt
Tasks
• Validate code style
• Validate swagger
• Deploy on dev, test and prod
Test
• Don't mock
• CI with travis
• Black box
Test
• Behavior-Driven Development
• Test-Driven Development
• More at 11:40 - 12:20 Wednesday End to End testing: Bug squashing got api developers
Transition
Migration per group of proxies
• Basket
• Catalog
• Customer
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
Thank you