CIT421 NET-CENTRIC COMPUTING SUMMARY copy
CIT421 NET-CENTRIC COMPUTING SUMMARY copy
CIT421 NET-CENTRIC COMPUTING SUMMARY copy
https://api.whatsapp.com/send?phone=23409032650760
TEL:09032650760,07064298170
Email:[email protected]
MOTTO :Embracing Education
1
introduces new challenges, especially in the management of virtual environments, whether they are abstractions of
virtual hardware or a runtime environment
Mobile Software
• Mobile software is the actual program that runs on the mobile hardware
• It deals with the characteristics and requirements of mobile applications
• This is the engine of the mobile device
• It is the operating system of the appliance
Its the essential component that operates the mobile device
• With PDA devices, a user can browse the internet, listen to audio clips, watch video clips, edit and modify
office documents, and many more services
• The device has a stylus and a touch sensitive screen for input and output purposes
Smartphones
It combines the features of a PDA with that of a mobile phone or camera phone
It has a superior edge over other kinds of mobile phones.
Smartphones have the capability to run multiple programs concurrently
These phones include high-resolution touch screens, web browsers that can:
access and properly display standard web pages rather than just mobile-optimized sites
high-speed data access via Wi-Fi and high speed cellular broadband.
2
The most common mobile Operating Systems (OS) used by modern smartphones include:
a. Google's Android
b. Apple's iOS
c. Nokia's Symbian
d. RIM's BlackBerry OS
e. Samsung's Bada
f. Microsoft's Windows Phone, and embedded Linux distributions such as Maemo and MeeGo. Such
operating systems can be installed on different phone models, and typically each device can receive multiple OS
software updates over its lifetime.
Advantages
• Location Flexibility
• This has enabled users to work from anywhere as long as there is a connection established
• A user can work without being in a fixed position
• Their mobility ensures that they are able to carry out numerous tasks at the same time and perform their
stated jobs.
• Saves Time
• The time consumed or wasted while travelling from different locations or to the office and back, has been
slashed
• One can now access all the important documents and files over a secure channel or portal and work as if
they were on their computer
• It has enhanced telecommuting in many companies
• It has also reduced unnecessary incurred expenses
• Enhanced Productivity
• Users can work efficiently and effectively from whichever location they find comfortable
• This in turn enhances their productivity level
• Ease of Research
• Research has been made easier, since users earlier were required to go to the field and search for facts and
feed them back into the system
• It has also made it easier for field officers and researchers to collect and feed data from wherever they are
without making unnecessary trips to and from the office to the field
• Entertainment
• Video and audio recordings can now be streamed on-the-go using mobile computing
• It's easy to access a wide variety of movies, educational and informative material
• With the improvement and availability of high speed data connections at considerable cost, one is able to
get all the entertainment they want as they browse the internet for streamed data
Streamlining of Business Processes
3
• Business processes are now easily available through secured connections
• Looking into security issues, adequate measures have been put in place to ensure authentication and
authorization of the user accessing the services
• Some business functions can be run over secure links and sharing of information between business
partners can also take place
Security Issues
• Mobile computing has its fair share of security concerns as any other technology
• Due to its nomadic nature, it's not easy to monitor the proper usage
• Users might have different intentions on how to utilize this privilege
• Improper and unethical practices such as hacking, industrial espionage, pirating, online fraud and
malicious destruction are some but few of the problems experienced by mobile computing
• Another big problem plaguing mobile computing is credential verification
• As other users share username and passwords, it poses as a major threat to security
• This being a very sensitive issue, most companies are very reluctant to implement mobile computing to
the dangers of misrepresentation
• The problem of identity theft is very difficult to contain or eradicate
Current Trends
• These are the list of the current mobile technologies starting from 5G technologies which is the hottest
mobile technology available in the market.
• 5G
• In telecommunications, 5G is the fifth generation technology standard for broadband cellular networks,
which cellular phone companies began deploying worldwide in 2019, and is the planned successor to the 4G
networks which provide connectivity to most current cellphones. 5G networks are predicted to have more than 1.7
billion subscribers worldwide by 2025, according to the GSM Association.[1] Like its predecessors, 5G networks
are cellular networks, in which the service area is divided into small geographical areas called cells.
• 4G
• 4G is the fourth generation of broadband cellular network technology, succeeding 3G, and preceding 5G.
A 4G system must provide capabilities defined by ITU in IMT Advanced. Potential and current applications include
amended mobile web access, IP telephony, gaming services, high-definition mobile TV, video conferencing, and 3D
television.
• The first-release WIMAX standard was commercially deployed in South Korea in 2006 and has since
been deployed in most parts of the world.
• 3G or third generation
• 3G mobile telecommunications is a generation of standards for mobile phones and mobile
telecommunication services fulfilling the International Mobile Telecommunications-2000 (IMT-2000) specifications
by the International Telecommunication Union. Application services include wide-area wireless voice telephone,
mobile Internet access, video calls and mobile TV, all in a mobile environment.
• WiMAX
4
• WiMAX (Worldwide Interoperability for Microwave Access) is a wireless communications standard
designed to provide 30 to 40 megabit-per-second data rates, with the latest update providing up to 1 Gbit/s for fixed
stations
• It is a part of a fourth generation or 4G wireless-communication technology
• WiMAX far surpasses the 30-metre wireless range of a conventional Wi-Fi Local Area Network (LAN),
offering a metropolitan area network with a signal radius of about 50 km
1. Access control If threat actors cannot access your network, the amount of damage they will be able to do will be
extremely limited. But in addition to preventing unauthorized access, be aware that even authorized users can also
be potential threats.
2. Anti-malware software Malware, in the form of viruses, trojans, worms, keyloggers, spyware, etc. are designed
to spread through computer systems and infect networks. Anti-malware tools are a kind of network security software
designed to identify dangerous programs and prevent them from spreading.
3. Anomaly detection It can be difficult to identify anomalies in your network without a baseline understanding of
how that network should be operating.
5
4. Application security For many attackers, applications are a defensive vulnerability that can be exploited.
Application security helps establish security parameters for any applications that may be relevant to your network
security.
5. Data loss prevention (DLP) Often, the weakest link in network security is the human element. DLP technologies
and policies help protect staff and other users from misusing and possibly compromising sensitive data or allowing
said data out of the network.
6. Email security As with DLP, email security is focused on shoring up human-related security weaknesses. Via
phishing strategies (which are often very complex and convincing), attackers persuade email recipients to share
sensitive information via desktop or mobile device, or inadvertently download malware into the targeted network.
7. Endpoint security The business world is becoming increasingly bring your own device (BYOD), to the point
where the distinction between personal and business computer devices is almost non-existent.
8. Firewalls Firewalls function much like gates that can be used to secure the borders between your network and the
internet. Firewalls are used to manage network traffic, allowing authorized traffic through while blocking access to
non-authorized traffic.
9. Intrusion prevention systems Intrusion prevention systems (also called intrusion detection) constantly scan and
analyze network traffic/packets, so that different types of attacks can be identified and responded to quickly.
10. Network segmentation There are many kinds of network traffic, each associated with different security risks.
Network segmentation allows you to grant the right access to the right traffic, while restricting traffic from
suspicious sources.
11. Security information and event management (SIEM) Sometimes simply pulling together the right
information from so many different tools and resources can be prohibitively difficult — particularly when time is an
issue.
12. Virtual private network (VPN) VPN tools are used to authenticate communication between secure networks
and an endpoint device.
13. Web security Including tools, hardware, policies and more, web security is a blanket term to describe the
network security measures businesses take to ensure safe web use when connected to an internal network.
14. Wireless security Generally speaking, wireless networks are less secure than traditional networks. Thus, strict
wireless security measures are necessary to ensure that threat actors aren’t gaining access.
6
Characteristics of Client Server Computing
The salient points for client server computing are as follows:
The client server computing works with a system of request and response. The client sends a request to
the server and the server responds with the desired information.
The client and server should follow a common communication protocol so they can easily interact with
each other. All the communication protocols are available at the application layer.
A server can only accommodate a limited number of client requests at a time. So it uses a system based
to priority to respond to the requests.
Denial of Service (DoS) attacks hindera servers’ ability to respond to authentic client requests by
inundating it with false requests.
An example of a client server computing system is a web server. It returns the web pages to the clients
that requested them.
Q What are the differences Between Client Server and Peer to Peer computing?
Answer:
The major differences between client server computing and peer to peer computing are as follows:
In client server computing, a server is a central node that services many client nodes. On the other hand, in a peer
to peer system, the nodes collectively use their resources and communicate with each other.
In client server computing the server is the one that communicates with the other nodes. In peer to peer to
computing, all the nodes are equal and share data with each other directly.
Client Server computing is believed to be a subcategory of the peer to peer computing.
7
Answer:
Web app
An interactive computer program, built with web technologies (HTML, CSS, JS), which stores (Database, Files) and
manipulates data (CRUD), and is used by a team or single user to perform tasks over the internet.
If you do not have any experience with the points above, you need not worry. You have two options:
1. Learn the points above - there are lots of resources online to help you. I’d recommend Codecademy .
2. Use a web app builder like Budibase - As a builder, Budibase will remove the need to learn a backend
language. On top of that, Budibase will also take care of a lot of your DevOps tasks such as hosting.
The number 1 reason start-ups fail, is the failure to achieve product-market fit.
“Product/market fit means being in a good market with a product that can satisfy that market.”
To quickly find out if a similar web app exists, use the following tools to search for your idea:
1. Google
2. Patent and trademark search
3. Betalist
4. Product hunt
For direction, I have included a list of basic functions required for a simple CRM app.
8
Users can create an account
Users can retrieve lost passwords
Users can change their passwords
Users can create new contacts
9
3. Spend time learning your tools.
o You may feel like you are wasting your time, reading, or experimenting with “hello world”. Learning the correct
way to do things will have a huge positive, cumulative effect on your productivity over time.
o Where possible, “Go with the grain” of your tools. Realise that as soon as you step out of the normal flow
/ usage of your toolset, you are on your own and could be in a deep time sink. There are always exceptions to this of
course!
4. Do not avoid issues that need to be fixed.
o Face your issues head on - they will never go away and will only grow in stature.
Q What is a Database
Answer:
Database
A database is simply a collection of data! Data can be stored to disk, or in memory on a server, or both. You could
create a folder on your hard drive, store a few documents, and call it a database.
A Database Management System (DBMS) is a system that provides you with consistent APIs to (most commonly):
Create databases, update and delete databases
Read and write data to databases
Secure access to a database by providing levelled access to different areas and functions
Database types
There are many types of database for many different purposes. A web app will most commonly use one of the
following:
a. SQL
You should use a SQL database if your data is very relational. Your data is relational if you have multiple, well
defined record types that have relationships between them.
b. Document Database
You should use a document database if your data is not very relational. Document databases store “documents”.
Each record in your database is simply a big blob of structured data - often in JSON format.
Physical separation
Every one of your clients has a separate database (although could share a database server with others). This makes it
much more difficult to make a mistake that leads to data leakage.
Pros:
Most secure
More scalable
Cons:
Managing, maintaining and upgrading is more complex
Query all your clients’ data together is more difficult
Logical separation
All of your clients are stored in one giant database.
Every time you need to get data for a single client, you must remember to include a filter for the client. E.g. ‘select’
from customers where customerClientId = 1234”
Pros:
Easier to get started
Easier to maintain and upgrade
Can easily query all your clients’ data with one query
Cons:
Easy to make a mistake that will result in a data breach
10
More difficult to scale
3. A frontend framework (strictly not necessary, but highly advised unless you are an experienced frontend
developer):
1. React
2. Ember
3. Vue
4. Svelte
4. Configuring your packaging tool to talk to your backend - which is most likely running on a different port on
localhost.
“But isn’t this the frontend?” - I hear you say. Yes! But your choice will affect how you develop your backend.
The primary jobs of the backend will be to:
Provide HTTP endpoints for your frontend, which allow it to operate on your data. E.g. Create, Read,
Update and Delete (“CRUD”) records.
Authenticate users (verify they are who they say they are: aka log them in).
Authorization. When a logged in user makes a request, the backend will determine whether they are
allowed (authorized) to perform the requested action.
Serve the frontend
Step 11 - Host your web application
What is hosting
Hosting involves running your web app on a particular server.
When using Budibase, this step can be automated with Budibase hosting . With Budibase, you are still required to
buy a domain.
If you are not using Budibase to host your web application, follow these quick steps: \
1. Buy a domain - Namecheap
2. Buy/Setup an SSL certificate - Let’s Encrypt
3. Choose a cloud provider:
1. Amazon
2. MS Azure
3. Google Cloud Platform
4. Lower cost: Digital Ocean / Linode - if you are happy managing your own VMs
5. Zeit Now, Heroku, Firebase are interesting alternatives that aim to be faster and easier to get things done
- you should read about what they offer.
11
Step 12 - Deploy your web app
You have sourced your idea, validated it, designed and developed your web app, and chosen your hosting provider.
You’re now at the last step. Well done!
The deployment step includes is how your web application gets from your source control on your computer to your
cloud hosting from step 11.
Q What is firewall?
Answers:
A firewall forms a barrier through which the traffic going in each direction must pass. A firewall security policy
dictates which traffic is authorized to pass in each direction.
A new type of server can be added to the network, with its own firewall, without the necessity of altering
the network firewall configuration.
Mainstream parallel programming environments are based on augmenting traditional sequential programming
languages with low-level parallel constructs (library function calls and/or compiler directives).
12
MPI
The MPI is a library of routines with the bindings in Fortran, C, and C++ and it is an example of an explicitly
parallel API that implements the message-passing model via library function calls.
OpenMP
On the other side, OpenMP is an example of mainly implicit parallel API intended for shared-memory
multiprocessors. It exploits parallelism through compiler directives and the library function calls.
OpenCL
OpenCL has some advantages over other parallel programming models. First of all, it is the only one of the “open”
standards for which there actually are implementations by all major vendors—unlike for OpenMP or OpenACC.
Single-Program-Multiple-Data (SPMD )
Message-passing paradigm involves a set of sequential programs, one for each processor. In reality, it is rare for a
parallel programmer to make full use of this generality and to write a different executable for each processor.
Dependency analysis
When examining an artifact for re-use you might want to understand what it depends on. Developing a service that
has a dependency on a large number of other distinct systems is likely to result in something that has to be
revalidated every time each of those dependencies changes (which might therefore be quite often).
To undertake a typical dependency analysis, perform the following steps:
1. Identify the artefact with dependencies you want to analyze.
2. Trace through any relationships defined on that artefact and identify the targets of the relationships. This
impact analysis thus results in a list of "dependencies" that the selected artefact depends on.
3. If these "dependencies" also depend on other artefacts, then the selected artefact will also have an
indirect dependency. The impact analysis must therefore act recursively looking for relationships from any of the
13
"dependencies".
Thread
A process is an instance of a computer program that is being executed. It contains the program code and its current
activity. A thread of execution is the smallest unit of processing that can be scheduled by an operating system.
Thread model is an extension of the process model.
A Process
A process contains all the information needed to execute the program.
Process ID
Program code
Data on run time stack
Global data
Data on heap
Each process has its own address space. In multitasking, processes are given time slices in a round robin fashion. If
computer resources are assigned to another process, the status of the present process has to be saved, in order that
the execution of the suspended process can be resumed at a later time.
14
Shared memory, thread-based parallelism. OpenMP is based on the existence of multiple threads in the shared
memory programming paradigm. A shared memory process consists of multiple threads.
Explicit Parallelism In Explicit Parallelism, a Programmer has full control over parallelization. OpenMP is not an
automatic parallel programming model.
Compiler Directive Based Most OpenMP parallelism is specified through the use of compiler directives which are
embedded in the source code.
OpenMP is not necessarily implemented identically by all vendors. Meant for distributed-memory parallel systems
(it is designed for shared address spaced machines). Guaranteed to make the most efficient use of shared memory.
Fork-Join Parallelism.
OpenMP program begin as a single process: the master thread. The master thread executes sequentially until the first
parallel region construct is encountered.
JOIN
When the threads complete executing the statement in the parallel region construct, they synchronize and terminate,
leaving only the master thread
A “Pragma”
It stands for “pragmatic information”. A pragma is a way to communicate the information to the compiler. The
information is non-essential in the sense that the compiler may ignore the information and still produce correct
object program.
//OpenMP header
#include <omp.h> #pragma omp parallel
In OpenMP, we need to mention the region which we are going to make it as parallel using the keyword pragma
omp parallel. The pragma omp parallel is used to fork additional threads to carry out the work enclosed in the
parallel.
#pragma omp parallel
{
//Parallel region code
}
So, here we include
#pragma omp parallel
{
printf("Hello World... from thread = %d\n",
omp_get_thread_num());
}
3. Set the number of threads: we can set the number of threads to execute the program using the external variable.
export OMP_NUM_THREADS=5
Compile:
gcc -o hello -fopenmp hello.c
15
4.2 Execute:
./hello
Below is the complete program with the output of the above approach: Program: Since we specified the number of
threads to be executed as 5, 5 threads will execute the same print statement at the same point of time.
Satisfy ethical responsibility to clients to demonstrate positive and negative effects of program participation (Short,
Hennessy, & Campbell, 1996).
Barriers
Program evaluations require funding, time and technical skills: requirements that are often perceived as diverting
limited program resources from clients. Program staff are often concerned that evaluation activities will inhibit
timely accessibility to services or compromise the safety of clients.
Overcoming Barriers
Collaboration is the key to successful program evaluation. In evaluation terminology, stakeholders are defined as
entities or individuals that are affected by the program and its evaluation (Rossi & Freeman, 1993; CDC, 1999).
Involvement of these stakeholders is an integral part of program evaluation. Stakeholders include but are not limited
to program staff, program clients, decision makers, and evaluators.
Types of Evaluation
Context Evaluation
Investigating how the program operates or will operate in a particular social, political, physical and economic
environment.
Formative Evaluation
Assessing needs that a new program should fulfill (Short, Hennessy, & Campbell, 1996), examining the early stages
of a program's development (Rossi & Freeman, 1993), or testing a program on a small scale before broad
dissemination (Coyle, Boruch, & Turner, 1991).
Process Evaluation
Examining the implementation and operation of program components. Sample question: Was the program
administered as planned?
Impact Evaluation
Investigating the magnitude of both positive and negative changes produced by a program (Rossi & Freeman, 1993).
16
Outcome Evaluation
Assessing the short and long-term results of a program. Sample question: What are the long-term positive effects of
program participation?
Logic Models
Logic models are flowcharts that depict program components. These models can include any number of program
elements, showing the development of a program from theory to activities and outcomes.
Threads Model
In this model a single process can have multiple, concurrent execution paths. The main program is scheduled to run
by the native operating system. It loads and acquires all the necessary softwares and user resources to activate the
process.
Hybrid model
The hybrid models are generally tailor-made models suiting to specific applications. Actually, these fall in the
category of mixed models. Such type of application-oriented models keep cropping up.
17
Computer Forensics is a scientific method of investigation and analysis in order to gather evidence from the digital
devices or computer networks and components which is suitable for presentation in a court of law or legal body.
Digital Forensics is defined as the process of preservation, identification, extraction, and documentation of computer
evidence which can be used by the court of law. It is a science of finding evidence from digital media like a
computer, mobile phone, server, or network.
Distributed Systems
A distributed system is a computing environment in which various components are spread across multiple computers
(or other computing devices) on a network. These devices split up the work, coordinating their efforts to complete
the job more efficiently than if a single device had been responsible for the task.
Different combinations of patterns are used to design distributed systems, and each approach has unique benefits and
drawbacks.
18
• Reliability: A well-designed distributed system can withstand failures in one or more of its nodes without
severely impacting performance. In a monolithic system, the entire application goes down if the server goes down.
• Enhanced speed: Heavy traffic can bog down single servers when traffic gets heavy, impacting
performance for everyone.
• Geo-distribution: Distributed content delivery is both intuitive for any internet user, and vital for global
organizations
Imperfect scalability:
• Doubling the number of nodes in a distributed system does not necessarily double performance
• Architecting an effective distributed system that maximizes scalability is a complex undertaking that
needs to take into account load balancing, bandwidth management and other issues.
Cost control:
Unlike centralized systems, the scalability of distributed systems allows administrators to easily add additional
capacity as needed, which can also increase costs.
19
• Pricing for cloud-based distributed computing systems are based on usage (such as the number of memory
resources and CPU power consumed over time)
• If demand suddenly spikes, organizations can face a massive bill.
20
• Distributed systems can offer features that would be difficult or impossible to develop on a single system
• if the Master Catalog does not see the segment bits it needs for a restore, it can ask the other off-site node
or nodes to send the segments
• Virtually everything you do now with a computing device takes advantage of the power of distributed
systems
• sending an email
• playing a game or
• reading this article on the web.
Distributed Tracing
Distributed tracing is a method for monitoring applications — typically those built on a micro-services architecture
— which are commonly deployed on distributed systems.
Distributed Objects
The distributed object paradigm
It provides abstractions beyond those of the message-passing model. In object-oriented programming, objects are
used to represent an entity significant to an application.
Each object encapsulates:
the state or data of the entity: in Java, such data is contained in the instance variables of each object;
the operations of the entity, through which the state of the entity can be accessed or updated.
21
Local Objects vs. Distributed Objects
Local objects are those whose methods can only be invoked by a local process, a process that runs on the same
computer on which the object exists.
A distributed object is one whose methods can be invoked by a remote process, a process running on a
computer connected via a network to the computer on which the object exists.
Distributed Objects
A distributed object is provided, or exported, by a process called the object server. A facility, here called an object
registry, must be present in the system architecture for the distributed object to be registered.
22
Trojan: These appear to be normal programs that have a legitimate function, like a game or a utility
program. But underneath the innocent looking user interface, a Trojan performs malicious tasks without the user
being aware.
Spyware: Spyware is software that gathers personal or confidential information from user systems
without their knowledge.
Keylogger: This is a special type of spyware. It is specialized in recording the keystrokes made by the
user.
Ransomware: Ransomware is a form of malware that encrypts a victim's files. The attacker then
demands a ransom from the victim to restore access to the data upon payment.
23
The Server-side Software
An object server is an object that provides the methods of and the interface to a distributed object.
Each object server must
implement each of the remote methods specified in the interface,
register an object which contains the implementation with a directory service.
It is recommended that the two parts be provided as separate classes.
24
import java.rmi.registry.LocateRegistry;
…
LocateRegistry.createRegistry ( 1099 );…
Alternatively, an RMI registry can be activated by hand using the rmiregistry utility :
rmiregistry <port number>
where the port number is a TCP port number.
If no port number is specified, port number 1099 is assumed.
25
A component diagram breaks down the actual system under development into various high levels of functionality.
Each component is responsible for one clear aim within the entire system and only interacts with other essential
elements on a need-to-know basis.
Interface
In the example below shows two type of component interfaces:
Provided Interface symbols with a complete circle at their end represent an interface that the component provides -
this "lollipop" symbol is shorthand for a realization relationship of an interface classifier.
Required Interface symbols with only a half circle at their end (a.k.a. sockets) represent an interface that the
component requires (in both cases, the interface's name is placed near the interface symbol itself).
Subsystems
The subsystem classifier is a specialized version of a component classifier. Because of this, the subsystem notation
element inherits all the same rules as the component notation element.
26
A Sub-system
Port
Ports are represented using a square along the edge of the system or a component. A port is often used to help
expose required and provided interfaces of a component.
A Port
Relationships
Graphically, a component diagram is a collection of vertices and arcs and commonly contain components, interfaces
and dependency, aggregation, constraint, generalization, association, and realization relationships. It may also
contain notes and constraints
27
For larger systems, use packages to show groups of source code files.
Consider exposing a tagged value indicating such information as the version
number of the source code file, its author, and the date it was last changed. Use tools to manage the value of this tag.
Model the compilation dependencies among these files using dependencies.
Again, use tools to help generate and manage these dependencies.
28
To visualize, specify, construct, and document your mapping, create a
component diagram that contains components stereotyped as tables.
Where possible, use tools to help you transform your logical design into a
physical design.
Distributed Transactions
A distributed transaction includes one or more statements that, individually or as a group, update data on two or
more distinct nodes of a distributed database.
You can execute DML and DDL statements in parallel, and INSERT direct load statements serially, but note the
following restrictions:
All remote operations must be SELECT statements.
These statements must not be clauses in another distributed transaction.
If the table referenced in the table_expression_clause of an INSERT, UPDATE,
or DELETE statement is remote, then execution is serial rather than parallel.
You cannot perform remote operations after issuing parallel DML/DDL or
direct load INSERT.
If the transaction begins using XA or OCI, it executes serially.
No loopback operations can be performed on the transaction originating the
parallel operation. For example, you cannot reference a remote object that is actually a synonym for a local object.
If you perform a distributed operation other than a SELECT in the transaction,
no DML is parallelized.
29
Transaction Control Statements
The following are the supported transaction control statements:
COMMIT
ROLLBACK
SAVEPOINT
Node Roles
Clients
A node acts as a client when it references information from a database on another node. The referenced node is a
database server. In Figure 2, the node sales is a client of the nodes that host the warehouse and finance databases.
Database Servers
A database server is a node that hosts a database from which a client requests data.
In Figure 2, an application at the sales node initiates a distributed transaction that accesses data from the warehouse
and finance nodes.
Local Coordinators
A node that must reference data on other nodes to complete its part in the distributed transaction is called a local
coordinator. In Figure 2, sales is a local coordinator because it coordinates the nodes it directly references:
warehouse and finance.
A local coordinator is responsible for coordinating the transaction among the nodes it communicates directly with by:
Receiving and relaying transaction status information to and from those nodes
30
Passing queries to those nodes
Receiving queries from those nodes and passing them on to other nodes
Returning the results of queries to the nodes that initiated them
Global Coordinator
The node where the distributed transaction originates is called the global coordinator. The database application
issuing the distributed transaction is directly connected to the node acting as the global coordinator.
The global coordinator performs the following operations during a distributed transaction:
Sends all of the distributed transaction SQL statements, remote procedure calls,
and so forth to the directly referenced nodes, thus forming the session tree
Instructs all directly referenced nodes other than the commit point site to
prepare the transaction
Instructs the commit point site to initiate the global commit of the transaction if
all nodes prepare successfully
Instructs all nodes to initiate a global rollback of the transaction if there is an
abort response
The commit point site is distinct from all other nodes involved in a distributed transaction in these ways:
The commit point site never enters the prepared state. Consequently, if the
commit point site stores the most critical data, this data never remains in-doubt, even if a failure occurs.
The commit point site commits before the other nodes involved in the
transaction. In effect, the outcome of a distributed transaction at the commit point site determines whether the
transaction at all nodes is committed or rolled back:
The following conditions apply when determining the commit point site:
A read-only node cannot be the commit point site.
If multiple nodes directly referenced by the global coordinator have the same
commit point strength, then the database designates one of these as the commit point site.
If a distributed transaction ends with a rollback, then the prepare and commit
phases are not needed.
31
In the prepare phase, the initiating node in the transaction asks the other participating nodes to promise to commit
or roll back the transaction.
During the commit phase, the initiating node asks all participating nodes to commit the transaction.
Prepare Phase
The first phase in committing a distributed transaction is the prepare phase. In this phase, the database does not
actually commit or roll back the transaction. Instead, all nodes referenced in a distributed transaction (except the
commit point site, described in the "Commit Point Site") are told to prepare to commit.
By preparing, a node:
Records information in the redo logs so that it can subsequently either commit
or roll back the transaction, regardless of intervening failures
Places a distributed lock on modified tables, which prevents reads
Read-Only Response
When a node is asked to prepare, and the SQL statements affecting the database do not change any data on the node,
the node responds with a read-only message. The message indicates that the node will not participate in the commit
phase
There are three cases in which all or part of a distributed transaction is read-only:
32
Steps in the Prepare Phase
To complete the prepare phase, each node excluding the commit point site performs the following steps:
1. The node requests that its descendants, that is, the nodes subsequently
referenced, prepare to commit.
2. The node checks to see whether the transaction changes data on itself or its
descendants. If there is no change to the data, then the node skips the remaining steps and returns a read-only
response
e 3. 3. The node allocates the resources it needs to commit the transaction if data is
changed.
4. The node saves redo records corresponding to changes made by the transaction
to its redo log.
5. The node guarantees that locks held for the transaction are able to survive a
failure.
6. The node responds to the initiating node with a prepared response or, if its
attempt or the attempt of one of its descendants to prepare was unsuccessful, with an abort response.
Commit Phase
The second phase in committing a distributed transaction is the commit phase. Before this phase occurs, all nodes
other than the commit point site referenced in the distributed transaction have guaranteed that they are prepared, that
is, they have the necessary resources to commit the transaction.
33
5. At each node, the database commits the local portion of the distributed
transaction and releases locks.
6. At each node, the database records an additional redo entry in the local redo log,
indicating that the transaction has committed.
7. The participating nodes notify the global coordinator that they have committed.
When the commit phase is complete, the data on all nodes of the distributed system is consistent.
Guaranteeing Global Database Consistency
Each committed transaction has an associated system change number (SCN) to uniquely identify the changes made
by the SQL statements within that transaction. The SCN functions as an internal timestamp that uniquely identifies a
committed version of the database.
In a distributed system, the SCNs of communicating nodes are coordinated when all of the following actions occur:
A connection occurs using the path described by one or more database links
A distributed SQL statement executes
A distributed transaction commits
In a distributed system, the SCNs of communicating nodes are coordinated when all of the following actions occur:
A connection occurs using the path described by one or more database links
A distributed SQL statement executes
A distributed transaction commits
Forget Phase
After the participating nodes notify the commit point site that they have committed, the commit point site can forget
about the transaction. The following steps occur:
1. After receiving notice from the global coordinator that all nodes have committed,
the commit point site erases status information about this transaction.
2. The commit point site informs the global coordinator that it has erased the status
information.
3. The global coordinator erases its own information about the transaction.
In-Doubt Transactions
The two-phase commit mechanism ensures that all nodes either commit or perform a rollback together. What
happens if any of the three phases fails because of a system or network error? The transaction becomes in-doubt.
Distributed transactions can become in-doubt in the following ways:
A server machine running Oracle Database software crashes
A network connection between two or more Oracle Databases involved in
distributed processing is disconnected
An unhandled software error occurs
34
Durability – Once completed, it is long lasting.
Transactions Commands:
Begin – initiate a new transaction.
Commit – End a transaction and the changes made during the transaction are
saved. Also, it allows other transactions to see the modifications you’ve made.
Abort – End a transaction and all changes made during the transaction will be undone.
Flat Transactions: A flat transaction has a single initiating point (Begin) and a single end point(Commit or abort).
Concurrency
Concurrency means multiple computations are happening at the same time. Concurrency is everywhere in modern
programming, whether we like it or not:
Multiple computers in a network
Multiple applications running on one computer
Multiple processors in a computer (today, often multiple processor cores on a
single chip)
Shared memory
In the shared memory model of concurrency, concurrent modules interact by reading and writing shared objects in
memory. Other examples of the shared-memory model:
A and B might be two processors (or processor cores) in the same computer,
sharing the same physical memory.
A and B might be two programs running on the same computer, sharing a
common filesystem with files they can read and write.
A and B might be two threads in the same Java program (we will explain what a
thread is below), sharing the same Java objects.
35
Message Passing
In the message-passing model, concurrent modules interact by sending messages to each other through a
communication channel. Modules send off messages, and incoming messages to each module are queued up for
handling. Examples include:
A and B might be two computers in a network, communicating by network
connections.
A and B might be a web browser and a web server – A opens a connection to B,
asks for a web page, and B sends the web page data back to A.
A and B might be an instant messaging client and server.
A and B might be two programs running on the same computer whose input and
output have been connected by a pipe, like ls | grep typed into a command prompt.
Process.
A process is an instance of a running program that is isolated from other
processes on the same machine. In particular, it has its own private section of the machine’s memory.
The process abstraction is a virtual computer. It makes the program feel like it
has the entire machine to itself – like a fresh computer has been created, with fresh memory, just to run that program.
Thread
A thread is a locus of control inside a running program. Think of it as a place in the program that is being run, plus
the stack of method calls that led to that place to which it will be necessary to return through.
Just as a process represents a virtual computer, the thread abstraction represents
a virtual processor.
Threads are automatically ready for shared memory, because threads share all
the memory in the process.
Time Slicing
When there are more threads than processors, concurrency is simulated by time
slicing, which means that the processor switches between threads.
Interleaving
Here is one thing that can happen. Suppose two cash machines, A and B, are both working on a deposit at the same
time. Here is how the deposit() step typically breaks down into low-level processor instructions:
get balance (balance=0)
add 1
write back the result (balance=1)
Race Condition
A race condition means that the correctness of the program (the satisfaction of postconditions and invariants)
depends on the relative timing of events in concurrent computations A and B. When this happens, we say “A is in a
race with B.”
Reordering
The race condition on the bank account balance can be explained in terms of different interleavings of sequential
operations on different processors.
A Service
36
Services represent building blocks that allow users to organize information in ways that are familiar to them.
Cloud Computing
Cloud Computing is the delivery of the computing services, such as servers, databases, storage and networking –
over the Internet. These services, usually are offered by so called Cloud Providers, that usually charge based on
usage.
37
Capabilities of Cloud Computing
Generally, these are a few of the capabilities of Cloud Computing:
Create new apps and services
Store, back up and recover data
Deliver software
Analyse data for pattern recognition
Streaming.
Besides the capabilities that Cloud Computing provides, there are also a lot of benefits that it can offer.
Cost – using cloud services lowers the costs that organizations need to spend for
buying hardware and software tools for setting up the infrastructure for its needs.
Speed – when the organization needs more resources, provisioning additional
resources in cloud services can be done in minutes.
Scaling – the ability to scale elastically on demand using cloud services appears
as their main and most common use case – processing power, storage, bandwidth and whatever the demand is, in
less than a minute.
38
Disadvantages of Mobile & Cloud Computing (MCC)
Whenever there are advantages on any issue, it is sure there would be the disadvantages as well. The following are
some listed and most important disadvantages of Mobile and Cloud Computing.
Security – a major concern with Cloud Computing is the security and data
integration. When mobile is the subject, the attention must be two times higher: unprotected information can be
easily sniffed.
Internet connection – considering the flexibility of MCC, allowing the users to
access the data from anywhere, requires Internet connection.
Performance – considering smaller size and lower hardware performance, it is
understandable that the performance with MCC will be in a much lower level.
Insecure API
Usually, the communication between a client (in this case, a mobile device which is
handled by the company’s employee) and the server (which is somewhere in the cloud) is done by an
Application Programming Interface.
39