Case Study #1: Memi Lavi
Case Study #1: Memi Lavi
Memi Lavi
www.memilavi.com
A Real World Application
Application Introduction
Defining Requirements
Components Mapping
Architecture Design
Dunderly
Your Paper Source
Dunderly
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
Payment system?”
Dunderly
Payment System
Functional Non-Functional
What the system should do What the system should deal
with
1. Web Based
1. 10 Concurrent users
2. Perform CRUD operations on employees
2. Manages 500 users
3. Manage Salaries:
3. Data volume forecast: 25.5GB
1. Allow manager to ask for employee’s
1. Relational & Unstructured
salary change
4. Not mission critical
2. Allow HR manager to approve / reject
5. File-based interface
request
4. Manage vacation days
5. Use external payment system
Dunderly
Components
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Components
Users’ Browser
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Logging Service
- Very Important
ELK:
But:
No
• Requires maintenance
G o
• Quite complicated to install and setup
Steps:
What it does:
What it does:
• Mobile App
• Console
• Service
• Desktop App
Application Type
• Mobile App
• Console
• Service
• Desktop App
Technology Stack
For:
• Component’s Code
• Data Store
Technology Stack
Code Should:
Business Logic
Data Access
Data Store
Architecture
Business Logic
Data Access
Data Store
Logging Service
Dependency Injection
Business Logic Validates the records
using
Microsoft.Extensions.DependencyInjection
Data Store
Dunderly
Logging Service Redundancy
X
Logging Service
Dunderly
Logging Service Redundancy
X
Logging Service
Is Alive
Logging Service
Dunderly
Logging Service Redundancy
X
Logging Service
Is Alive? No!
Logging Service
Dunderly
Logging Service Redundancy
X
Logging Service
Is Alive? No!
Logging Service
Dunderly
Components
Users’ Browser
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
View Service
What it does:
• Mobile App
• Console
• Service
• Desktop App
Dunderly
Technology Stack
So…
Dunderly
Technology Stack
Architecture
Business Logic
Data Access
Data Store
Dunderly
Architecture
User Interface
Business Logic
Data Access
Data Store
Dunderly
View Service Redundancy
Load Balancer
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Employees Service
What it does:
What it doesn’t:
• Mobile App
• Console
• Service
• Desktop App
Dunderly
Technology Stack – Dev Platform
Dunderly
Technology Stack – Database
?
Dunderly
Technology Stack – Database
File System
Object Store
Cloud Storage
Dunderly
Document (BLOB) Storage Alternatives
Alternative Description Examples Pros Cons
Relational Store the document in a SQL Server’s Part of the app Clunky syntax,
specialized column type FILESTREAM, transaction Limited size
Database designed for BLOBs Oracle’s BLOB type Part of the DB’s
backup / DR
Dunderly
Document (BLOB) Storage Alternatives
Alternative Description Examples Pros Cons
Relational Store the document in a SQL Server’s Part of the app Clunky syntax,
specialized column type FILESTREAM, transaction Limited size
Database designed for BLOBs Oracle’s BLOB type Part of the DB’s
backup / DR
File System Store the document in a File System (duh…) Unlimited size Not part of
file, and hold a pointer Easy to execute transaction,
to it in the DB Unmanageable
Dunderly
Document (BLOB) Storage Alternatives
Alternative Description Examples Pros Cons
Relational Store the document in a SQL Server’s Part of the app Clunky syntax,
specialized column type FILESTREAM, transaction Limited size
Database designed for BLOBs Oracle’s BLOB type Part of the DB’s
backup / DR
File System Store the document in a File System (duh…) Unlimited size Not part of
file, and hold a pointer Easy to execute transaction,
to it in the DB Unmanageable
Object Store Use special type of store CEPH Great scale Complex setup
mechanism that Unlimited size Dedicated knowledge
specializes in BLOBs New product in the
mix
Dunderly
Document (BLOB) Storage Alternatives
Alternative Description Examples Pros Cons
Relational Store the document in a SQL Server’s Part of the app Clunky syntax,
specialized column type FILESTREAM, transaction Limited size
Database designed for BLOBs Oracle’s BLOB type Part of the DB’s
backup / DR
File System Store the document in a File System (duh…) Unlimited size Not part of
file, and hold a pointer Easy to execute transaction,
to it in the DB Unmanageable
Object Store Use special type of store CEPH Great scale Complex setup
mechanism that Unlimited size Dedicated knowledge
specializes in BLOBs New product in the
mix
Cloud Storage Store the documents in Azure’s Storage Great scale Requires internet
one of the public cloud Account Easy to execute connection
storage mechanisms AWS’s S3 Cost
Dunderly
Technology Stack – Database
?
Dunderly
Technology Stack – Database
- Documents are
small (~1MB)
- Already exists
- Part of the app
Dunderly
Architecture
Service Interface
Business Logic
Data Access
Data Store
Dunderly
API
• Add employee
Q: Do we need a separate
• Add document
Document Handler service?
• Remove document
A: Since only the
• Get document Employee entity requires
docs, then no.
• Retrieve documents by parameters
Dunderly
API
Load Balancer
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Salary Service
What it does:
• Mobile App
• Console
• Service
• Desktop App
Dunderly
Technology Stack
Dunderly
Architecture
Service Interface
Business Logic
Data Access
Data Store
Dunderly
API
Load Balancer
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Vacation Service
What it does:
• Mobile App
• Console
• Service
• Desktop App
Dunderly
Technology Stack
Dunderly
Architecture
Service Interface
Business Logic
Data Access
Data Store
Dunderly
API
Load Balancer
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Payment Interface
What it does:
• Mobile App
• Console
• Service
• Desktop App
Dunderly
Technology Stack
Dunderly
Architecture
Timer
Business Logic
Data Access
Data Store
Dunderly
Payment Interface Redundancy
Payment Interface
Is Alive
Payment Interface
Dunderly
Messaging
Users’ Browser
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Technology Stack – Queue
Queue Alternatives:
Self Developed
RabbitMQ
Kafka
Dunderly
Queue Alternatives:
Self Developed
Kafka
Dunderly
Logic Diagram
Users’ Browser
HTML Page
REST API / HTTP
Queue
Payment Payment
Data Store Logging
System File Interface
Dunderly
Technical Diagram
Queue
RabbitMQ
Payment Payment
Data Store Logging
System File Interface
.NET Core .NET Core
LB LB LB LB
Employees Salary Vacation View
Employees Salary Vacation View
Service Service Service Service
Service Service Service Service
Queue
Payment Payment
Payment Data Store Logging
System File Interface Logging
Interface