UNIT 5
Fire base
Firebase is a backend platform for building Web, Android and IOS applications. It offers real
time database, different APIs, multiple authentication types and hosting platform.
Firebase Features
Real-time Database − Firebase supports JSON data and all users connected to it receive
live updates after every change.
Authentication − We can use anonymous, password or different social authentications.
Hosting − The applications can be deployed over secured connection to Firebase
servers.
Flexibility-The flexibility of AWS allows us to choose which programming models,
languages, and operating systems are better suited for their project, so we do not have
to learn new skills to adopt new technologies.The larger organizations run in a hybrid
mode, i.e., some pieces of the application run in their data center, and other portions of
the application run in the cloud.
Cost-effective-AWS provides no upfront investment, long-term commitment, or
minimum spend.You can scale up or scale down as the demand for resources increases
or decreases respectively.An aws allows you to access the resources more instantly. It
has the ability to respond the changes more quickly, and no matter whether the
changes are large or small, means that we can take new opportunities to meet the
business challenges that could increase the revenue, and reduce the cost.
Scalable and elastic-Scalability in aws has the ability to scale the computing resources
up or down when demand increases or decreases respectively.
The aws cloud is also useful for implementing short-term jobs, mission-critical jobs,
and the jobs repeated at the regular intervals.
Elasticity load balancing and scalability automatically scale your AWS computing resources to
meet unexpected demand and scale down automatically when demand decreases.
Secure-AWS provides a scalable cloud-computing platform that provides customers with
end-to-end security and end-to-end privacy.
Firebase Advantages
It is simple and user friendly. No need for complicated configuration.
The data is real-time, which means that every change will automatically update
connected clients.
Firebase offers simple control dashboard.
There are a number of useful services to choose.
Firebase Limitations
Firebase free plan is limited to 50 Connections and 100 MB of storage.
What is Cloud Computing?
Cloud computing is a term referred to storing and accessing data over the internet. It doesn't
store any data on the hard disk of your personal computer. In cloud computing, you can access
data from a remote server.
AWS stands for Amazon Web Services.
The AWS service is provided by the Amazon that uses distributed IT infrastructure to provide
different IT resources available on demand. It provides different services such as infrastructure
as a service (IaaS), platform as a service (PaaS) and packaged software as a service (SaaS).
What is AWS?
Amazon web service is a platform that offers flexible, reliable, scalable, easy-to-use and
cost-effective cloud computing solutions.
AWS is a comprehensive, easy to use computing platform offered Amazon. The platform is
developed with a combination of infrastructure as a service (IaaS), platform as a service (PaaS)
and packaged software as a service (SaaS) offerings.
HISTORY
2002- AWS services launched
2006- Launched its cloud products
2012- Holds first customer event
2015- Reveals revenues achieved of $4.6 billion
2016- Surpassed $10 billon revenue target
2016- Release snowball and snowmobile
2019- Offers nearly 100 cloud services
Amazon Web Services offers a wide range of different business purpose global cloud-based
products. The products include storage, databases, analytics, networking, mobile,
development tools, enterprise applications, with a pay-as-you-go pricing model.
Applications of AWS services
Ftopia
Advantages of AWSAmazon Web services are widely used for various computing purposes like:
Web site hosting
Application hosting/SaaS hosting
Media Sharing (Image/ Video)
Mobile and Social Applications
Content delivery and Media Distribution
Storage, backup, and disaster recovery
Development and test environments
Academic Computing
Search Engines
Social Networking
Companies using AWS
Instagram
Zoopla
Smugmug
Pinterest
Netflix
Dropbox
Etsy
Talkbox
Playfish
Advantage of AWS
1. AWS allows organizations to use the already familiar programming models, operating
systems, databases, and architectures.
2. It is a cost-effective service that allows you to pay only for what you use, without any
up-front or long-term commitments.
3. You will not require to spend money on running and maintaining data centers.
4. Offers fast deployments
5. You can easily add or remove capacity.
6. You are allowed cloud access quickly with limitless capacity.
7. Total Cost of Ownership is very low compared to any private/dedicated servers.
8. Offers Centralized Billing and management
9. Offers Hybrid Capabilities
10. Allows you to deploy your application in multiple regions around the world with just a
few clicks
Disadvantages of AWS
1. If you need more immediate or intensive assistance, you'll have to opt for paid support
packages.
2. Amazon Web Services may have some common cloud computing issues when you move
to a cloud. For example, downtime, limited control, and backup protection.
3. AWS sets default limits on resources which differ from region to region. These resources
consist of images, volumes, and snapshots.
4. Hardware-level changes happen to your application which may not offer the best
performance and usage of your applications.
NOSQL
The relational database was created by E.F. Codd and these databases answered the question
of having no standard way to store data. But later relational database also get a problem that it
could not handle big data, due to this problem there was a need of database which can handle
every types of problems then NoSQL database was developed.
NoSQL can be defined as an approach to database designing, which holds a vast diversity of
data such as key-value, multimedia, document, columnar, graph formats, external files, etc.
NoSQL is purposefully developed for handling specific data models having flexible schemas to
build modern applications.
What is NoSql?
NoSQL is famous for its high functionality, ease of development with a performance at scale.
Because of such diverse data handling feature, NoSQL is called a non-relational database. It
does not follow the rules of Relational Database Management Systems (RDBMS), and hence do
not use traditional SQL statements to query your data. It provides a mechanism for storage and
retrieval of data other than tabular relations model used in relational databases. NoSQL
database doesn't use tables for storing data. It is generally used to store big data and real-time
web applications.
Some famous examples are MongoDB, Neo4J, HyperGraphDB, etc.
Databases can be divided in 3 types:
RDBMS (Relational Database Management System)
OLAP (Online Analytical Processing)
NoSQL (recently developed database)
Advantages of NoSQL:
There are many advantages of working with NoSQL databases such as MongoDB and Cassandra.
The main advantages are high scalability and high availability.
High scalability –
NoSQL database use sharding for horizontal scaling. Partitioning of data and placing it on
multiple machines in such a way that the order of the data is preserved is sharding. Vertical
scaling means adding more resources to the existing machine whereas horizontal scaling means
adding more machines to handle the data. Vertical scaling is not that easy to implement but
horizontal scaling is easy to implement. Examples of horizontal scaling databases are MongoDB,
Cassandra etc. NoSQL can handle huge amount of data because of scalability, as the data grows
NoSQL scale itself to handle that data in efficient manner.
High availability –
Auto replication feature in NoSQL databases makes it highly available because in case of any
failure data replicates itself to the previous consistent state.
It supports query language.
It provides fast performance.
It provides horizontal scalability
Disadvantages of NoSQL:
Narrow focus –
NoSQL databases have very narrow focus as it is mainly designed for storage but it provides
very little functionality. Relational databases are a better choice in the field of Transaction
Management than NoSQL.
Open-source –
NoSQL is open-source database. There is no reliable standard for NoSQL yet. In other words
two database systems are likely to be unequal.
Management challenge –
The purpose of big data tools is to make management of a large amount of data as simple as
possible. But it is not so easy. Data management in NoSQL is much more complex than a
relational database. NoSQL, in particular, has a reputation for being challenging to install and
even more hectic to manage on a daily basis.
GUI is not available –
GUI mode tools to access the database is not flexibly available in the market.
Backup –
Backup is a great weak point for some NoSQL databases like MongoDB. MongoDB has no
approach for the backup of data in a consistent manner.
Large document size –
Some database systems like MongoDB and CouchDB store data in JSON format. Which means
that documents are quite large (BigData, network bandwidth, speed), and having descriptive
key names actually hurts, since they increase the document size.
When should NoSQL be used:
a. When huge amount of data need to be stored and retrieved .
b. The relationship between the data you store is not that important
c. The data changing over time and is not structured.
d. Support of Constraints and Joins is not required at database level
e. The data is growing continuously and you need to scale the database regular to handle
the data.
Types of NoSql
NoSQL databases usually fall under any one of these four categories:
Key-value stores: is the most straightforward type where every item of your database gets
stored in the form of an attribute name (i.e., "key") along with the value.Value can be
XML,document,table etc.Data is stored in key/value pairs. It is designed in such a way to handle
lots of data and heavy load.
Key-value pair storage databases store data as a hash table where each key is unique, and the
value can be a JSON, BLOB(Binary Large Objects), string, etc.
Wide-column stores.Every column is treated separately. Values of single column databases are
stored contiguously.They deliver high performance on aggregation queries like SUM, COUNT,
AVG, MIN etc. as the data is readily available in a column.
Column-based NoSQL databases are widely used to manage data warehouses, business
intelligence, CRM, Library card catalogs.
Document databases: couple every key with a composite data structure termed as a document.
These documents hold a lot of different key-value pairs, as well as key-array pairs or sometimes
nested documents.Document-Oriented NoSQL DB stores and retrieves data as a key value pair
but the value part is stored as a document. The document is stored in JSON or XML formats.
The value is understood by the DB and can be queried.
Graph databases: are used for storing information about networks, like social connections.
A graph type database stores entities as well the relations amongst those entities. The entity is
stored as a node with the relationship as edges. An edge gives a relationship between nodes.
Every node and edge has a unique identifier.
Difference between SQL &NoSql
Here is the list of comparisons between both the DBMS:
SQL databases are mainly coming under Relational Databases (RDBMS) whereas NoSQL
databases mostly come under non-relational or distributed database.
SQL databases are table-oriented databases, whereas NoSQL databases
document-oriented have key-value pairs or wide-column stores or graph databases.
SQL databases have a predefined or static schema that is rigid, whereas NoSQL
databases have dynamic or flexible schema to handle unstructured data.
SQL is used to store structured data, whereas NoSQL is used to store structured as well
as unstructured data.
SQL databases can be considered as vertically scalable, but NoSQL databases are
considered horizontally scalable.
Scaling of SQL databases is done by mounting the horse-power of your hardware. But,
scaling of NoSQL databases is calculated by mounting the databases servers for reducing
the load.
Examples of SQL databases: MySql, Sqlite, Oracle, Postgres SQL, and MS-SQL. Examples
of NoSQL databases: BigTable, MongoDB, Redis, Cassandra, RavenDb, Hbase, CouchDB
and Neo4j
When your queries are complex SQL databases are a good fit for the intensive
environment, and NoSQL databases are not an excellent fit for complex queries. Queries
of NoSQL are not that powerful as compared to SQL query language.
SQL databases need vertical scalability, i.e., excess of load can be managed by increasing
the CPU, SSD, RAM, GPU, etc., on your server. In the case of NoSQL databases, they
horizontally scalable, i.e., the addition of more servers will ease out the load
management thing to be
handled.
Basic Availability. The NoSQL database approach focuses on the availability of data even in the
presence of multiple failures. It achieves this by using a highly distributed approach to database
management. Instead of maintaining a single large data store and focusing on the fault
tolerance of that store, NoSQL databases spread data across many storage systems with a high
degree of replication. In the unlikely event that a failure disrupts access to a segment of data,
this does not necessarily result in a complete database outage.
Soft State. BASE databases abandon the consistency requirements of the ACID model pretty
much completely. One of the basic concepts behind BASE is that data consistency is the
developer's problem and should not be handled by the database.
Eventual Consistency. The only requirement that NoSQL databases have regarding consistency
is to require that at some point in the future, data will converge to a consistent state. No
guarantees are made, however, about when this will occur. That is a complete departure from
the immediate consistency requirement of ACID that prohibits a transaction from executing
until the prior transaction has completed and the database has converged to a consistent state.
What is the CAP Theorem?
CAP theorem is also called brewer's theorem. It states that is impossible for a distributed data
store to offer more than two out of three guarantees
Consistency
Availability
Partition Tolerance
Consistency:
The data should remain consistent even after the execution of an operation. This means once
data is written, any future read request should contain that data. For example, after updating
the order status, all the clients should be able to see the same data.
Availability:
The database should always be available and responsive. It should not have any downtime.
Partition Tolerance:
Partition Tolerance means that the system should continue to function even if the
communication among the servers is not stable. For example, the servers can be partitioned
into multiple groups which may not communicate with each other. Here, if part of the database
is unavailable, other parts are always unaffected.
Cloud database
A cloud database is a collection of informational content, either structured or unstructured,
that resides on a private, public or hybrid cloud computing infrastructure platform. From a
structural and design perspective, a cloud database is no different than one that operates on a
business's own on-premises servers. The critical difference lies in where the database reside.
Here are various benefits of a cloud database, some of which are the ability to pay for storage
capacity and bandwidth on a per-user basis, and they provide scalability on demand, along with
high availability.
A cloud database also gives enterprises the opportunity to support business applications in a
software-as-a-service deployment.
Types of Cloud Databases
Two cloud database environment models exist: traditional and database as a service (DBaaS).
In a traditional cloud model, a database runs on an IT department's infrastructure with a virtual
machine. Tasks of database oversight and management fall upon IT staffers of the organization.
The DBaaS model is a fee-based subscription service in which the database runs on the service
provider's physical infrastructure. Different service levels are usually available. In a classic
DBaaS arrangement, the provider maintains the physical infrastructure and database, leaving
the customer to manage the database's contents and operation.
Alternatively, a customer can set up a managed hosting arrangement, in which the provider
handles database maintenance and management. This latter option may be especially
attractive to small businesses that have database needs but lack adequate IT expertise.
Cloud database benefits
Compared with operating a traditional database on an on-site physical server and storage
architecture, a cloud database offers the following distinct advantages:
Elimination of physical infrastructure- In a cloud database environment, the cloud computing
provider of servers, storage and other infrastructure is responsible for maintenance and
keeping high availability. The organization that owns and operates the database is only
responsible for supporting and maintaining the database software and its contents. In a DBaaS
environment, the service provider is responsible for managing and operating the database
software, leaving the DBaaS users responsible only for their own data.
Cost savings- Through the elimination of a physical infrastructure owned and operated by an IT
department, significant savings can be achieved from reduced capital expenditures, less staff,
decreased electrical and HVAC operating costs and a smaller amount of needed physical space.
DBaaS benefits also include instantaneous scalability, performance guarantees, failover support,
declining pricing and specialized expertise.
What is Cloud Computing
The term cloud refers to a network or the internet. It is a technology that uses remote servers
on the internet to store, manage, and access data online rather than local drives. The data can
be anything such as files, images, documents, audio, video, and more.
There are the following operations that we can do using cloud computing:
Developing new applications and services
Storage, back up, and recovery of data
Hosting blogs and websites
Delivery of software on demand
Analysis of data
Streaming videos and audios
Platform as a Service | PaaS
Platform as a Service (PaaS) provides a runtime environment. It allows programmers to easily
create, test, run, and deploy web applications. You can purchase these applications from a
cloud service provider on a pay-as-per use basis and access them using the Internet connection.
In PaaS, back end scalability is managed by the cloud service provider, so end- users do not
need to worry about managing the infrastructure.
PaaS includes infrastructure (servers, storage, and networking) and platform (middleware,
development tools, database management systems, business intelligence, and more) to
support the web application life cycle.
Example: Google App Engine, Force.com, Joyent, Azure.
PaaS providers provide the Programming languages, Application frameworks, Databases, and
Other tools:
1. Programming languages
PaaS providers provide various programming languages for the developers to develop the
applications. Some popular programming languages provided by PaaS providers are Java, PHP,
Ruby, Perl, and Go.
2. Application frameworks
PaaS providers provide application frameworks to easily understand the application
development. Some popular application frameworks provided by PaaS providers are Node.js,
Drupal, Joomla, WordPress, Spring, Play, Rack, and Zend.
3. Databases
PaaS providers provide various databases such as ClearDB, PostgreSQL, MongoDB, and Redis to
communicate with the applications.
4. Other tools
PaaS providers provide various other tools that are required to develop, test, and deploy the
applications.
Advantages of PaaS
There are the following advantages of PaaS -
1) Simplified Development
PaaS allows developers to focus on development and innovation without worrying about
infrastructure management.
2) Lower risk
No need for up-front investment in hardware and software. Developers only need a PC and an
internet connection to start building applications.
3) Prebuilt business functionality
Some PaaS vendors also provide already defined business functionality so that users can avoid
building everything from very scratch and hence can directly start the projects only.
4) Instant community
PaaS vendors frequently provide online communities where the developer can get the ideas to
share experiences and seek advice from others.
5) Scalability
Applications deployed can scale from one to thousands of users without any changes to the
applications.
Disadvantages of PaaS cloud computing layer
1) Vendor lock-in
One has to write the applications according to the platform provided by the PaaS vendor, so the
migration of an application to another PaaS vendor would be a problem.
2) Data Privacy
Corporate data, whether it can be critical or not, will be private, so if it is not located within the
walls of the company, there can be a risk in terms of privacy of data.
3) Integration with the rest of the systems applications
It may happen that some applications are local, and some are in the cloud. So there will be
chances of increased complexity when we want to use data which in the cloud with the local
data.
Automated database management
Database automation tools offer a variety of purpose-built automation capabilities that apply to
the DBMS and the associated infrastructure operations tasks.
Database automation is the use of unattended processes and self-updating procedures for
administrative tasks in a database. The automation of databases and their procedures reduces
errors on deployments, improves reliability and increases the speed of implementing changes.
Automation also frees up staff that might otherwise be occupied updating code and performing
other tasks, including patching, upgrading, failover, scaling, provisioning and recovery.
Here are the most common database automation capabilities.
Data processing
Data processing tasks includes automation data collection, replication, cleanup, and migration
tasks that help make the data more meaningful, secure, dependable, and available for
immediate processing when necessary.
Provisioning & configurations
Here, you can automate the setup of database environments and repositories for various tasks
and stages during the software development lifecycle (SDLC). The provisioned database clusters
should be secure, high performing, and dependable, according to the requirements
of development, quality assurance (QA), and IT operations teams.
Load balancing
By automating load balancing, you optimize database performance in terms of:
Throughput
Latency
Resource utilization
The workloads are balanced across servers in multi-cloud and hybrid infrastructure
environments to optimize for the overall system performance, security, and cost investments.
Disaster recovery & protection
Losing critical information assets can compromise the ability of an organization to operate
within regulatory guidelines and customer expectations. Therefore, organizations must
introduce risk mitigation strategies such as:
Database redundancy
Distribution across geographic disparate server regions
Automatic-trigger defense systems against compromise and cyber-attacks
Backup & restoration
The systems should be programmed to automatically backup and restore at specific instances in
order to reduce the risk of data loss, especially in the event of a network intrusion that
compromises the integrity of sensitive and mission-critical databases.
Security improvements
Deploying strong authentication and access management processes. Enrolling specific database
systems to comply with specific organization policies for access privilege can be challenging and
lead to several security issues unless appropriate security policies are enforced.
Database Security
Database security refers to the range of tools, controls, and measures designed to establish and
preserve database confidentiality, integrity, and availability.
Database security must address and protect the following:
The data in the database
The database management system (DBMS)
Any associated applications
The physical database server and/or the virtual database server and the underlying
hardware
The computing and/or network infrastructure used to access the database
Common threats and challenges
Human error
Accidents, weak passwords, password sharing, and other unwise or uninformed user behaviors
continue to be the cause of nearly half (49%) of all reported data breaches.
Exploitation of database software vulnerabilities
Hackers make their living by finding and targeting vulnerabilities in all kinds of software,
including database management software. All major commercial database software vendors
and open source database management platforms issue regular security patches to address
these vulnerabilities, but failure to apply these patches in a timely fashion can increase your
exposure.
SQL/NoSQL injection attacks
A database-specific threat, these involve the insertion of arbitrary SQL or non-SQL attack strings
into database queries served by web applications or HTTP headers.
Buffer overflow exploitations
Buffer overflow occurs when a process attempts to write more data to a fixed-length block of
memory than it is allowed to hold. Attackers may use the excess data, stored in adjacent
memory addresses, as a foundation from which to launch attacks.
Denial of service (DoS/DDoS) attacks
In a denial of service (DoS) attack, the attacker deluges the target server—in this case the
database server—with so many requests that the server can no longer fulfill legitimate requests
from actual users, and, in many cases, the server becomes unstable or crashes.
Best practices
Physical security: Whether your database server is on-premise or in a cloud data
center, it must be located within a secure, climate-controlled environment. (If your
database server is in a cloud data center, your cloud provider will take care of this for
you.)
Administrative and network access controls: The practical minimum number of users
should have access to the database, and their permissions should be restricted to the
minimum levels necessary for them to do their jobs. Likewise, network access should
be limited to the minimum level of permissions necessary.
End user account/device security: Always be aware of who is accessing the database
and when and how the data is being used. Data monitoring solutions can alert you if
data activities are unusual or appear risky. All user devices connecting to the network
housing the database should be physically secure (in the hands of the right user only)
and subject to security controls at all times.
Encryption: ALL data—including data in the database, and credential data—should be
protected with best-in-class encryption while at rest and in transit. All encryption keys
should be handled in accordance with best-practice guidelines.
Database software security: Always use the latest version of your database
management software, and apply all patches as soon as they are issued.
Application/web server security: Any application or web server that interacts with the
database can be a channel for attack and should be subject to ongoing security testing
and best practice management.
Backup security: All backups, copies, or images of the database must be subject to the
same (or equally stringent) security controls as the database itself.