MicroFrontends Classroomnotes 27/Mar/2022

REST (Representational state Transfer)

  • The acronym REST comes from single chapter of PHP dissertation published in 2000 by Roy Fielding. Refer Here
  • Fielding identified the following list of important properties he thought every web based system should do
    • Performance: Offer high performance through design
      • Network Performance
      • User-perceived Performance
      • Network effeciency
    • Scalability
    • Simplicity
    • Modifiablility
    • Visibility
    • Portability
    • Reliability
  • REST Constraints
    • Client-Server: Implement a clear seperation between the server and the client app with request/response interactions
    • Stateless Systems
    • Cache
    • Uniform Interface

RESTful API Modeling Language (RAML)

  • This is an API Specification language which helps in modeling APIs. Refer Here

Case-Study – Design an e-commerce API

  • Lets assume we are creating a REST API for an ecommerce site developed
  • baseUri: This represents the common uri where your application will be hosted
    Preview
  • The RAML
#%RAML 1.0
title: E-commerce API
baseUri: http://qt.com/ecommerce/v1
version: v1

uses:
  assets: assets.lib.raml

annotationTypes:
  monitoringInterval:
    type: integer

/products:
  get:
  /{productId}:
      get:

/users:
  post:
  get:
  /{username}:
    get:
    put:

/carts:
   post:
   get:
      queryParameter:
         username:
   /{cartId}:
     get:
     put:

API Specifications

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner