Software Architecture
Software Architecture
Constraint is the condition that the system must satisfy while delivering
its functionality (What is allowed and what is not allowed?)
3. Constraints : Design decision with “Zero” Accept the design decision and reconcile with
degrees of freedom (static). other decisions.
1. Source of stimulus. This is some entity (a human, a computer system, or any other
actuator) that generated the stimulus.
2. Stimulus. The stimulus is a condition that requires a response when it arrives at a
system.
3. Environment. The stimulus occurs under certain conditions. The system may be in
an overload condition or in normal operation, or some other relevant state.
4. Artifact. Product produced during development. Some artifact is stimulated. This
may be a collection of systems, the whole system, or some piece or pieces of it.
5. Response. The response is the activity undertaken as the result of the arrival of the
stimulus.
6. Response measure. When the response occurs, it should be measurable in some
fashion so that the requirement can be tested.
1. Allocation of responsibilities
2. Coordination model
3. Data model
4. Management of resources
5. Mapping among architectural elements
6. Binding time decisions
7. Choice of technology
1. Allocation of responsibilities
• Identifying the important responsibilities, including basic system functions, architectural infrastructure, and
satisfaction of quality attributes.
• Determining how these responsibilities are allocated to non-runtime and runtime elements (namely,
modules, components, and connectors).
2. Coordination model
• Identifying the elements of the system that must coordinate, or are prohibited from coordinating.
• Determining the properties of the coordination, such as timeliness, currency, completeness,
correctness, and consistency.
• Choosing the communication mechanisms (stateful versus stateless, synchronous versus asynchronous,
guaranteed versus nonguaranteed delivery, and performance-related properties such as throughput and
latency).
3. Data model
• Choosing the major data abstractions, their operations, and their properties. (Determining how the data
items are created, initialized, accessed, persisted, manipulated, translated, and destroyed ).
• Compiling metadata needed for consistent interpretation of the data.
• Organizing the data (data is going to be kept in a relational database, a collection of objects, or both)
CONFIDENTIAL - RESTRICTED CIRCULATION 11
Design Decisions
4. Management of resources
• These include hard resources (e.g., CPU, memory, battery, hardware buffers, system clock, I/O
ports) and soft resources (e.g., system locks, software buffers, thread pools, and non-thread-safe
code).
5. Mapping among architectural elements
• Two types of mappings.
• Mapping between elements in different types of architecture structures (for example, mapping from
units of development (modules) to units of execution (threads or processes).
• Mapping between software elements and environment elements (for example, mapping from
processes to the specific CPUs where these processes will execute).
6. Binding time decisions
• Binding time decisions introduce allowable ranges of variation (For resource management, you can
design a system to accept new peripheral devices plugged in at runtime)
7. Choice of technology
• Example : Determining whether the available tools to support this technology choice (IDEs,
simulators, testing tools, etc.) are adequate for development to proceed
In software world, it is about what will make your system fail, how likely that is to occur (the
probability), and that there will be some time required to repair it.
2.Software Upgrade:
Periodic upgrade of software from patching prevents
known vulnerability.
3.Predictive Model:
A predictive model, when combined with a monitor,
is employed to monitor the state of health of a
system process to ensure that the system is
operating within its nominal operating parameters
(Ex : Monitoring software can predict the processor
capacity of 80 % threshold well in advance for up
gradation).
CONFIDENTIAL - RESTRICTED CIRCULATION 22
Design Check list for Availability
SL # Category Checklist
1 Allocation of Ensure that there are responsibilities to do the following:
Responsibilities ❑ Log the fault
❑ Notify appropriate entities (people or systems)
❑ Disable the source of events causing the fault
❑ Be temporarily unavailable
❑ Fix or mask the fault/failure
❑ Operate in a degraded mode
2 Coordination Model ❑ Ensure that coordination mechanisms can detect an
omission, crash, incorrect timing, or incorrect response
❑ Ensure that coordination mechanisms enable the logging
of the fault, notification of appropriate entities, disabling of
the source of the events causing the fault.
❑ Ensure that the coordination model supports the
replacement of the artifacts used (Does replacement of a
server allow the system to continue to operate?)
Look at an example of an End user – Down Loading an application – Runtime (executing it ) – Using the
application productively – Takes 4 minutes to become productive – The Usability Scenarios could be
understood)
2 Coordination Model ❑ Check if the system needs to respond to : User action Ex.,
can the system respond to mouse events and give
semantic feedback in real time?
❑ Can long running events be cancelled?
3 Data Model ❑ Determine the major data abstractions that are involved
with user-perceivable behaviour. For example, the data
abstractions should be designed to support undo and
cancel operations: the transaction granularity should not
be so great that cancelling or undoing an operation takes
an excessively long time.
5 Resource ❑ Determine how the user can adapt and configure the
Management system’s use of resources. Ensure that resource
limitations under all user-controlled configurations will not
make users less likely to achieve their tasks. For example,
attempt to avoid configurations that would result in
excessively long response times.
SL # Category Checklist
7 Choice of ❑ Ensure the chosen technologies help to achieve the
Technology usability scenarios that apply to your system. For example,
do these technologies aid in the creation of online help,
the production of training materials, and the collection of
user feedback?
It’s about time and the software system’s ability to meet timing requirements.
Throughput and Response time are the two terms associated with Performance.
Throughput refers to the number of transactions per second.
Response time refers to the time taken for completing a task.
Latency : The time between the arrival of the stimulus and the system’s response to it.
Throughput : The number of transactions the system can process in a unit of time.
The jitter of the response : The allowable variation in latency.
The number of events not processed because the system was too busy to respond
CONFIDENTIAL - RESTRICTED CIRCULATION 36
Latency
Request Response
Time
Latency
Throughput = # of requests
Request processed in unit time
Time
Response
1 second
Latency
Jitter
Request
CONFIDENTIAL - RESTRICTED CIRCULATION 40
‘General Scenario’ for Performance
One way to increase the performance of the system is by reducing the number of
events processed by enforcing a sampling rate, or by limiting the rate at which the
system responds to events.
CONFIDENTIAL - RESTRICTED CIRCULATION 43
Understanding Performance related Tactics
Control Resource Manage Resources
1 Managing
Demand
In Signal Processing 1 Increase Resource Faster Processor:
Sampling Rate Systems Additional processor &
memories: SAN, Fiber
2 Limiting Event Discrete events can’t be Optic networks
Response sampled- Achieved
through queue size 2 Introduce Parallel processing of
concurrency events in different
threads- schedule
3 Prioritizing Events High, Medium & Low
policies
4 Reducing Collocating 3 Multiple copies of To reduce Contention
Overload coordinating elements computation (conflict) – multiple
in the same processor servers in client Server
to avoid latency- pattern – load balancers
eliminate all
intermediaries - 4 Maintain Multiple Caching – local disk-
Reinitialize hash tables copies of data SAN- DR Center
& virtual memory maps
5 Bound Queue size Controlling the
5 Bound Execution Limit execution time maximum # of queue
Times used to respond to arrivals
events
6 Increase resource Improving algorithms 6 Schedule Schedule based on
efficiency used in critical areas Resources FIFO the resources
will decrease latency Processor, RAM ,
memories in case of
CONFIDENTIAL - RESTRICTED CIRCULATION conflict 44
Performance Tactics
Cause Tactic
Approaches
• Round robin
• Based on txn load
Maintain multiple copies of data. This reduces contention. However we need to keep them
synchronized
Before After
Poor response due to large data and Replicated data enables load
high volume txns balancing
CONFIDENTIAL - RESTRICTED CIRCULATION 47
Example
Example
❑ Supports the delivery of over 100 million videos per day.
Google
Data
centers
SL # Category Checklist
5 Resource ❑ Determine which resources in your system are critical for
Management performance. For example
❑ System elements that need to be aware of, and manage,
time and other performance-critical resources
❑ Process/thread models
❑ Prioritization of resources and access to resources
❑ Scheduling and locking strategies
❑ Deploying additional resources on demand to meet
increased loads
SL # Category Checklist
7 Choice of ❑ Does your choice of technology give you the ability to set
Technology the following:
❑ Scheduling policy
❑ Priorities
❑ Policies for reducing demand
❑ Allocation of portions of the technology to processors
❑ Does your choice of technology introduce excessive
overhead for heavily used operations?
Software testability refers to the ease with which software can be made to demonstrate
its faults through testing. Specifically, testability refers to the probability, assuming that
the software has at least one fault, that it will fail on its next test execution.
A Model for Testing : Oracle is an agent that helps in deciding whether output is correct or not.
CONFIDENTIAL - RESTRICTED CIRCULATION 56
‘General Scenario’ for Testability
1.Source of stimulus. Unit testers, integration testers, system testers, acceptance testers, end
users, either running tests manually or using automated testing tools
2. Stimulus. A set of tests is executed due to the completion of a coding increment such as a class
layer or service, the completed integration of a subsystem, the complete implementation of the whole
system, or the delivery of the system to the customer.
3. Environment. Design time, development time, compile time, integration time, deployment time,
run time
5. Response. One or more of the following: execute test suite and capture results, capture activity that
resulted in the fault, control and monitor the state of the system
6. Response measure. Effort to find a fault, effort to achieve a given percentage of coverage,
probability of fault being revealed by the next test, time to perform tests, effort to detect faults, length of
time to prepare test environment, reduction in risk exposure (size(loss) × prob (loss))
CONFIDENTIAL - RESTRICTED CIRCULATION 57
Testability Tactics
A common form of sandboxing is to virtualize resources. Using a sandbox, you can build a
version of the resource whose behaviour is under your control. Non-deterministic systems are
hard to test as they correspond to unpredictable events.
CONFIDENTIAL - RESTRICTED CIRCULATION 58
Testability Issues and Tactics
Issue Tactic
We need to test during every release Automated testing
SL # Category Checklist
5 Resource ❑ Ensure there are sufficient resources available to execute a test
Management suite and capture the results.
❑ Ensure that your test environment is representative of the
environment in which the system will run.
❑ Ensure that the system provides the means to do the following:
❑ Test resource limits
❑ Capture detailed resource usage for analysis in the event of
a failure
❑ Inject new resource limits into the system for the purposes
of testing
❑ Provide virtualized resources for testing
6 Binding Time ❑ Ensure that components that are bound later than compile
time can be tested in the late-bound context
❑ Ensure that the full range of binding possibilities can be
tested
SL # Category Checklist
Interoperability is about the degree to which two or more systems can usefully exchange
meaningful information via interfaces in a particular context. Not only having the ability to
exchange data (syntactic interoperability) but also having the ability to correctly interpret
the data being exchanged (semantic interoperability).
There are 5 levels of interoperability : Lowest being systems that do not share data at all
and highest level indicates systems that work together seamlessly.
Orchestrate : Managing sequence of invocations . Ex: Work flow engine in ERP : Tailor Interface
refers to add / remove capabilities to interface Ex: Hiding particular function from untrusted user:
Locate and Discover services : Google Map integration on the go.
Service providers
SOAP request
Routes
messages and
provides other
features
Services
running on
different
servers
JSON – JavaScript
Object Notation
SL # Category Checklist
5 Resource ❑ Ensure that interoperation with another system (accepting
Management a request and/or rejecting a request) can never exhaust
critical system resources
❑ Ensure that the resource load imposed by the
communication requirements of interoperation is
acceptable.
❑ Ensure that if interoperation requires that resources be
shared among the participating systems, an adequate
arbitration policy is in place
6 Binding Time ❑ Ensure that it has a policy for dealing with binding to both
known and unknown external systems.
❑ Ensure that it has mechanisms in place to reject
unacceptable bindings and to log such requests
SL # Category Checklist
Process air
pressure data
Complex weather
forecasting module Weather
forecasting - Process
Master module Humidity data
Process
Temperature
data
Order
Fund xfer
processing
module
module
Data access
Interface to SBI layer
bank
via internet
Oracle
SBI system External DBMS
system
CONFIDENTIAL - RESTRICTED CIRCULATION 81
Protect system from variations
Changes in business rules Income Tax rules, Pricing rules in Rules engine (Deployment time)
airline change frequently
Change in business process Need one more approval Work flow engine, Configuration
files (Deployment time)
Changes in module interface Need to interface with a different Adaptor pattern (Build time)
SMS service provider
Book ticket
(Pax name, profession,
Booking Reservat
age, Flt#, date, etc.)
module ion DB
Web
server Determine ticket price
(profession, age, Flt#, date, etc)
Rules DB
• Security Controls are evaluated on how well they address these 3 tenets (belief)
• Vulnerabilities & Risks are assessed Based on the threats they pose against CIA
85
Confidentiality: The measure used to ensure the
protection of Secrecy of data, objects or resources
Goal To prevent or minimize unauthorized access to data
Security ❑ Access Control
Measures ❑ Data Classification
❑ Encryption
❑ Steganography
❑ Network Traffic Padding
❑ Training
87
Technology Controls for Maintaining Integrity
✔ Restrict Access to data & ✔ Rigorous authentication process
Objects
Attacks on Integrity
✔ Virus attacks ✔ Logic Bombs
✔ Unauthorized access ✔ Errors in coding & application
✔ Malicious modification ✔ Intentional Replacement
✔ System backdoors ✔ Trojan Horse
88
Availability: It refers to the ability of the system to grant data
access to authorized objects timely and uninterrupted. It
means that efficient, uninterrupted access to objects &
prevention of Denial of Service (DoS)
Technology Controls for improving availability
⮚ Elimination of Single Point of Failure ⮚ Acceptable level of performance
(SPOF)
⮚ SLA’s for correction of interruption ⮚ Build redundancy
⮚ Reliable back-up & restore ⮚ Prevent data loss/ destruction
⮚ Design effective intermediary delivery ⮚ Effectively using access control
system
⮚ Monitoring performance & Network Traffic ⮚ Defense-in depth mechanism
Threats to Availability
⮚ Device Failure ⮚ Software Errors
⮚ Environmental Issues (heat, flooding, ⮚ DoS attacks
power loss)
⮚ Object Destruction ⮚ Communication interruption
89
Primary Goals of Security : IAAAA
The Second Principle
DAC - Discretionary Access Control : MAC - Mandatory Access Control : RBAC - Role Based Access Control
90
Security Tactics
Issue Tactic
A hacker may gain access to confidential data such as credit Encrypt data in DB
card number, password stored in DB
Firewall
Malicious people may create websites that look like original Digital certificate
websites to gather your user id & password
The requirement consisted of functional requirements such as application for license, recording
results of test, etc. and a few reports.
As the project entered the design stage, new requirements started coming in. These consisted of
many more reports. They also said that they may require more reports in the future.
A module for generating ad-hoc reports which can generate a report based on specification
provided by the user, can address most of the reports. Some examples of report generation
tools are Ubiq, Zoho Analytics, BIRT, etc.
An airline is building a comprehensive flight information & reservation system. It has several
modules such as Flight planning, Flight schedules, Pricing, Reservations, Departure control,
Analytics, etc.
As the airline industry is very competitive, the airline foresees many new requirements such
as Loyalty card, etc. to come up in the future. The new modules to be built in the future would
most probably be dependent on existing modules. For example, the Loyalty module will have
to calculate Loyalty points based on flights undertaken by the customer, which is an output of
Departure control module.
Since new modules would require information from other modules, it is good idea to have a
common database which can be accessed by all modules. If information is needed in real-
time, one can adopt a Publish-Subscribe approach where all important events taking place in
different modules are identified and published to interested subscribing modules
YouTube Performance
OnlineSBI.com Security
Uber Usability