SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
Pivorak meetup, Lviv, September 6
Business-friendly library for
inter-service communication
Anton Mishchuk
About me
- Lead software engineer
at Matic Insurance Services Inc
- We are hiring!
- Contact Iryna Sulatska
- linkedin.com/in/sulatskaya
- GitHub: antomi
- Medium: @anton.mishchuk
Goal
- Share our thoughts about the approaches to
inter-service communication
- Discuss in details the library we designed
for the communication
Agenda
- A little bit of history:
- How did we create a technical dept
- Approaches to inter-service communication:
- API-gateway vs Service Mesh
- REST vs Messaging
- Business-friendly library (BFL):
- One library for the whole platform
Evolution of the Matic platform
History
About Matic
- Matic is an insurance agency
- We integrated with ~20 insurance companies
- There are several inter-connected applications
(servicers) inside the Matic platform
- Almost all the services are written using Ruby
The beginning
S#1
Agents
Company #1
Company #2
Company #3Customer
Synchronous communication via HTTP REST (JSON)
Next steps
S#1
Agents
Company #1
Company #2
Company #3
S#3S#2
Sync and Async Communication via HTTP REST (JSON)
More and more services
S#1
S#3S#2
S#5S#4
S#6
API
Gateway
- Lots of services with heterogeneous API:
- No client libraries (plain JSONs)
- Naming collisions
- Data duplication between services
- It’s hard to make changes and introduce new services
Technical debt
Or a least to make a plan for payments
It’s time to pay the debt
Decisions we had to make
- 1. Topology
- Single communication hub (API Gateway)
- Service Mesh
- 2. Protocol:
- HTTP (sync)
- Messaging (async)
- 3. Client libraries:
- Do we really need them?
API Gateway
1. Topology
Service Mesh
S#1
S#4S#3
S#2
API
Gateway
S#1
S#4S#3
S#2
Pros:
- One place for the Platform level
API and
- “Facade” API - API built on top of
existing API
- Simple services discovery and
configuration
- One single point to integrate with
API Gateway
Cons:
- Single point of failure
- Hard to debug failures
- Part of business logic is here
- Who is responsible?
Pros:
- No single point of failure
- All the business logic is inside the
particular service
- Easy to debug
Service Mesh
Cons:
- Looks much more complex
- Services discovery and
configuration is in every project
- “Facade” API is not possible
Final decision
Service Mesh with API Gateway for external requests
S#1
S#4S#3
S#2
API
Gateway
- Services discovery and configuration
- “Facade” API
We decided to implement them on “library” level
What about API gateway features?
HTTP REST:
- Request/Response
- Synchronous
- One recipient
2. Protocol
Message Queues:
- Fire and forget
- Asynchronous
- Many recipients
Final decision - use both
HTTP REST:
- When you GET smth and expect immediate response
- When you DO smth and expect immediate result
Message Queue:
- When you INFORM about smth and
don’t need a feedback
3. Client libraries
- General rule - you must have them!
- No error-prone plain JSON
- The same team develop endpoints and library
- Responsibility of request formation and validation goes
to the team that supports an endpoint
- Documented by code
- There are no drawbacks at all!
Client libraries
- If there are 10 services, there are 10 libraries
- It’s ok, in general
- But what if we put all of them into one single gem?
Single client library. Naive approach
- Just put all code into one gem
- Namespace functionality for each project
- And that’s it
Naive approach problem!
Existing abstractions in our APIs
don’t always correspond to business abstractions!
Single client library. Correct approach!
- Define platform-level models
- models that reflect domain and are common for every (most) service
in the platform: customer, property, lead, quote, policy.
- Define platform-level actions
- actions that reflect domain: “create customer”, “request quotes”
- operate with platform-level models
Business-friendly library
Palantir
Сhallenge #1: Proper naming
- Problem:
Some entities have the same name in projects but
actually maps to different domain models:
- Our examples: policy/prior_policy, etc
- Solution:
Think carefully about names for your entities!
Rename them properly.
Сhallenge #2: Data duplication
- Problem:
Some entities are stored in different projects:
- Our examples: customer, property, quotes, etc.
- Solution:
Find a proper place to store entities
Create a separate storage for entities that are used by
several services.
Сhallenge #3: API redesign
- Problem:
Redesign API endpoints for most of the projects
- After all changes mentioned above existing API becomes obsolete
- Solution:
- Just do it!
Models and actions
Palantir internals
Models
- Data structures with validation and serialization
- Defines attributes
- The way of validation (include ActiveModel::Validations)
- The way of serialization (include ActiveModel::Serializers::JSON)
- Can be reused in the projects
- Validation before actual request
Actions. Questions
- Wrap HTTP GET requests
- For fetching information from services
- Examples: GetProperty, ListPeople, etc.
Actions. Commands
- Wrap POST/PUT/DELETE requests
- For data creation and modification
- Examples: CreateProperty, RequestQuote, etc.
Actions. Statements (events)
- Wrap asynchronous communication
via Message queue
- Information messages that are broadcasted
on the platform level
- Consumed by any interested subscribers
- Example: PropertyChanged, QuoteFound
Actions interface
Remote Procedure Call (RPC)
Response
Call the action and get “response” object
Response statuses
- success
- Everything is fine. Results are available in response
- invalid
- Validation error on client side
- fail
- Smth went wrong on server side
Validation and defaults
- Validation before an actual request
- Simple validation
- More sophisticated one is on server side
- Set defaults for attributes
“Facade” API
- Complex actions/models build on top of
service-specific ones
- Example: SearchProperty
Service discovery
- Location
- Protocol
- Authentication
Profit for engineers and product managers
Conclusion
BFL for engineers
- Introduce Ruby object interface to the whole platform
- Defines “platform language”
- Documents all the APIs. In one place. By code
BFL for product managers
- Defines set of models (nouns) and actions (verbs)
available in the platform
- Business and engineers speak one “platform language”
Communication is important!
Questions?
Thank you!
Remember, we are hiring!

Más contenido relacionado

Similar a Business-friendly library for inter-service communication

REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)
Sascha Wenninger
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
webhostingguy
 
Role of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIRole of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EI
WSO2
 

Similar a Business-friendly library for inter-service communication (20)

Cloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practicesCloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practices
 
REST APIs
REST APIsREST APIs
REST APIs
 
REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)REST - What's It All About? (SAP TechEd 2012, CD110)
REST - What's It All About? (SAP TechEd 2012, CD110)
 
Donald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New TricksDonald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New Tricks
 
Building a microservice architecture for a 100mio# revenue company
Building a microservice architecture for a 100mio# revenue companyBuilding a microservice architecture for a 100mio# revenue company
Building a microservice architecture for a 100mio# revenue company
 
RefCard API Architecture Strategy
RefCard API Architecture StrategyRefCard API Architecture Strategy
RefCard API Architecture Strategy
 
LeedsSharp May 2023 - Azure Integration Services
LeedsSharp May 2023 - Azure Integration ServicesLeedsSharp May 2023 - Azure Integration Services
LeedsSharp May 2023 - Azure Integration Services
 
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
 
An Introduction to Microservices
An Introduction to MicroservicesAn Introduction to Microservices
An Introduction to Microservices
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
 
Http and REST APIs.
Http and REST APIs.Http and REST APIs.
Http and REST APIs.
 
REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25REST - Why, When and How? at AMIS25
REST - Why, When and How? at AMIS25
 
Serious Sencha - Data Layer and Server-Side REST Interface
Serious Sencha - Data Layer and Server-Side REST InterfaceSerious Sencha - Data Layer and Server-Side REST Interface
Serious Sencha - Data Layer and Server-Side REST Interface
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 
Role of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EIRole of Rest vs. Web Services and EI
Role of Rest vs. Web Services and EI
 
Thin client SPAs. Stream UI using web standards
Thin client SPAs. Stream UI using web standardsThin client SPAs. Stream UI using web standards
Thin client SPAs. Stream UI using web standards
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
Breaking Down the Monolith - Peter Marton, RisingStack
Breaking Down the Monolith - Peter Marton, RisingStackBreaking Down the Monolith - Peter Marton, RisingStack
Breaking Down the Monolith - Peter Marton, RisingStack
 
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
 

Más de Pivorak MeetUp

Más de Pivorak MeetUp (20)

Lisp(Lots of Irritating Superfluous Parentheses)
Lisp(Lots of Irritating Superfluous Parentheses)Lisp(Lots of Irritating Superfluous Parentheses)
Lisp(Lots of Irritating Superfluous Parentheses)
 
Some strange stories about mocks.
Some strange stories about mocks.Some strange stories about mocks.
Some strange stories about mocks.
 
How i was a team leader once
How i was a team leader onceHow i was a team leader once
How i was a team leader once
 
Rails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiRails MVC by Sergiy Koshovyi
Rails MVC by Sergiy Koshovyi
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
 
Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)
 
Testing in Ruby
Testing in RubyTesting in Ruby
Testing in Ruby
 
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Ruby Summer Course by #pivorak & OnApp - OOP Basics in RubyRuby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
 
The Saga Pattern: 2 years later by Robert Pankowecki
The Saga Pattern: 2 years later by Robert PankoweckiThe Saga Pattern: 2 years later by Robert Pankowecki
The Saga Pattern: 2 years later by Robert Pankowecki
 
Data and Bounded Contexts by Volodymyr Byno
Data and Bounded Contexts by Volodymyr BynoData and Bounded Contexts by Volodymyr Byno
Data and Bounded Contexts by Volodymyr Byno
 
Successful Remote Development by Alex Rozumii
Successful Remote Development by Alex RozumiiSuccessful Remote Development by Alex Rozumii
Successful Remote Development by Alex Rozumii
 
Origins of Elixir programming language
Origins of Elixir programming languageOrigins of Elixir programming language
Origins of Elixir programming language
 
Functional Immutable CSS
Functional Immutable CSS Functional Immutable CSS
Functional Immutable CSS
 
Multi language FBP with Flowex by Anton Mishchuk
Multi language FBP with Flowex by Anton Mishchuk Multi language FBP with Flowex by Anton Mishchuk
Multi language FBP with Flowex by Anton Mishchuk
 
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
Detective story of one clever user - Lightning Talk By Sergiy KukuninDetective story of one clever user - Lightning Talk By Sergiy Kukunin
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
 
CryptoParty: Introduction by Olexii Markovets
CryptoParty: Introduction by Olexii MarkovetsCryptoParty: Introduction by Olexii Markovets
CryptoParty: Introduction by Olexii Markovets
 
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
How to make first million by 30 (or not, but tryin') - by Marek PiaseckiHow to make first million by 30 (or not, but tryin') - by Marek Piasecki
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
 
GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun
 
Unikernels - Keep It Simple to the Bare Metal
Unikernels - Keep It Simple to the Bare MetalUnikernels - Keep It Simple to the Bare Metal
Unikernels - Keep It Simple to the Bare Metal
 
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
 HTML Canvas tips & tricks - Lightning Talk by Roman Rodych HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Business-friendly library for inter-service communication

  • 1. Pivorak meetup, Lviv, September 6 Business-friendly library for inter-service communication Anton Mishchuk
  • 2. About me - Lead software engineer at Matic Insurance Services Inc - We are hiring! - Contact Iryna Sulatska - linkedin.com/in/sulatskaya - GitHub: antomi - Medium: @anton.mishchuk
  • 3. Goal - Share our thoughts about the approaches to inter-service communication - Discuss in details the library we designed for the communication
  • 4. Agenda - A little bit of history: - How did we create a technical dept - Approaches to inter-service communication: - API-gateway vs Service Mesh - REST vs Messaging - Business-friendly library (BFL): - One library for the whole platform
  • 5. Evolution of the Matic platform History
  • 6. About Matic - Matic is an insurance agency - We integrated with ~20 insurance companies - There are several inter-connected applications (servicers) inside the Matic platform - Almost all the services are written using Ruby
  • 8. Synchronous communication via HTTP REST (JSON) Next steps S#1 Agents Company #1 Company #2 Company #3 S#3S#2
  • 9. Sync and Async Communication via HTTP REST (JSON) More and more services S#1 S#3S#2 S#5S#4 S#6 API Gateway
  • 10. - Lots of services with heterogeneous API: - No client libraries (plain JSONs) - Naming collisions - Data duplication between services - It’s hard to make changes and introduce new services Technical debt
  • 11. Or a least to make a plan for payments It’s time to pay the debt
  • 12. Decisions we had to make - 1. Topology - Single communication hub (API Gateway) - Service Mesh - 2. Protocol: - HTTP (sync) - Messaging (async) - 3. Client libraries: - Do we really need them?
  • 13. API Gateway 1. Topology Service Mesh S#1 S#4S#3 S#2 API Gateway S#1 S#4S#3 S#2
  • 14. Pros: - One place for the Platform level API and - “Facade” API - API built on top of existing API - Simple services discovery and configuration - One single point to integrate with API Gateway Cons: - Single point of failure - Hard to debug failures - Part of business logic is here - Who is responsible?
  • 15. Pros: - No single point of failure - All the business logic is inside the particular service - Easy to debug Service Mesh Cons: - Looks much more complex - Services discovery and configuration is in every project - “Facade” API is not possible
  • 16. Final decision Service Mesh with API Gateway for external requests S#1 S#4S#3 S#2 API Gateway
  • 17. - Services discovery and configuration - “Facade” API We decided to implement them on “library” level What about API gateway features?
  • 18. HTTP REST: - Request/Response - Synchronous - One recipient 2. Protocol Message Queues: - Fire and forget - Asynchronous - Many recipients
  • 19. Final decision - use both HTTP REST: - When you GET smth and expect immediate response - When you DO smth and expect immediate result Message Queue: - When you INFORM about smth and don’t need a feedback
  • 20. 3. Client libraries - General rule - you must have them! - No error-prone plain JSON - The same team develop endpoints and library - Responsibility of request formation and validation goes to the team that supports an endpoint - Documented by code - There are no drawbacks at all!
  • 21. Client libraries - If there are 10 services, there are 10 libraries - It’s ok, in general - But what if we put all of them into one single gem?
  • 22. Single client library. Naive approach - Just put all code into one gem - Namespace functionality for each project - And that’s it
  • 23. Naive approach problem! Existing abstractions in our APIs don’t always correspond to business abstractions!
  • 24. Single client library. Correct approach! - Define platform-level models - models that reflect domain and are common for every (most) service in the platform: customer, property, lead, quote, policy. - Define platform-level actions - actions that reflect domain: “create customer”, “request quotes” - operate with platform-level models
  • 26. Сhallenge #1: Proper naming - Problem: Some entities have the same name in projects but actually maps to different domain models: - Our examples: policy/prior_policy, etc - Solution: Think carefully about names for your entities! Rename them properly.
  • 27. Сhallenge #2: Data duplication - Problem: Some entities are stored in different projects: - Our examples: customer, property, quotes, etc. - Solution: Find a proper place to store entities Create a separate storage for entities that are used by several services.
  • 28. Сhallenge #3: API redesign - Problem: Redesign API endpoints for most of the projects - After all changes mentioned above existing API becomes obsolete - Solution: - Just do it!
  • 30. Models - Data structures with validation and serialization - Defines attributes - The way of validation (include ActiveModel::Validations) - The way of serialization (include ActiveModel::Serializers::JSON) - Can be reused in the projects - Validation before actual request
  • 31. Actions. Questions - Wrap HTTP GET requests - For fetching information from services - Examples: GetProperty, ListPeople, etc.
  • 32. Actions. Commands - Wrap POST/PUT/DELETE requests - For data creation and modification - Examples: CreateProperty, RequestQuote, etc.
  • 33. Actions. Statements (events) - Wrap asynchronous communication via Message queue - Information messages that are broadcasted on the platform level - Consumed by any interested subscribers - Example: PropertyChanged, QuoteFound
  • 35. Response Call the action and get “response” object
  • 36. Response statuses - success - Everything is fine. Results are available in response - invalid - Validation error on client side - fail - Smth went wrong on server side
  • 37. Validation and defaults - Validation before an actual request - Simple validation - More sophisticated one is on server side - Set defaults for attributes
  • 38. “Facade” API - Complex actions/models build on top of service-specific ones - Example: SearchProperty
  • 39. Service discovery - Location - Protocol - Authentication
  • 40. Profit for engineers and product managers Conclusion
  • 41. BFL for engineers - Introduce Ruby object interface to the whole platform - Defines “platform language” - Documents all the APIs. In one place. By code
  • 42. BFL for product managers - Defines set of models (nouns) and actions (verbs) available in the platform - Business and engineers speak one “platform language”