0% found this document useful (0 votes)
4 views31 pages

3.0

The document outlines the fundamentals of data and storage, including types of data, the importance of data, and various database types such as relational, NoSQL, and NewSQL. It also covers key concepts like database architecture, SQL basics, and security measures against SQL injection. Additionally, discussions highlight the implications of database loss, the relevance of different database types, and the importance of data security.

Uploaded by

rohan.clinchtech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views31 pages

3.0

The document outlines the fundamentals of data and storage, including types of data, the importance of data, and various database types such as relational, NoSQL, and NewSQL. It also covers key concepts like database architecture, SQL basics, and security measures against SQL injection. Additionally, discussions highlight the implications of database loss, the relevance of different database types, and the importance of data security.

Uploaded by

rohan.clinchtech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

EMERGING

TECHNOLOGIES
Rohan Raj Poudel
Precap: Week 3
Planned Sessions:

◦ Introduction to Data and storage

◦ Types of Databases

◦ Key Concepts in Relational Databases

◦ Database Architecture and Modern Trends

◦ SQL Basics and Database security

◦ Important Questions to be Discussed


Data and Storage
What is Data?

• General Definition:
• Raw facts, figures, or details collected from observations or measurements.
• Example: Names, numbers, measurements, words, observations.

• In IT (Information Technology):
• Information stored electronically in a format that a computer can process.
• Example: Text files, images, videos, sensor readings, user activity logs.
Data and Storage
Types of Data

• Structured Data:
• Organized in a defined manner, usually in tables (rows and columns).
• Example: Databases like MySQL, Oracle.

• Semi-structured Data:
• Partially organized data, not strictly in tables, but still structured through tags or markers.
• Example: XML, JSON files.

• Unstructured Data:
• No specific format or structure.
• Example: Images, videos, PDFs, emails.
Data and Storage
Importance of Data

• Basis for decision making


• Enables personalized services (e.g., Netflix recommendations)
• Drives AI and Machine Learning models
• Crucial for business strategies, innovations, and customer insights
Data and Storage
What is Data Storage?

• The method of saving data in physical or cloud mediums for future access and use.

Storage Mediums

• Hard Drives (HDDs):


• Mechanical spinning disks; cheaper, slower.

• Solid State Drives (SSDs):


• Faster, more durable, no moving parts; more expensive.

• Cloud Storage:
• Remote servers accessed via internet (e.g., Google Drive, AWS S3).
Data and Storage
What is Data Backup?

• Creating copies of data to restore in case of data loss, corruption, or attacks.

Why is Backup Necessary?

• Protects against accidental deletion, ransomware, hardware failure, natural disasters.


DataBase (DB)
What is a Database?

• A structured collection of data that is stored and accessed electronically.


• Enables efficient storage, retrieval, and manipulation of data.

Why Are Databases Important?

• Centralized management of large data sets


• Better security and access control
• Easy data retrieval and reporting

• Essential for apps, websites, companies, organizations


DataBase (DB)
Database Vs Spreadsheets

Feature Spreadsheet (Excel) Database


Structure 2D (rows and columns) Complex (tables, relationships)

Users Single or small team Multiple simultaneous users

Data Volume Small to medium datasets Large datasets

Operations Basic calculations, simple filters Advanced querying (SQL), security,


automation

Examples Microsoft Excel, Google Sheets MySQL, MongoDB, PostgreSQL


Types of DB
Relational Databases (SQL Databases)

• Store structured data in predefined tables (rows and columns).


• Use Structured Query Language (SQL) to query and manage data.

• Examples: MySQL, PostgreSQL, OracleDB, SQL Server.


Types of DB
NoSQL Databases

• Store semi-structured or unstructured data. • Key-Value Stores:


• Data stored as key and value pairs.
• Designed for scalability and flexibility. • Example: Redis, DynamoDB.

• Types of NoSQL databases: • Graph Databases:


• Data stored as nodes and relationships.
• Document-Based: • Example: Neo4j, ArangoDB.
• Store documents (usually JSON).
• Columnar Databases:
• Example: MongoDB, CouchDB. • Data stored in columns rather than rows.
• Example: Apache Cassandra, HBase.
Types of DB
NewSQL Databases

• Combine best of both SQL and NoSQL worlds.

• Solve the scalability limitations of traditional relational databases.

• Support ACID transactions like SQL, but scale horizontally like NoSQL.

• Examples:
• Google Spanner, CockroachDB, VoltDB

◦ NewSQL = SQL familiarity + NoSQL scalability + High reliability


Key Concepts
What is a Table?

• A table is a collection of related data organized in rows and columns.


• Like an Excel sheet — but in databases, tables are more structured and connected to other tables.

What are Rows and Columns?

• Columns:
• Define the type of data stored (fields or attributes).
• Example: Student Name, Roll Number, Class.
• Rows: Roll Number Student Name Class
• Each record or data entry in the table.
• Example: 1 Rohan Raj 10
Key Concepts
What are Primary Keys and Foreign Keys?

• Primary Key:
• A unique identifier for each row in a table.
• No two rows can have the same primary key value.
• Example: Roll Number in a Students table.
• Foreign Key:
• A field in a table that links to the primary key in another table.
• Used to establish relationships between tables.

• Example: Student ID in a Fees table links to Roll Number in the Students table.
Key Concepts
Concept of Relationships

• One-to-One (1:1):
• One record in a table matches one record in another table.
• Example: Each student has one ID card.
• One-to-Many (1:N):
• One record in a table can match multiple records in another table.
• Example: One teacher teaches many students.
• Many-to-Many (M:N):
• Many records in one table relate to many records in another.
• Requires a junction table (linking table).
• Example: Students enrolled in multiple courses, and courses having multiple students.
DB Architecture
• 1-Tier Architecture:
• Database and user interface are on the same machine.
• Example: MS Access running on a single computer.
• 2-Tier Architecture:
• Client-server model.
• The client (frontend) directly talks to the database server.
• Example: A desktop app connected to a MySQL database server.
• 3-Tier Architecture:
• Frontend (client), Backend (application server), and Database server are separated.
• Most modern apps use this model.

• Example: Facebook, Online Banking Systems.


DB Architecture
Client-Server Model Overview

• Client: Sends requests (like viewing or updating data).


• Server: Processes the request and sends back the response.
• Helps to separate concerns and improve security and scalability.

Database Servers vs Application Servers vs File Servers

Server Type Role Example


Database Server Stores and manages data MySQL Server
Application Server Runs business logic (software code) Node.js, Java Spring Server

File Server Stores and shares files Google Drive, Windows File Server
Modern DB
Cloud Databases

• Databases hosted online, accessible anywhere via internet.


• Scalable, secure, and managed by providers.
• Examples:
• Amazon RDS (Relational Database Service)
• Firebase (Realtime database by Google)
• MongoDB Atlas (MongoDB hosted in cloud)
Modern DB
Distributed Databases

• Database is spread across multiple locations or servers.


• Advantages:
• High availability
• Fault tolerance
• Faster data access

• Examples: Google Bigtable, Amazon DynamoDB


Modern DB
Real-time Databases

• Databases that instantly update for all users whenever data changes.
• Important for:
• Chat apps
• Online games
• Collaborative tools (like Google Docs)
• Example:
• Firebase Realtime Database

◦ Modern systems often combine cloud, real-time, and distributed databases for speed, scalability, and user
experience.
SQL Basics and Database Security
◦ Basic Operations: CRUD
What is SQL?

• SQL stands for Structured Query Language. ◦ CRUD = Create, Read, Update, Delete
(These are the four basic functions of databases.)
• It is the language used to interact with relational
databases. Operation SQL Command Example

• Tasks done with SQL: Create INSERT Insert a new student's data
• Creating tables Read SELECT View students in a class
• Inserting data Update UPDATE Change a student's address
• Reading data Delete DELETE Remove a student's record
• Updating records
• Deleting records

SQL is like giving clear instructions to the database on


what you want it to do.
SQL Basics and Database Security
What is SQL Injection?

• SQL Injection is a type of cyber attack where a hacker inserts malicious SQL code into a
query.
• The hacker tricks the database into executing unintended commands.

◦ Think of it like giving secret, hidden commands to the database through normal input
fields like login forms.
SQL Basics and Database Security
How Does SQL Injection Happen?

• Happens when user input is directly used in SQL queries without proper checks.
• Example:

SELECT * FROM users WHERE username = 'admin' AND password = '1234';

If a hacker enters:

' OR '1'='1

The query becomes:

SELECT * FROM users WHERE username = '' OR '1'='1';

◦ Result: Anyone can log in without a password!


SQL Basics and Database Security
Basic Ways to Prevent SQL Injection

• Input Validation: Check and clean user input.


• Prepared Statements/Parameterized Queries:
• Let the database know which parts are commands and which parts are user inputs.
• Stored Procedures: Predefine database operations.
• Least Privilege Principle: Users should only have access to necessary data.
General Database Security Tips
Security Measure Description
Authentication Confirming who is trying to access (e.g., username and
password)

Authorization Defining what someone can do (e.g., only view data, not
delete)
Encryption Scrambling data so even if stolen, it is unreadable

Regular Updates Keeping database software updated

Backups Regular copies of data stored safely


Discussions:
What happens if a company loses its database?

• Loss of customers, money, trust, and even company shutdown!


• Famous example: In 2007, a UK Government Department lost 25 million people's personal data.

Why is choosing the right database type important for a project?

• Each project needs a different kind of database depending on:


• Amount of data
• Type of data
• Speed needed
• Scalability (growth needs)
Discussions:
Why are relational databases still popular even today?

• Structure and reliability.


• Good for:
• Financial systems
• Healthcare records
• School/university management

• They have strong data integrity and rules (relationships, constraints).


Discussions:
Why do we need NoSQL databases if SQL already exists?

• NoSQL is better for:


• Big data (huge amounts of data)
• Flexible structures (not fixed like tables)
• Real-time data (social media feeds, live comments)
• Example: Facebook, Twitter, YouTube use NoSQL databases.
Discussions:
What happens if data is not secured properly?

• Data breach!
• Risks:
• Identity theft
• Financial fraud
• Loss of company reputation
• Companies can also face heavy fines and legal action.
Discussions:
How does data travel from user to database and back? (Simple flow)

1.User enters information in an app (e.g., login form).


2.Request goes to the application server.
3.Application server prepares a SQL query.
4.Query is sent to the database server.
5.Database processes it and sends results back to the application server.
6.Application server shows the result to the user.

◦ (Simple client-server-database communication.)


Discussions:
What makes a database server different from a normal storage server?
Database Server Storage Server
Specialized software for managing, querying, and Simply stores files and documents like a hard drive
updating structured data

Optimized for transactions, searches, data Just saves data, no smart operations
consistency

Examples: MySQL Server, PostgreSQL Server Examples: Google Drive, Dropbox, OneDrive

Database servers "understand" the data, while storage servers simply "hold" the data.

You might also like