cloud case study with practical hands on

Spachapure 30 views 107 slides Apr 29, 2024
Slide 1
Slide 1 of 107
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107

About This Presentation

cloud case study which talks about different cloud services and when and how to use them


Slide Content

Case Study #1
Memi Lavi
www.memilavi.com

A Real World Application

Application Introduction
Defining Requirements
Components Mapping
Technology Stack Selection
Architecture Design

Dunderly
Your Paper Source

•Sells Paper Supplies
•Printer paper, Envelopes, etc.
•Needs a new HR system
•Managing employees,
salaries, vacations, payments
Dunderly

Requirements
Functional Non-Functional
What the system should do What the system should deal
with
1.Web Based
2.Perform CRUD operations on employees
3.Manage Salaries:
1.Allow manager to ask for
employee’s salary change
2.Allow HR manager to approve /
reject request
4.Manage vacation days
5.Use external payment system
Dunderly

NFR -What We Know
1.Classic Information System
2.Not a lot of users
3.Not a lot of data
4.Interface to external system
Dunderly

1.“How many expected concurrent users?”
2.“How many employees?”
3.“What do we know about the external
Payment system?”
10
250
NFR -What We Ask
Dunderly

•Legacy system, written in C++
•Hosted in the company’s servers farm
•Input –only files 
•File received once a month
Payment System
Dunderly

•1 Employee = ~1MB in data
•Each employee has ~10 scanned documents (contract, reviews
etc.)
•1 Scanned Document =~5MB
•Total storage for 1 employee = ~51MB
Data Volume
Dunderly

•Company expects to grow to 500 employees in 5 years
•Total storage: 51MB X 500 employees = 25.5GB
•Not a lot, but:
•Need to consider document storage
Data Volume –Cont.
Dunderly

SLA
4. “How critical is the system?”
Dunderly
Not Very Critical

Requirements
Functional Non-Functional
What the system should do What the system should deal
with
1.10 Concurrent users
2.Manages 500 users
3.Data volume forecast: 25.5GB
1.Relational & Unstructured
4.Not mission critical
5.HTTP-based interface
1.Web Based
2.Perform CRUD operations on employees
3.Manage Salaries:
1.Allow manager to ask for
employee’s salary change
2.Allow HR manager to approve /
reject request
4.Manage vacation days
5.Use external payment system
Dunderly

Components
Based on requirements:
1.Entities: Employees, Vacation, Salary
2.Interface to the Payment System
Employees
Service
Performs
CRUD
Operations on
Employees
Dunderly
Salary
Service
Salary
approval
workflow
Vacation
Service
Employee’s
Vacation
Management
Payment
System
Payment
Interface
Sends
payment data
to payment
system
Data Store
Q: Single or
Per Service
Data Store?
A: Data is
shared
between
services, so a
Single Data
Store is better
Logging
View
Service
Returns static
files to the
browser
(HTML, CSS,
JS)

Messaging
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
Logging
View
Service
Users’ Browser
HTML Page
REST API / HTTP
Queue
File

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
Logging
View
Service
Users’ Browser
HTML Page
REST API / HTTP
Queue
File

Logging Service
-Very Important
-Other services use it
Dunderly

Logging -Questions
1.Is there an existing logging mechanism
used by the company in the cloud?
2.Develop our own or use 3
rd
party?
Dunderly
No

Logging in Azure
•Azure log analytics
•Part of Azure Monitor
•Great integration with a lot of services
•Handles huge amounts of data
•Offers query language for analysis
•Can be streamed to log analytics tools (Power BI etc.)
Dunderly

Logging in Azure
Dunderly

Logging in Azure
Dunderly

Cost of Log Analytics
Dunderly

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
Logging
View
Service
Users’ Browser
HTML Page
REST API / HTTP
Queue
File

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
View
Service
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
View
Service
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics

View Service
What it does:
-Get requests from the end users’ browsers
-Returns static files (HTML / CSS / JS)
Dunderly

Application Type
•Web App & Web API
•Mobile App
•Console
•Service
•Desktop App
Dunderly

Architecture
User Interface /
Service Interface
Business Logic
Data Access
Data Store

Architecture
User Interface
Business Logic
Data Access
Data Store
Dunderly

Static web sites in Azure
Dunderly
App Service Static Web Apps
•Fully managed web app & API
•Supports many platforms
•Autoscale
•Support for WebJobs
•Fully managed static web site
•Complete integration with source
controls (Git, Azure DevOps etc.)
•Extremely cost effective

Static web sites in Azure
Dunderly

Static web sites in Azure
Dunderly
Free tier has no SLA! (99.95% in Standard)
Our choice!

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
View
Service
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
View service

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
View service

Employees Service
What it does:
-Allows end users to query employees’ data
-Allows performing actions on data (CUD)
What it doesn’t:
-Displays the data
Dunderly

Application Type
•Web App & Web API
•Mobile App
•Console
•Service
•Desktop App
Dunderly

Technology Stack –Dev Platform
Dunderly

Azure Web API
Dunderly
App Service Function Apps
•Fully managed web app & API
•Supports many platforms
•Autoscale
•Support for WebJobs
•Fully managed serverless functions
•Lightweight
•Autoscale
•Integration with cloud services
•Extremely cost effective
Let’s choose:
-Azure Functions are for lightweight actions
-The API does some heavy lifting
-Updates, docs etc.
-App services support these actions

Azure Web API
Dunderly
App Service Function Apps
•Fully managed web app & API
•Supports many platforms
•Autoscale
•Support for WebJobs
•Fully managed cloud functions
•Lightweight
•Autoscale
•Integration with cloud services
•Extremely cost effective

Azure Web API
Dunderly

Technology Stack –Database
Dunderly
Employee Data (Relational) Documents
Azure SQL Storage Account

Azure SQL
Dunderly

Dunderly

Architecture
Service Interface
Business Logic
Data Access
Data Store
Dunderly

API
•Get full employee details by ID
•List of employees by parameters
•Add employee
•Update employee details
•Remove employee Not physical delete!
Dunderly

API –Cont.
•Add document
•Remove document
•Get document
•Retrieve documents by parameters
Dunderly
Q: Do we need a separate
Document Handler
service?
A: Since only the
Employee entity requires
docs, then no.

API
Functionality Path Return Codes
Get employee details by ID GET /api/v1/employee/{id} 200 OK
404 Not Found
List employees by parameters GET /api/v1/employees?name=…&birthdate=… 200 OK
400 Bad Request
Add employee POST /api/v1/employee 201 Created
400 Bad Request
Update employee details PUT /api/v1/employee/{id} 200 OK
400 Bad Request
404 Not Found
Remove employee DELETE /api/v1/employee/{id} 200 OK
404 Not Found
Dunderly

API
Functionality Path Return Codes
Add document POST /api/v1/employee/{id}/document 201 Created
404 Not Found
Remove document DELETE
/api/v1/employees/{id}/document/{docid}
200 OK
404 Not Found
Get document GET /api/v1/employees/{id}/document/{docid}200 OK
404 Not Found
Retrieve documents for employeeGET /api/v1/employees/{id}/documents 200 OK
404 Not Found
Dunderly

Employee Service Redundancy
Dunderly
App service auto scale

Components
Employees
Service
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface Data Store
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
View service

Components
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service

Components
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service

Salary Service
What it does:
-Allows managers to ask for an employee’s salary change
-Allows HR representative to approve / reject the request
Dunderly

Application Type
•Web App & Web API
•Mobile App
•Console
•Service
•Desktop App
Dunderly

Technology Stack
Dunderly

Azure Web API
Dunderly
App Service Function Apps
•Fully managed web app & API
•Supports many platforms
•Autoscale
•Support for WebJobs
•Fully managed cloud functions
•Lightweight
•Autoscale
•Integration with cloud services
•Extremely cost effective
Let’s choose:
-Azure Functions are for lightweight actions
-The API does some heavy lifting
-Updates, docs etc.
-App services support these actions

Azure Web API
Dunderly
App Service Function Apps
•Fully managed web app & API
•Supports many platforms
•Autoscale
•Support for WebJobs
•Fully managed cloud functions
•Lightweight
•Autoscale
•Integration with cloud services
•Extremely cost effective

Azure Web API
Dunderly

Architecture
Service Interface
Business Logic
Data Access
Data Store
Dunderly

API
•Add salary request
•Remove salary request
•Get salary requests
•Approve salary request
•Reject salary request
Dunderly

API
Functionality Path Return Codes
Add salary request POST /api/v1/salaryRequest/ 200 OK
400 Bad Request
Remove salary request DELETE /api/v1/salaryRequest/{id} 200 OK
404 Not Found
Get salary requests GET /api/v1/salaryRequests 200 OK
Approve salary request POST /api/v1/salaryRequest/{id}/approval 200 OK
404 Not Found
Reject salary request POST /api/v1/salaryRequest/{id}/rejection 200 OK
404 Not Found
Dunderly

Salary Service Redundancy
Dunderly
App service auto scale

Components
Dunderly
Salary
Service
Vacation
Service
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service

Components
Dunderly
Vacation
Service
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service

Components
Dunderly
Vacation
Service
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service

Vacation Service
What it does:
-Allows employees to manage their vacation days
-Allows HR to set available vacation days for
employees
Dunderly

Application Type
•Web App & Web API
•Mobile App
•Console
•Service
•Desktop App
Dunderly

Technology Stack
Dunderly

Azure Web API
Dunderly
App Service
•Fully managed web app & API
•Supports many platforms
•Autoscale
•Support for WebJobs

Azure Web API
Dunderly

Architecture
Service Interface
Business Logic
Data Access
Data Store
Dunderly

API
•Set available vacation days (by HR)
•Get available vacation days
•Reduce vacation days (by employees)
Dunderly

API
Functionality Path Return Codes
Set available vacation days PUT /api/v1/vacation/{empid} 200 OK
404 Not Found
Get available vacation days GET /api/v1/vacation/{empid} 200 OK
404 Not Found
Reduce vacation days POST /api/v1/vacation/{empid}/reduction 200 OK
Dunderly

Vacation Service Redundancy
Dunderly
App service auto scale

Components
Dunderly
Vacation
Service
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service

Components
Dunderly
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service

Components
Dunderly
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service

Payment Interface
What it does:
-Queries the database once a month for salary data
-Passes payment data to the external payment
system
Dunderly

Application Type
•Web App & Web API
•Mobile App
•Console
•Service
•Desktop App
Dunderly

Technology Stack
Dunderly

Azure batch process
Dunderly
App Service WebJob Function Apps
•Runs on schedule
•Part of the App service
•No additional cost
•Fully managed cloud functions
•Lightweight
•Autoscale
•Integration with cloud services
•Extremely cost effective
Let’s choose:
-Azure Functions are for lightweight actions
-Have great monitoring
-The export can take a lot of time

App Service WebJob
Azure batch process
Dunderly
Function Apps
•Fully managed cloud functions
•Lightweight
•Autoscale
•Integration with cloud services
•Extremely cost effective
•Runs on schedule
•Part of the App service
•No additional cost

App Service WebJob
Azure batch process
Dunderly
Other alternatives
•Runs on schedule
•Part of the App service
•No additional cost
VM
Logic app
Azure batch
•Requires a lot of manual
maintenance
•Expensive
•Too complex for this specific job
•Used for huge processes, this is
not the case

Payment Interface Redundancy
Dunderly
•No built-in redundancy for WebJobs
•Not critical –runs once a month
•Add monitoring for catching failures

Components
Dunderly
Payment
System
Payment
Interface
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service

Components
Dunderly
Payment
System
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service
Payment
interface
WebJob

Components
Dunderly
Payment
System
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service
Payment
interface
WebJob

Security
Dunderly
•Data encryption
•Network security
•Access restrictions

Data Encryption
Dunderly
•Data in Azure Storage account is encrypted by default
•Using 256-bit AES encryption
•Traffic to Storage Account is encrypted using TLS

Data Encryption
Dunderly
•Data in Azure SQL is encrypted by default
•Using 256-bit AES encryption
•Traffic to Azure SQL is encrypted using TLS

Network Security
Dunderly
•Currently all app services are exposed to the internet
•No protection whatsoever
•Need to add Web Application Firewall (WAF)

Application Gateway + WAF
Dunderly
•Load balancer
•Web Application Firewall
•Autoscale
•Sophisticated routing

Dunderly

Components
Dunderly
Payment
System
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service
Payment
interface
WebJob
App GW + WAF

Access Restrictions
Dunderly
•Access to resources should be limited to allowed
resources only

Dunderly
Payment
System
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service
Payment
interface
WebJob
App GW + WAF
Resources to be access-restricted:
Allow access from App GW only
Allow access from App services only

Restrict access to App service
Dunderly
Add NSG rule to allow traffic from the App GW’s VNET

Dunderly

Dunderly

Restrict access to Azure SQL
Dunderly
1.Get outbound IP of the App service
2.Add firewall rule to the Azure SQL

Dunderly

Dunderly

Restrict access to Storage Account
Dunderly
1.Get outbound IP of the App service
2.Add firewall rule to the Storage Account

Dunderly

Architecture Diagram
Dunderly
Payment
System
Users’ Browser
HTML Page
REST API / HTTP
File
Log analytics
Static web apps
Azure SQL Storage
Account
App service
View serviceEmployees
service
Salary
service
App service
Vacation
service
App service
Payment
interface
WebJob
App GW + WAF

Dunderly
Cost
Download detailed cost estimation
from the lecture’s resources