Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Mapi Capi Thrift model generation

Jamie Webb edited this page Jul 21, 2020 · 1 revision

Mapi/Capi Thrift model generation

content-api-models/models/src/main/thrift/content/v1.thrift

In order to aid scalability and efficiency in fetching/receiving data it was deemed more expedient not to use JSON format to get this data

Overview:

Mapi sends requests to CAPI in order to receive content (articles) as responses CAPI responds to MAPI with a BLOB file of structured data containing the article Mapi then receives this data and bakes it into to other relevant data.

Mapi ---> Capi:

  • Mapi receives the URL request from the Load Balancer, sent from the clients browser.
  • Sends HTTP request to Capi (a URL) for the required article.

Capi ---> Mapi:

  • Capi searched the Database for the article
  • A thrift file then defines the type structure, example here
  • This defines the Key and Value, importantly the Type to enforce type integrity across modules/services
  • A Blob file is generated and sent back to Mapi

The general use of the BLOB file is very efficient and Thrift allows for the data type structure of the content to be generated in any syntax necessary, be it TS or Scala

Clone this wiki locally