Software Architecture Design
Last Updated: June 01, 2023 by Pepe Sandoval
If you find the information in this page useful and want to show your support, you can make a donation
Use PayPal
This will help me create more stuff and fix the existent content...
The software architecture of a system is a high level description of the system structure, it's different components and how those components communicate with each other
The structure of our system describes both the intent of our product and its qualities.
There are infinite ways to organize code but different organizations will give us different properties, like:
SW Arch abstractions
A distributed multi-service approach allows us to architect systems that can handle large amounts of requests, process, and store very large amounts of data,
Always focus on figuring out and narrowing down what exactly we need to build
Translate high level request to technical requirements
Classifying requirements into categories can help, type of requirements:
Use Case: It is a particular situation or scenario in which our system is used to achieve a goal.
Use Flow: It is step-by-step or graphical representation of a use case
Gather Functional requirements
action
and data
involvedGather Functional requirements
Performance in terms of Speed == Response time (Response Time = Processing Time + Waiting Time
): The time between a client sending a request and receiving a response.
Performance in terms of processing == Throughput (Throughput = Tasks/second = Bytes/second
): Refers to the ability to ingest and process data at a given period of time.
Availability refers to the fraction of time/percentage that our service is functional and accessible to users
Uptime: time that our system is functional and accessible
Downtime: time that our system is unavailable
Availability % = Uptime/(Total Uptime + Downtime) = MTBF/(MTBF+MTTR)
MTBF (Mean Time Between Failures) represents the average time the system is operational
MTTR (Mean Time to Recovery) represents the average time the system takes to detect and recover from a failure (average downtime)
MTBF/(MTBF+MTTR)
formula shows that fast detection and recover can help us achieve high availability
Availability Industry standards set by cloud vendors is generally anywhere between 99% to 99.9%
What errors prevent us from having high availability
Fault Tolerance means our system can remain operational and available to the users despite failures within one or multiple of its components.
Fault Tolerance Tactics:
SLA (Service Level Agreement)
SLO (Service Level Objective)
SLI (Service Level Indicator)
To define an SLO we should think about the metrics that users care about the most then find the right SLI to track those SLOs and try that our SLA does not contain too many SLOs, with many SLO it's hard to prioritize and set realistic goals when designing our SW architecture, finally create recovery plan for when we fail to meet our SLOs
The representation of each resource state can be expressed in different ways (JSON, html page, an image, a video stream, etc.)
REST API best practices
The REST API limits the number of methods to predefined CRUD operations which are usually mapped to HTTP methods:
The fundamental building block of async software
Usually used inside our system
Implementation uses a queue to store messages between senders and receivers
Used to route messages to appropiate modules
Can be used to validate messages
User sends message to front end which returns success if request was added correctly to queue (message broker) later on when backend receives the message and fully complete the request it can send a confirmation message that will be delivered to user
The message broker can serve multiple services or modules subscribed to the queue
A Message Broker provides:
Message Broker examples: RabbitMQ, Apache Kafka, Amazon Simple Queue Service (SQS), Microsoft Azure (Service Bus, Event Hubs, Event Grid)
If you find the information in this page useful and want to show your support, you can make a donation
Use PayPal
This will help me create more stuff and fix the existent content...