Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Cognizant Academy

truYum

FSE Java – Microservices with


AWS Case Study Specification

Version 1.0
Prepared By / Last
Reviewed By Approved By
Updated By

Name Srilakshmi Jayaraman

Role Solution Designer

Signature

Date
Table of Contents

1.0 Introduction 3
1.1 Purpose of this document
1.2 Project Overview
1.3 Scope
1.4 Hardware and Software Requirement

2.0 Reference learning and requirement 3

3.0 Menu item listing and adding to cart 4


3.1 MenuItemListing WebApi
3.2 OrderItem WebApi

4.0 Cloud deployment and consumption in Console application 5

5.0 Change Log 6


1.0 Introduction

1.1 Purpose of this document


The purpose of this document is to describe the Microservices REST End Points and its
deployment in AWS ECS.

1.2 Project Overview


Yum is a leading restaurant chain that operates 50+ restaurants across the country. Due
to successful business model and solid understanding about consumer
needs, the Yum executive management feels that they can increase their business by
going online and delivery food to the door steps of the customer.

They are planning to open an online portal called truYum through which they want to
reach out a larger customer base.

For this Front End Portal, the development team wants to develop a strong middle ware
layer exposed as Microservices REST End Points so that the web portal can service its
customers accordingly.

1.3 Scope
Develop truYum application web services using Microservices on .Net core and deploy
that to Azure

1.4 Hardware and Software Requirement


1. Hardware Requirement:

a. Developer Desktop PC with 8GB RAM

2. Software Requirement

a. Spring Tool Suite (STS) Or any Latest Eclipse

i. Have PMD Plugin, EclEmma Code Coverage Plugin and AWS Code Commit
Enabled

ii. Configure Maven in Eclipse

b. Maven

c. Docker (Optional)

d. Postman Client in Chrome


2.0 Reference learning
Please go through all of these k-point videos for Microservices deployment into AWS.

https://cognizant.kpoint.com/app/video/gcc-6e36500f-c1af-42c1-a6c7-ed8aac53ab22

https://cognizant.kpoint.com/app/video/gcc-92f246c9-024a-40b7-8bfc-96b3ce7c1a39

https://cognizant.kpoint.com/app/video/gcc-cfedd9c1-e29e-4e3e-b3e2-1960277f72a3

https://cognizant.kpoint.com/app/video/gcc-900a7172-43b7-42f3-a6cc-e301bd9cc9b3

Other References:

Java 8 https://dzone.com/articles/parallel-and-asynchronous-programming-in-java-8
Parallel
Programming

Feign client https://dzone.com/articles/microservices-communication-feign-as-rest-client

Swagger https://dzone.com/articles/centralized-documentation-in-microservice-spring-b
(Optional)

ECL Emma https://www.eclipse.org/community/eclipse_newsletter/2015/august/article1.php


Code
Coverage

Lombok https://javabydeveloper.com/lombok-slf4j-examples/
Logging

Spring https://dzone.com/articles/spring-boot-security-json-web-tokenjwt-hello-world
Security

H2 In- https://dzone.com/articles/spring-data-jpa-with-an-embedded-database-and-
memory spring-boot
Database https://www.baeldung.com/spring-boot-h2-database

3.0 Design Considerations


Component Technical Features Remarks
Design

Menu 1. REST with Spring Boot Menu Service holds the list of
Microservice menu items that are serviced by
2. Can use Files to read the the Yum Restaurant.
menu and display
Menu Items are exposed by this
(Ex: menu.csv that holds: service.

11, Main Course, Noodles,


400

22, Dessert, Falooda, 200)

3. No Database

4. Use Lombok for Logging


(Use Console Appender,
so that it reflects in AWS)

5. Use Junit, Mockito for


Testing

6. Use Spring Security to


authorize customer for
every request

7. Use Feign Client to


enable the REST End
Points.

8. Use Swagger (Optional)

Order 1. REST with Spring Boot Once the customer logs in, they
Microservice view the Menu and can make an
2. Can use H2 in memory order. Order Details are persisted
database to persist the using this service.
orders

3. Use Junit, Mockito for


Testing

4. Use Lombok for Logging

5. Use Spring Security to


authorize customer for
every request

6. Use Multithreading (Java


8 Parallel Streams) to
handle concurrent orders
placed, and to provide
Order ID accordingly.

7. Assume that customer


has a wallet with needed
money loaded

8. Whenever an incorrect
menu item is received in
order, throw an error
response that “Item is not
available”.

9. Use Feign Client to


enable the REST End
Points.

10. Swagger (Optional)

Authenticatio Spring Security with Spring Every Customer has to login to get
n Service Boot (Authentication authenticated and all Microservices
Microservice) has to verify the customer to get
authorized
JSON Web Tokens

Yum Portal This is an independent MVC Yum Portal must provide the
Application, runs on a following functionalties:
different port.
(Assume that the customers
This application need not be already have a profile in the portal)
hosted in AWS.
1. Login
However the other
Microservices (Menu, Order 2. View Menu (Interacts with
and Authentication) has to be Menu Microservice to
hosted in AWS. display Menu Items in a
Table view)
The Yum Portal must hit the
Microservices in AWS and 3. Place Order (Selects a
then get the JSON response menu item and places an
and display in the Portal. order by calling Order
Service)
Junit must mock the
Microservices and the test
cases must be written.

4.0 Cloud deployment and consumption in


Console application
Follow the steps listed below

 Go thru the learning kpoint videos as listed in Section 2.0. Deploy Menu and Order
Microservice on AWS
o Check in the code to AWS Code Commit
o Create ECR for storing the container images
o Dockerize the application using the Code Pipeline
o Use Fargate deployment
o Use AWS Code Build and Deploy to build, dockerize and deploy the container to ECS
o Use ECS to configure auto scaling policies (scale in) to reduce the running task to 1 if CPU
utilization goes less than 30%.
o Configure the Desired count to 2 in the Service Configuration
 Create a MVC application in local environment to show the Menu items and the order details
hosted in cloud
 All the Services must be created in AWS ECS Cluster, Internet Facing Load Balancers must
be configured for every microservice, the URLs exposed by Load Balancer can be used in the
TruYum portal to access the services
 No Databsae in AWS must be created. Only H2 / In-memory database must be used in Ordre
Microservice.

5.0 Change Log


Changes Made
V1.0.0 Initial baseline created on <21-Jul-2020> by <Srilakshmi Jayaraman>

Section Changed Effective Changes Effected


No. By Date

You might also like