+
Make it remarkable.
24.11.2022
Evolution of the first
public API in the
hospitality industry
Peter Vitéz
Make
it
remarkable.
+
Agenda
﹢What is Mews?
﹢Why public API?
﹢Design API
﹢EncounteredProblems
﹢Polling is a problem
﹢Missing categorization
﹢Fetchingrelated entities
﹢Frequent outages
﹢General advices / best practices
﹢Change management
﹢Documentation
﹢Quality assurance
﹢Summary
What is Mews?
﹢Not only hotel software
﹢3100 hotels around the globe
﹢650 employees – HQ Prague
﹢80.000 daily bookings
Tech:
﹢.NET + React
﹢Azure
﹢Stateless Monolith
﹢Single multi-tenant SQL Database
Make
it
remarkable.
+
Why public API?
• Expand current functionality
• Domain expertise outside Mews
• Engineers' shortages
• Process automation
• Speed up companygrowth
Make
it
remarkable.
+
Design API
• Simplicityand convenience
• Inspired by JSON Pure
• Everything in body
• POSTonly
• Avoid using headers
• Flat API structure
• Marketplace
Make
it
remarkable.
+
Encountered issues
Make
it
remarkable.
+
Polling is a problem
Encountered issues
• Data synchronizationin external systems
• Polling mechanism
• Increased traffic on our API
• Not scalable& inefficient
Make
it
remarkable.
+
Addressing polling issue
Encountered issues
• Websocket
• Server holds the connection
• Webhook v1
• Serialize only changed entities
• Clients swamped with data
• Webhook v2
• Serialize only IDs of changed entities
• On-demand data consumption
Make
it
remarkable.
+
Poor security &
discoverability
Encountered issues
• Increasing amount of integrationpartners
• Variousdomainsavailablethrough API
• Security threat
• Poor categorizationand discoverability
Make
it
remarkable.
+
Adding permissions
Encountered issues
• Each entity RO/RW/None permissions
• Introduce certificationprocess
• Better categorization
• Better control
Make
it
remarkable.
+
Fetching related entities
Encountered issues
• Too many “get” calls
• Subsequent callsto retrieve relatedand
nested entities
• Not idealuser experience
Make
it
remarkable.
+
Introducing “extent”s
Encountered issues
• Define whatyou wantto receive
• Simplicity and convenience
• Logic similar to SQL and GraphQL
• Clients love this addition
• Problems with Extents
• Limit 1:M relationshipsin API
• Performance issues
• Difficultto paginaterelated entities
Make
it
remarkable.
+
Frequent outages
Encountered issues
• Cloud resources are expensive
• Clients misusing our API
• Overprovisionedinfrastructure
• Outages or system slowness
Make
it
remarkable.
+
Rate Limiting
Encountered issues
• Throttling & Quotas
• Async cancellation
• Reward early adopters
• Lesson learned: Cut before reaching our code
• Ideally consider using API management tools
• Azure
• Gravitee
Make
it
remarkable.
+
General advices
Make
it
remarkable.
+
Change management
Generaladvices
• API mustevolve
• How to communicatechanges
• Newsletter
• Distributionlist
• Monitor usages
• Establish the process with peers
• Lesson learned: deprecated codefor 5+ years
Make
it
remarkable.
+
Documentation
Generaladvices
• Documentation
• Describes the API
• Documentation as Code
• Technical writer
• Open API Specification (Swagger)
• Automatic SDK generation
Make
it
remarkable.
+
Maintainability
Generaladvices
• Monitoring & Observability
• Log every request
• Dashboards & alerts
• Traces & metrics
• Anonymization
Make
it
remarkable.
+
Summary
﹢Sometimes less is more– don’t reinventthe wheel
﹢Hard to do systematic changes – evolution is a must
﹢Performance–polling is bad, outages hinder reputation
﹢If you wantto improvesomething, measureit
Mews Open API documentation

Kontent.ai DevMeetup #1 - Evoluce prvního veřejného API v hotelovém světě