...

/

CamelCamelCamel API Design Decisions

CamelCamelCamel API Design Decisions

Understand design considerations for the CamelCamelCamel API service.

This lesson will discuss design decisions paramount to creating an effective C3 service. Mainly, we’ll decide on a suitable architectural style, data format, and HTTP version for an effective C3 service.

Design overview

Let’s start by understanding the architecture and workflow of the C3 service before diving into a discussion of design decisions because C3’s design architecture and workflow will enable us to make suitable decisions. Notice the synchronous communication of the C3 service with Amazon, a distinct service provider. The C3 API uses search, pub-sub, and product services. These services interact with Amazon’s services to provide data to potential customers. The following illustration demonstrates a high-level architecture of the workings of a C3 service:

Press + to interact
Working architecture of a C3 service
Working architecture of a C3 service

The following table gives an overview of each of the components involved in a C3 service:

Components and Services Details

Component or Service

Details


API Gateway

  • Client to C3 service
  • C3 to Amazon service
  • Analyzes and routes the requests to appropriate services
  • Authenticates and authorizes requests
  • Limits address rate to throttle requests

C3 Service

Search service

  • Handles client's search requests

Pub-sub service

  • Handles requests to add products to the watch list
  • Notifies users about price drops


Product service

  • Recommends products to users
  • Interacts continuously with Amazon service to update data
  • Publishes an event of the price drop on the pub-sub after data analysis

Amazon Service


Search service

  • Handles search requests made by the C3 service to tackle client's search requests

Simple queuing service (SQS)

  • Stores requests to be processed in a queue

Product advertising service

  • Handles periodic user requests forwarded by SQS

Workflow of C3

The C3 service works synchronously with the Amazon service. Let’s discuss the workflow of each service according to the functional requirements. Requests to C3’s API gateway can interact with any of the subservices of C3 according to the required functionality, as described below:

  • Search product: If it's a search query from a user, the API gateway sends it to the search service of the C3. The C3’s search service ...