DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Self-Hosted Gateway Design Patterns Discussion
  • Breaking Up a Monolithic Database with Kong
  • What is MuleSoft and Anypoint Platform Capabilities and Strengths
  • Integration Patterns in Microservices World

Trending

  • Retesting Best Practices for Agile Teams: A Quick Guide to Bug Fix Verification
  • LLM-Powered Deep Parsing for Industrial Inventory Search
  • The Network Attach Problem Nobody Warns You About
  • Kafka and Spark Structured Streaming in Enterprise: The Patterns That Hold Up Under Pressure
  1. DZone
  2. Data Engineering
  3. Databases
  4. VETRO Pattern for API Gateways

VETRO Pattern for API Gateways

API gateways can support a number of microservices patterns. Learn about the VETRO pattern and what goals it can accomplish.

By 
Abhilash Juluri user avatar
Abhilash Juluri
·
May. 09, 18 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
14.8K Views

Join the DZone community and get the full member experience.

Join For Free

VETRO is a popular acronym that summarizes most of the benefits offered by middleware solutions like ESBs and API gateways. VETRO highlights the key functions of API gateways, though gateways can also support a number of microservices patterns like Microservice.io or EIP patterns.

VETRO stands for:

  • Validation – As the name suggests, it means validating request message as per any agreed conventions or contracts. Several frameworks or tools are used to validate the message before it reaches the backend services. Available frameworks are:
    • Bean validation (JSR 380) for doing validations in plain Java.
    • JSON Schemas are being actively developed, but XML Schemas for XML messages are fully developed if XML is an option.
    • Schematrons for XML are not relevant in JSON world
    • Authentication and Authorization are best done in OAuth 2.0/OpenID Connect using JWTs
    • Frameworks like SAML and WS-Policy do exist, however they are going irrelevant in REST/JSON era.
  • Enrich – As an active intermediary, a gateway enriches the messages in message flows before passing it to backend services
    • Smart endpoints and dumb pipes is one of the popular design pattern which makes a strong case to keep Gateways as dumb as possible. Service composition or aggregation is a slippery slope as it opens up for developers to add complex logic (could be business logic) in Gateways. 
    • Netflix like companies took U-turn on “smart endpoints and dump pipes” pattern and doing service aggregation in Gateway for improving scalability, performance to cater to a large variety of devices.
    • Enriching the messages between front and backend systems often involves validating security and adding relevant user context and tailoring messages for receiving party, but developers must use caution and not add any business logic in Gateway. 
  • Transform
    • Transformation of messages from backend systems to API friendly data representations like JSON or XML
    • It is common practice to transform the backend service data and filter the data fields that are interested by the consumer. Netflix sets a very good example towards this practice. 
  • Route & Operate 
    • Routing the calls to respective backend services based on request URL, query parameters and Operating the service i.e., actual invocation of the service over its real endpoint.
    • Often, service traffic is routed through many intermediaries like reverse proxies, web servers, load balancers, etc… It gets very annoying to isolate the one who ate your headers. So, use caution when using transport headers for routing the consumers. 

Conclusion

  1. SOAP services are deprecated in the industry in favor of lightweight replacements like REST services

  2. XML representation of data is being deprecated in favor of lightweight JSON representation. This also due to the amazing return of Javascript and its widespread adoption in modern applications.

  3. Resource-based services (RESTful APIs) over coarse-grained business functions as services

  4. Models in MVC are shifting to client-side instead of server-side MVC, again due to advancements in browsers and JavaScript engines.

Enterprise integration came long way and morphed into many shapes: EAI to SOA, SOA to API, API to Microservices, and now Serverless. We just need to wait and see where serverless architectures will take us!

API microservice Web Service

Opinions expressed by DZone contributors are their own.

Related

  • Self-Hosted Gateway Design Patterns Discussion
  • Breaking Up a Monolithic Database with Kong
  • What is MuleSoft and Anypoint Platform Capabilities and Strengths
  • Integration Patterns in Microservices World

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook