23/180: Case Study — Microservices Design

  1. Functional Requirements
  2. Non Functional Requirements
  3. Mapping the components
  4. Define communication pattern

Library Management

  1. Manages books inventory
  2. Manages books borrowing
  3. Manages Customer
  4. Display Notifications
  5. Charge Annual Fee

Functional requirements:

  1. Web based
  2. Manage books inventory
  3. Manages customers
  4. Manages book borrowing
  5. Display Notification
  6. Charge Annual Fee

Non Functional Requirements:

  1. How many expected concurrent users — 10
  2. How many books will be managed-10000
  3. How many borrowing in a day — 500
  4. What’s the desired SLA — 9/5, i.e. 9hrs 5 days

Data Volume

Mapping the Components

Book Service

  1. Used by libraries
  2. Has a database storage
  3. Should be synchronous (immediate response)
  4. Does not depend on other services.
  1. Get Books Details. GET /api/v1/book/{bookId}
  2. Add new book POST /api/v1/book
  3. Update Book PUT /api/v1/book/{bookId}
  4. Remove Book DELETE /api/v1/book/{bookId}

Borrowing Service

  1. Add a borrowing. POST /api/v1/borrowing
  2. Add a return POST /api/v1/borrowing
  3. Get Borrowing by customer GET /api/v1/borrowing/{customerId}

Customer Service

  1. Manage Library customers
  2. Used by librarians
  3. Has a storage
  4. Should be synchronous
  5. Doesn't depend on other service (Although refers to books and borrowings)

Notification Service

  1. Used to send notifications to the library customers
  2. Books was returned, new books added etc
  3. Used by other services
  4. Asynchronous
  5. Might experience load (send notifications to all users)
  6. We will use queue
  7. No immediate response required
  8. Distributed load

Payment Service

  1. Used to send payment instructions to external service
  2. Used by other services (for example customer joins the library)
  3. Asynchronous
  4. High Reliability is must
  5. We will use queue
  6. No immediate response required
  7. High availability

View Service

--

--

--

I am Indian by birth, Punjabi by destiny. Humanity is my religion. Love to eat, travel, read books and my million dreams keep me alive.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

LeetCode problem #412: FizzBuzz (JavaScript)

Reckon-ng : Backbone of Osint Analysis

Console Log Big Emoji. 😎 👑

How to Quickly Create a Subfolder with the Same Name under the Top Folder of Each Outlook Section

Adding autofocus to elements in Angular

Closures in JavaScript

Angular framework for frontend development

What is React Portals.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Navneet Ojha

Navneet Ojha

I am Indian by birth, Punjabi by destiny. Humanity is my religion. Love to eat, travel, read books and my million dreams keep me alive.

More from Medium

Building a Better Future with Smart Cities and Microservices

Microservices API Gateway vs. Traditional API Gateway

Micro Frontends & Customer Experience - Part II

Organizing In-app Communication With Inbox Feed | Courier