

























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


























What is Business Intelligence (BI) in Simple Terms?
Business Intelligence (BI) is a set of tools and strategies that help businesses make smart decisions by analyzing data. Think of it as a system that collects, organizes, and studies information to help companies understand their past, present, and future performance.
How BI Helps Businesses:
โ It looks at past data to see what has happened. โ It examines current data to show what is happening now. โ It predicts future trends based on past and current data.
What BI Can Do (Common Functionalities):
BI includes many techniques that help businesses gain insights. Hereโs a breakdown:
Why Businesses Use BI:
โ To make better decisions based on facts rather than guesses. โ To improve efficiency and cut down costs. โ To spot trends and stay ahead of competitors. โ To understand customer behavior and improve services.
A Data Warehouse (DW or DWH) is a system used for analyzing and reporting data. It is an important part of business intelligence (BI) , helping organizations make informed decisions.
โ It acts as a central storage where data from different sources is combined. โ It keeps both current and past data in one place. โ This stored data is used to create reports and analytics for business users.
Why Do We Need a Data Warehouse?
A Data Warehouse is needed when businesses face issues with data handling and reporting. Here's why:
โ Better Reporting: If it's difficult to generate reports because data isn't available in one place, a data warehouse can help. โ Avoid Data Duplication: Different departments might copy data separately, leading to inconsistencies. A data warehouse ensures everyone uses the same data. โ Trust in Data: If business leaders doubt the accuracy of reports, a data warehouse provides a reliable data source. โ No Impact on Operations: Running reports directly on business (transactional) databases can slow down daily operations. A data warehouse prevents this problem. โ Faster Analysis: Running complex queries on normal databases can be slow. A data warehouse speeds up analytical tasks.
Database vs. Data Warehouse (TCP3D2)
Feature Database Data Warehouse
Type of Data Stores current/live data Stores historical data
Purpose Supports daily transactions Supports analysis & decision-making
Processing Type Online Transactional Processing (OLTP)
Online Analytical Processing (OLAP)
Data Storage Structure
Tables are normalized (organized efficiently)
Tables are denormalized (designed for fast querying)
Performance Slower for complex queries Faster for complex queries
Data View Highly detailed & relational Summarized & multidimensional
Concurrency Handles many transactions at once
Not built for many concurrent users
A data warehouse is usually built using a three-layer (three-tier) architecture. These layers help organize data storage, processing, and user access.
โ This is where the main database of the data warehouse is stored. โ It is a relational database (like MySQL, Oracle, or SQL Server). โ Data is collected from different sources using back-end tools. โ These tools perform the following tasks: โ Extract โ Pulls data from different sources. โ Clean โ Fixes errors and inconsistencies in the data. โ Load โ Stores the cleaned data in the database. โ Refresh โ Updates the data regularly.
โ This is where OLAP (Online Analytical Processing) servers work. โ OLAP servers organize and structure data for analysis. โ There are two types of OLAP servers: โ ROLAP (Relational OLAP): โ Uses a relational database to handle multi-dimensional data. โ Converts complex data operations into standard database queries. โ MOLAP (Multidimensional OLAP): โ Stores data in a multi-dimensional format (like cubes). โ Optimized for fast data analysis and reporting.
โ This is the front-end layer where users interact with the data. โ It includes: โ Query tools (to search for specific data). โ Reporting tools (to generate reports). โ Analysis tools (for data visualization). โ Data mining tools (to find hidden patterns in data).
ETL stands for Extract, Transform, Load , a process used to move and prepare data from different sources for analysis and reporting.
โ This step retrieves data from one or multiple sources. โ The sources can include databases, files, applications, or APIs. โ The goal is to gather all relevant data needed for processing.
โ The extracted data is converted into a suitable format for the target system. โ This step may involve: โ Cleaning data (removing errors or inconsistencies). โ Applying business rules. โ Merging data from different sources. โ Changing data structures (e.g., converting date formats).
โ The transformed data is stored in the target database , typically a data warehouse. โ The data is now ready for reporting, analysis, and decision-making.
Why is ETL Important?
โ It helps combine data from multiple sources into one place. โ It ensures data is clean, accurate, and properly formatted. โ It is widely used in data migration, business intelligence, and analytics.
Big Data refers to extremely large and complex sets of information that traditional software cannot handle effectively.
Challenges in Handling Big Data
Big Data comes with many challenges, including:
Types of Data in Big Data
โ Structured Data โ Well-organized data (e.g., databases, spreadsheets). โ Semi-structured Data โ Partially organized data (e.g., JSON, XML). โ Unstructured Data โ Raw data without a fixed format (e.g., images, videos, social media posts).
Why is Big Data Important?
Big Data helps in making better decisions, predicting trends, and improving business operations by analyzing large sets of information.
Key Features of Big Data (3Vs)
How is Big Data Processed?
Since Big Data is too large for traditional software, special tools and techniques (like cloud computing, AI, and machine learning) are used to process and analyze it.
Characteristics of Big Data
Big Data has five main characteristics, often called the 5Vs :
Challenges of Big Data
โ The larger the data, the more resources (memory, processors, and storage) are needed. โ Handling Big Data efficiently requires powerful tools and techniques.
Optimization Techniques for Handling Big Data
Feature Structured Data ๐ Unstructured Data ๐ช
Format Organized in rows & columns (like a table)
No fixed structure (free-form data)
Examples Numbers, dates, names, databases
Images, videos, audio, emails, documents
Enterprise Data Share
20% of total business data (Gartner)
80% of total business data (Gartner)
Storage Requires less space Needs more space
Management Easy to handle with traditional tools
Harder to manage & protect with old systems
Processing large amounts of data is slow, but splitting it into smaller chunks (partitions) allows multiple processes to work on it simultaneously (parallel processing).
Good partitioning should:
โ Key Takeaway: Partitioning speeds up data processing and allows for scalability.
Principle 4: Avoid Unnecessary Resource-Heavy Steps ๐
Certain operations (like sorting and disk writing) are slow and resource-intensive. Avoid them whenever possible.
Reducing Disk I/O (Reading/Writing Data Efficiently)
โ Key Takeaway: Avoid heavy operations and optimize storage to improve efficiency.
ACID is a set of rules that make sure database transactions are safe and reliable , even if something goes wrong (like a system crash).
1 โฃ Atomicity (All or Nothing)
โ If a transaction has multiple steps, either all of them succeed or none of them happen. โ Example: If you transfer money from Account A to Account B, both the deduction from A and the addition to B must happen together. If one fails, nothing happens.
2 โฃ Consistency (Follow the Rules)
โ The database must always stay in a valid state and follow all the rules. โ Example: If a rule says "Balance canโt be negative," the transaction must not break this rule.
3 โฃ Isolation (No Mixing of Transactions)
โ Transactions must not interfere with each other while they are running. โ Example: If two people try to buy the last item in stock at the same time, the database must process one order first before the other.
4 โฃ Durability (Changes are Permanent)
โ Once a transaction is successfully saved, it stays savedโeven if the system crashes. โ Example: If you book a flight and the system confirms it, your booking must be safe even if the server shuts down right after.
Types of Data Replication (FTMSK)
1 โฃ Full Table Replication โ Copies the entire database to multiple locations.
โ Best for high availability but needs a lot of storage. โ Example: A bank may store complete copies of customer data in different branches.
2 โฃ Transactional Replication โ Copies changes in real time as they happen.
โ Example: A stock market database must update immediately after every trade.
3 โฃ Snapshot Replication โ Takes a snapshot of the database at a specific time.
โ Example: A university database might take daily backups of student records.
4 โฃ Merge Replication โ Combines changes from multiple copies into one main database.
โ Example: A company with remote employees who edit data offline can sync changes later.
5 โฃ Key-Based Incremental Replication โ Updates only modified records to save space and bandwidth.
โ Example: A warehouse management system that updates inventory changes instead of copying the full list.
Data Replication in Distributed Databases
๐น Full Replication โ The entire database is copied to every location.
โ Pros: High availability, no downtime if one server fails. โ Cons: Uses a lot of storage space. โ Example: If an online shopping platform's US server goes down , customers in Europe and Asia can still access the database.
๐น Partial Replication โ Only important parts of the database are copied.
โ Pros: Saves storage, improves performance. โ Example: A sales team only needs access to customer data , not internal company records.
๐น No Replication โ Each location stores unique data , with no copies.
โ Pros: Saves storage. โ Cons: Slows down queries because all users rely on a single server. โ Example: A hospital database storing patient records in one place instead of multiple locations.
Sharding is a technique used in databases to split large amounts of data into smaller, more manageable pieces. Instead of storing everything in one big table , we divide the data into multiple smaller tables (shards).
Each shard : โ Has the same structure (same columns as the original table). โ Stores different rows of data (no duplication across shards).
Why Use Sharding? (BSL)
Types of Sharding Architectures
Sharding can be implemented using different techniques based on how data is distributed. The three most common types are:
1 โฃ Key-Based (Hash-Based) Sharding ๐
Key-based sharding, also known as hash-based sharding , assigns data to a specific shard based on a hash function applied to a chosen shard key (such as a Customer ID, ZIP code, or IP address). This ensures data is evenly distributed across shards.
How It Works:
3 โฃ Directory-Based Sharding ๐
Directory-based sharding uses a lookup table to keep track of which shard contains which data. This provides flexibility for complex data distributions that do not fit well with key-based or range-based sharding.
How It Works:
Example:
A food delivery app might assign restaurants to different shards:
โ McDonald's โ Stored in Shard A โ Burger King โ Stored in Shard B โ Dominoโs โ Stored in Shard C
The lookup table maintains this mapping:
Restaurant Shard
McDonald's A
Burger King B
Domino's C
โ Pros:
โ Highly flexible for complex data distributions. โ Can accommodate irregular data that does not fit well into fixed rules.
๐จ Cons:
โ Requires maintaining the lookup table , adding extra storage and processing overhead. โ If the lookup table fails, data retrieval can become problematic.
The CAP theorem explains a basic limitation in distributed systems (systems where data is stored on multiple computers or nodes). It states that a distributed system can guarantee only two of the following three properties at the same time:
1 โฃ Consistency (C) โ Every user sees the same data, no matter which node they access. If data is updated on one node, all other nodes must reflect the change immediately. 2 โฃ Availability (A) โ The system always responds to a request, even if some nodes fail. You will always get some data, but it might not be the latest. 3 โฃ Partition Tolerance (P) โ The system continues to function even if communication between nodes is broken or delayed.
Because network failures (partitions) are unavoidable in distributed systems, you must choose between Consistency and Availability when designing a system.
Breaking Down the CAP Theorem with Real-Life Examples
1 โฃ CP (Consistency + Partition Tolerance)
โ The system ensures data is always correct , but some parts might be unavailable during network failures. โ ๐ฆ Example: Banking Systems โ If you transfer money, the system ensures the balance is updated correctly across all nodes before confirming the transaction. If there's a failure, the system might temporarily block access rather than show incorrect data.
2 โฃ AP (Availability + Partition Tolerance)
โ The system remains available even when nodes can't communicate, but some users might see old data. โ ๐ Example: DNS or Online Shopping Carts โ Even if one part of the network is slow or down, the website still loads and lets users browse. Some might see outdated stock counts, but they can still use the system.
3 โฃ CA (Consistency + Availability)
โ The system ensures correct data and uptime , but it cannot handle network failures well. โ ๐ Example: Single-Server Databases โ Since thereโs no distributed system, thereโs no partitioning issue. But if the server crashes, everything goes down.
Why Does CAP Matter?
Since network failures (P) are unavoidable , most distributed systems must choose between Consistency (C) and Availability (A). If accuracy is critical โ Pick CP (e.g., banks, financial transactions). If uptime is more important โ Pick AP (e.g., social media, search engines).
SQL and NoSQL are two types of database systems that store and manage data differently. Understanding their differences can help in choosing the right one for your application.
1 โฃ What is SQL?
SQL databases store data in structured tables with strict rules and relationships between them. They are best for applications that require accuracy, consistency, and complex queries (e.g., banking, ERP systems).
โ Example Databases: MySQL, PostgreSQL, Oracle, SQL Server
2 โฃ What is NoSQL?
NoSQL databases store data in different formats like key-value, document, columnar, or graph models. They are scalable, flexible, and great for handling large amounts of unstructured or fast-changing data (e.g., social media, IoT, real-time applications).
โ Example Databases: MongoDB, Cassandra, Redis, DynamoDB
3 โฃ Key Differences Between SQL and NoSQL (D2S2PABQ)
Feature SQL (Relational Databases) NoSQL (Non-Relational Databases)
Data Structure Stores data in structured tables with rows & columns
Stores data in flexible formats like JSON, key-value, or graphs
Schema (Data Rules)
Fixed Schema - You must define tables & structure before inserting data
Flexible Schema - Data can change structure anytime
Scalability (Growth Handling)
Vertical Scaling - Requires adding more power to a single server (costly)
Horizontal Scaling - Adds multiple servers to handle more data (cheaper & faster)
Performance (Speed of Operations)
Best for complex queries but can be slower for large datasets
Fast for big data & real-time processing
ACID Compliance Follows ACID (Atomicity, Consistency, Isolation, Durability) - Ensures data consistency
Follows BASE (Basically Available, Soft state, Eventually consistent) - Prioritizes speed & availability
Query Language Uses SQL (Structured Query Language)
Uses JSON, XML, YAML, or special query languages
Data Distribution Centralized - Usually operates in a single location
Distributed - Spreads data across multiple servers & locations
Best for Banking, ERP, inventory management
Social media, real-time analytics, IoT, e-commerce
4 โฃ SQL and NoSQL: Features Explained in Simple Terms
๐ SQL Features (Relational Databases)
1 โฃ Structured & Organized โ Data is stored in tables, making it easy to organize and retrieve. 2 โฃ Strict Schema โ Requires defining the structure before storing data, ensuring consistency. 3 โฃ Great for Complex Queries โ Best for applications where relationships between data are important (e.g., customer orders, banking transactions). 4 โฃ Vertically Scalable (Bigger Servers) โ Can handle more data by upgrading to a powerful server, but this is expensive. 5 โฃ Data Consistency โ Follows strict rules to ensure data accuracy and reliability.
๐ NoSQL Features (Non-Relational Databases)
1 โฃ Multi-Model (Handles Different Data Types) โ Stores structured, semi-structured, and unstructured data easily. โ Supports various data models: ๐ Key-Value (like a dictionary: "name": "Alice") ๐ Document-Based (stores data in JSON format) ๐ Column-Based (best for analytics) ๐ Graph Databases (best for relationships, like social networks)
2 โฃ Easily Scalable (Grows With Data Needs) โ SQL databases need bigger servers (vertical scaling), while NoSQL adds more servers (horizontal scaling) to handle growth. โ Uses Sharding (splitting data across multiple servers) to prevent slowdowns.
3 โฃ Flexible (Handles Any Type of Data) โ NoSQL does not force data into rigid tables. โ Can store text, images, videos, logs, and real-time streaming data. โ Great for fast-changing applications like social media, IoT, and e-commerce.