Resource Book Summary
Cheatsheet Content
### Module 1: Introduction to Networking #### 1.1 What is a Network? - **Definition:** A collection of interconnected devices that can share resources and data. - **Purpose:** Communication, resource sharing (printers, files), centralized management. - **Key Components:** Devices (computers, servers), transmission media (cables, wireless), network devices (routers, switches), protocols. #### 1.2 Network Types - **LAN (Local Area Network):** Small geographical area (home, office). High speed, low latency. - **WAN (Wide Area Network):** Large geographical area (cities, countries). Connects multiple LANs. Slower, higher latency. - **MAN (Metropolitan Area Network):** Covers a city or large campus. Larger than LAN, smaller than WAN. - **PAN (Personal Area Network):** Very small area (personal devices). Bluetooth, USB. - **WLAN (Wireless Local Area Network):** LAN using wireless technology (Wi-Fi). #### 1.3 Network Topologies - **Bus:** All devices share a single communication line. Simple, but single point of failure. - **Star:** All devices connect to a central hub/switch. Easy to manage, robust to single device failure. - **Ring:** Devices connected in a circular fashion. Data flows in one direction. - **Mesh:** Every device connected to every other device. Highly redundant, expensive to implement. - **Hybrid:** Combination of two or more topologies. #### 1.4 Network Devices - **Hub:** Connects multiple Ethernet devices, repeats signals to all ports. (Legacy) - **Switch:** Connects devices, forwards data frames to specific destination ports based on MAC addresses. - **Router:** Connects different networks, forwards data packets between them based on IP addresses. - **Modem:** Modulates/demodulates signals for transmission over different media (e.g., DSL, cable). - **Access Point (AP):** Allows wireless devices to connect to a wired network. #### 1.5 OSI Model (Open Systems Interconnection) - **Purpose:** Conceptual framework for how network communication works, divided into 7 layers. - **Layers (from top to bottom):** 1. **Application:** User interaction, network services (HTTP, FTP, SMTP). 2. **Presentation:** Data formatting, encryption, compression. 3. **Session:** Manages communication sessions, establishes/terminates connections. 4. **Transport:** End-to-end connection, reliability, flow control (TCP, UDP). 5. **Network:** Logical addressing (IP), routing packets between networks. 6. **Data Link:** Physical addressing (MAC), error detection/correction on local link. 7. **Physical:** Physical transmission of bits (cables, connectors, voltage). #### 1.6 TCP/IP Model (Transmission Control Protocol/Internet Protocol) - **Purpose:** Practical, widely used model for internet communication, 4 layers. - **Layers (from top to bottom):** 1. **Application:** Combines OSI Application, Presentation, Session (HTTP, DNS, FTP). 2. **Transport:** End-to-end communication (TCP, UDP). 3. **Internet:** Logical addressing and routing (IP, ICMP). 4. **Network Access:** Combines OSI Data Link and Physical (Ethernet, Wi-Fi). #### 1.7 Network Protocols (Examples) - **TCP (Transmission Control Protocol):** Connection-oriented, reliable, ordered delivery. - **UDP (User Datagram Protocol):** Connectionless, unreliable, faster. - **IP (Internet Protocol):** Addressing and routing of packets. - **HTTP (Hypertext Transfer Protocol):** Web browsing. - **HTTPS (HTTP Secure):** Encrypted web browsing. - **FTP (File Transfer Protocol):** File transfer. - **DNS (Domain Name System):** Resolves domain names to IP addresses. - **DHCP (Dynamic Host Configuration Protocol):** Assigns IP addresses automatically. #### 1.8 IP Addressing - **IPv4:** 32-bit address, e.g., `192.168.1.1`. Divided into network and host portions. - **IPv6:** 128-bit address, e.g., `2001:0db8:85a3:0000:0000:8a2e:0370:7334`. Larger address space. - **Subnetting:** Dividing a larger network into smaller subnetworks for efficiency and security. - **Subnet Mask:** Defines network and host portion of an IP address. - **CIDR (Classless Inter-Domain Routing):** `192.168.1.0/24` where `/24` indicates 24 bits for network. #### 1.9 Port Numbers - **Purpose:** Identify specific applications or services on a host. - **Common Ports:** - HTTP: 80 - HTTPS: 443 - FTP: 20 (data), 21 (control) - SSH: 22 - Telnet: 23 - DNS: 53 - DHCP: 67 (server), 68 (client) ### Module 2: Network Security Fundamentals #### 2.1 Introduction to Network Security - **Definition:** Protecting network resources from unauthorized access, misuse, modification, or denial. - **Goals (CIA Triad):** - **Confidentiality:** Preventing unauthorized disclosure of information. - **Integrity:** Ensuring information is accurate and has not been tampered with. - **Availability:** Ensuring legitimate users have access to information and resources when needed. #### 2.2 Common Network Threats - **Malware:** Viruses, worms, Trojans, ransomware, spyware. - **Phishing:** Deceptive attempts to obtain sensitive information (e.g., credentials) by impersonating trusted entities. - **Denial of Service (DoS):** Attacker overwhelms a system/network to make it unavailable to legitimate users. - **DDoS (Distributed DoS):** DoS attack launched from multiple compromised systems. - **Man-in-the-Middle (MitM):** Attacker intercepts communication between two parties without their knowledge. - **SQL Injection:** Attacker manipulates SQL queries to gain unauthorized access to databases. - **Cross-Site Scripting (XSS):** Attacker injects malicious scripts into web pages viewed by other users. - **Zero-Day Exploits:** Exploiting vulnerabilities unknown to the software vendor. - **Insider Threats:** Malicious or negligent actions by current/former employees. #### 2.3 Security Controls and Measures - **Firewalls:** Network security system that monitors and controls incoming/outgoing network traffic based on predefined security rules. - **Packet-filtering:** Basic, stateless firewall. - **Stateful inspection:** Tracks connection state. - **Application-level gateway (Proxy):** Filters traffic at the application layer. - **Intrusion Detection Systems (IDS):** Monitors network traffic for suspicious activity and alerts administrators. - **Signature-based:** Detects known attack patterns. - **Anomaly-based:** Detects deviations from normal behavior. - **Intrusion Prevention Systems (IPS):** Not only detects but also attempts to block detected threats. - **Antivirus/Antimalware Software:** Detects, prevents, and removes malicious software. - **Encryption:** Converting data into a coded form to prevent unauthorized access. - **Symmetric:** Same key for encryption and decryption (AES). - **Asymmetric (Public Key):** Different keys for encryption/decryption (RSA). - **Virtual Private Networks (VPNs):** Creates a secure, encrypted tunnel over a public network (e.g., internet). - **Access Control:** Restricting access to resources based on user identity and permissions. - **Authentication:** Verifying user identity (passwords, biometrics, MFA). - **Authorization:** Granting specific permissions to authenticated users. - **Security Information and Event Management (SIEM):** Collects, analyzes, and correlates security logs from various sources. #### 2.4 Cryptography Basics - **Cipher:** Algorithm for performing encryption and decryption. - **Plaintext:** Original, unencrypted message. - **Ciphertext:** Encrypted message. - **Key:** Secret information used with the cipher algorithm. - **Hashing:** One-way function that transforms data into a fixed-size string (hash value/digest). Used for integrity checks and password storage. - **MD5, SHA-1, SHA-256:** Common hashing algorithms. #### 2.5 Wireless Security - **SSID (Service Set Identifier):** Network name. - **WEP (Wired Equivalent Privacy):** Old, easily crackable, deprecated. - **WPA (Wi-Fi Protected Access):** Improved security over WEP. - **WPA2 (Wi-Fi Protected Access II):** Current standard, uses AES encryption and CCMP. - **WPA3 (Wi-Fi Protected Access III):** Latest standard, enhanced security, individual data encryption. - **MAC Address Filtering:** Restricting access based on device MAC addresses (easily spoofed). - **Disabling SSID Broadcast:** Hiding network name (minor security benefit). #### 2.6 Web Application Security - **Input Validation:** Checking user input to prevent injection attacks (SQLi, XSS). - **Secure Coding Practices:** Developing applications with security in mind. - **OWASP Top 10:** A list of the most critical web application security risks. - **HTTPS:** Using SSL/TLS to encrypt communication between browser and server. - **Security Headers:** HTTP headers to enhance security (e.g., HSTS, CSP). #### 2.7 Incident Response - **Definition:** A set of procedures to handle security breaches or incidents. - **Phases:** 1. **Preparation:** Policies, tools, training. 2. **Identification:** Detecting the incident. 3. **Containment:** Limiting the damage. 4. **Eradication:** Removing the cause of the incident. 5. **Recovery:** Restoring systems and services. 6. **Post-Incident Activity:** Lessons learned, documentation. #### 2.8 Compliance and Regulations - **GDPR (General Data Protection Regulation):** EU law on data protection and privacy. - **HIPAA (Health Insurance Portability and Accountability Act):** US law protecting patient health information. - **PCI DSS (Payment Card Industry Data Security Standard):** Security standard for organizations handling credit card information. - **ISO 27001:** International standard for information security management systems. ### Module 3: Operating Systems #### 3.1 Introduction to Operating Systems - **Definition:** Software that manages computer hardware and software resources and provides common services for computer programs. - **Functions:** - **Resource Management:** CPU, memory, I/O devices. - **Process Management:** Creating, scheduling, terminating processes. - **Memory Management:** Allocating and deallocating memory to processes. - **File System Management:** Organizing and storing files. - **Device Management:** Interacting with hardware devices. - **User Interface:** GUI (Graphical User Interface) or CLI (Command Line Interface). #### 3.2 Types of Operating Systems - **Batch OS:** Executes jobs in batches without user interaction. - **Time-Sharing OS:** Allows multiple users to share a computer system simultaneously. - **Real-Time OS (RTOS):** Designed for applications with strict time constraints (e.g., industrial control). - **Distributed OS:** Manages a group of independent computers and makes them appear as a single coherent system. - **Network OS:** Runs on a server and provides network services and resource sharing. - **Mobile OS:** Designed for smartphones and tablets (Android, iOS). - **Embedded OS:** Designed for specific embedded systems (e.g., smart appliances). #### 3.3 Process Management - **Process:** An instance of a computer program that is being executed. - **Process States:** - **New:** Process being created. - **Ready:** Waiting to be assigned to a processor. - **Running:** Instructions are being executed. - **Waiting (Blocked):** Waiting for some event (I/O completion, signal). - **Terminated:** Process has finished execution. - **Process Control Block (PCB):** Data structure containing information about a process (state, program counter, registers, memory limits). - **Context Switching:** Saving the state of one process and loading the state of another. - **Scheduling Algorithms:** - **FCFS (First-Come, First-Served):** Processes executed in arrival order. - **SJF (Shortest Job First):** Process with smallest execution time executed next. - **Priority Scheduling:** Processes with higher priority executed first. - **Round Robin:** Each process gets a small time slice (quantum). #### 3.4 Memory Management - **Purpose:** Efficiently allocate and deallocate memory to processes. - **Logical Address:** Address generated by the CPU. - **Physical Address:** Actual address in main memory. - **Memory Management Unit (MMU):** Hardware device that maps logical to physical addresses. - **Paging:** Dividing logical memory into fixed-size blocks (pages) and physical memory into same-size blocks (frames). - **Segmentation:** Dividing logical memory into variable-size segments. - **Virtual Memory:** Allows execution of processes not entirely in physical memory. Uses disk space as an extension of RAM. - **Swapping:** Moving processes between main memory and disk. - **Demand Paging:** Pages are loaded only when they are needed. - **Thrashing:** Excessive paging, leading to low CPU utilization. #### 3.5 File System Management - **File:** A collection of related information stored on secondary storage. - **Directory:** A collection of files and other directories. - **File Operations:** Create, delete, open, close, read, write. - **Access Methods:** - **Sequential Access:** Read/write in order. - **Direct Access:** Read/write at any random block. - **Directory Structures:** - **Single-level:** All files in one directory. - **Two-level:** Each user has their own directory. - **Tree-structured:** Hierarchical directories. - **File System Types:** NTFS (Windows), ext4 (Linux), APFS (macOS). #### 3.6 I/O System Management - **Purpose:** Managing input/output operations and devices. - **I/O Hardware:** Peripherals (keyboard, mouse, printer, disk). - **Device Controllers:** Electronic components that interface devices with the CPU. - **Device Drivers:** Software that allows the OS to communicate with specific hardware devices. - **Polling:** CPU repeatedly checks I/O device status. - **Interrupts:** Device notifies CPU when I/O operation is complete. - **DMA (Direct Memory Access):** Allows devices to transfer data directly to/from memory without CPU intervention. #### 3.7 Security and Protection - **Authentication:** Verifying user identity (passwords, biometrics). - **Authorization:** Granting permissions to access files/resources. - **Access Control Lists (ACLs):** List of permissions for users/groups. - **Role-Based Access Control (RBAC):** Permissions based on user roles. - **Malware Protection:** Antivirus software, firewalls. - **Kernel Protection:** Protecting the core of the OS from unauthorized access. #### 3.8 Common Operating Systems - **Windows:** Dominant desktop OS, various server versions. - **Linux:** Open-source, widely used in servers, embedded systems, and desktops (Ubuntu, Fedora, Debian). - **macOS:** Apple's desktop OS, based on Unix. - **Android:** Most popular mobile OS, Linux-based. - **iOS:** Apple's mobile OS. ### Module 4: Programming Fundamentals #### 4.1 Introduction to Programming - **Definition:** The process of creating instructions that tell a computer what to do. - **Program:** A set of instructions written in a programming language. - **Programming Language:** A formal language comprising a set of instructions that produce various kinds of output. - **Compiler:** Translates entire source code into machine code before execution. - **Interpreter:** Translates and executes source code line by line. #### 4.2 Basic Programming Concepts - **Variables:** Named storage locations for data. - **Declaration:** `int age;` - **Initialization:** `age = 30;` - **Data Types:** Classify the type of values a variable can hold. - **Primitive:** `int`, `float`, `char`, `boolean`, `string` (often primitive in practice). - **Complex/Composite:** Arrays, objects, lists. - **Operators:** Symbols that perform operations on values and variables. - **Arithmetic:** `+`, `-`, `*`, `/`, `%` - **Relational:** `==`, `!=`, ` `, ` =` - **Logical:** `&&` (AND), `||` (OR), `!` (NOT) - **Assignment:** `=`, `+=`, `-=` - **Expressions:** Combinations of variables, operators, and values that evaluate to a single value. - **Statements:** Instructions that perform an action. #### 4.3 Control Flow - **Conditional Statements (Branching):** Execute different code based on conditions. - **`if` statement:** ```python if condition: # code to execute if true ``` - **`if-else` statement:** ```python if condition: # code if true else: # code if false ``` - **`if-elif-else` (or `else if`):** ```python if condition1: # code elif condition2: # code else: # code ``` - **`switch` statement:** (in some languages like C++, Java) ```java switch (variable) { case value1: // code break; case value2: // code break; default: // code } ``` - **Looping Statements (Iteration):** Execute code repeatedly. - **`for` loop:** Iterates a specific number of times or over a collection. ```python for i in range(5): # 0, 1, 2, 3, 4 print(i) ``` - **`while` loop:** Repeats as long as a condition is true. ```python count = 0 while count ### Module 5: Data Structures and Algorithms #### 5.1 Introduction to Data Structures - **Definition:** A particular way of organizing and storing data in a computer so that it can be accessed and modified efficiently. - **Abstract Data Type (ADT):** A mathematical model for data types, defining the behavior from the user's perspective (what it does), independent of implementation (how it does it). - Examples: List, Stack, Queue, Map. #### 5.2 Arrays and Linked Lists - **Arrays:** - **Definition:** A collection of items stored at contiguous memory locations. - **Access:** O(1) by index. - **Insertion/Deletion:** O(N) in worst case (requires shifting elements). - **Space:** Fixed size (usually). - **Linked Lists:** - **Definition:** A sequence of nodes, where each node contains data and a reference (or link) to the next node. - **Types:** Singly, Doubly, Circular. - **Access:** O(N) (must traverse from head). - **Insertion/Deletion:** O(1) if position is known, O(N) to find position. - **Space:** Dynamic size, extra space for pointers. #### 5.3 Stacks and Queues - **Stack (LIFO - Last In, First Out):** - **Operations:** - `push()`: Adds an element to the top. - `pop()`: Removes the top element. - `peek()`/`top()`: Returns the top element without removing it. - **Applications:** Function call stack, undo/redo features, expression evaluation. - **Queue (FIFO - First In, First Out):** - **Operations:** - `enqueue()`: Adds an element to the rear. - `dequeue()`: Removes the front element. - `front()`/`peek()`: Returns the front element without removing it. - **Applications:** Task scheduling, print queues, breadth-first search. #### 5.4 Trees - **Definition:** A hierarchical data structure consisting of nodes connected by edges, with a root node and child nodes. - **Terminology:** Root, Parent, Child, Leaf, Sibling, Ancestor, Descendant, Path, Depth, Height. - **Binary Tree:** Each node has at most two children. - **Binary Search Tree (BST):** A binary tree where for each node: - All left descendants have values less than the node. - All right descendants have values greater than the node. - **Operations:** Search, Insertion, Deletion (average O(log N), worst O(N)). - **Balanced BSTs (e.g., AVL, Red-Black Trees):** Self-balancing trees to maintain O(log N) performance for all operations. - **Heaps:** A complete binary tree that satisfies the heap property. - **Max-Heap:** Parent node value is greater than or equal to its children. - **Min-Heap:** Parent node value is less than or equal to its children. - **Applications:** Priority queues, Heap Sort. #### 5.5 Graphs - **Definition:** A set of vertices (nodes) connected by edges. - **Terminology:** Vertex, Edge, Adjacency, Path, Cycle, Directed/Undirected, Weighted/Unweighted. - **Representations:** - **Adjacency Matrix:** 2D array where `matrix[i][j]` indicates an edge between `i` and `j`. O(V^2) space. - **Adjacency List:** Array of lists, where `list[i]` contains all vertices adjacent to `i`. O(V + E) space. - **Graph Traversal Algorithms:** - **BFS (Breadth-First Search):** Explores neighbors layer by layer (uses a queue). - **DFS (Depth-First Search):** Explores as far as possible along each branch before backtracking (uses a stack or recursion). - **Shortest Path Algorithms:** - **Dijkstra's Algorithm:** Finds shortest paths from a single source to all other vertices in a graph with non-negative edge weights. - **Bellman-Ford Algorithm:** Finds shortest paths from a single source to all other vertices, handles negative edge weights. - **Minimum Spanning Tree (MST) Algorithms:** - **Prim's Algorithm:** Builds an MST by iteratively adding the cheapest edge connecting a new vertex to the tree. - **Kruskal's Algorithm:** Builds an MST by iteratively adding the cheapest edge that does not form a cycle. #### 5.6 Hashing - **Hash Function:** Maps data of arbitrary size to fixed-size values (hash codes/digests). - **Hash Table (Hash Map):** A data structure that uses a hash function to map keys to values. Provides average O(1) access. - **Collision:** When two different keys map to the same hash value. - **Collision Resolution Techniques:** - **Chaining:** Each slot in the hash table points to a linked list of elements that hash to the same slot. - **Open Addressing:** If a slot is occupied, probe for the next available slot (linear probing, quadratic probing, double hashing). #### 5.7 Algorithms Analysis - **Time Complexity:** Measures the amount of time an algorithm takes to run as a function of the input size (N). - **Space Complexity:** Measures the amount of memory an algorithm uses as a function of the input size. - **Big O Notation (O):** Describes the upper bound of an algorithm's growth rate. - **O(1):** Constant time (e.g., array access). - **O(log N):** Logarithmic time (e.g., binary search). - **O(N):** Linear time (e.g., traversing a list). - **O(N log N):** Linearithmic time (e.g., merge sort, quick sort). - **O(N^2):** Quadratic time (e.g., bubble sort, selection sort). - **O(2^N):** Exponential time (e.g., some recursive algorithms). - **O(N!):** Factorial time (e.g., traveling salesman brute force). #### 5.8 Common Algorithms - **Sorting Algorithms:** - **Bubble Sort:** Repeatedly steps through list, compares adjacent elements and swaps them if in wrong order. O(N^2). - **Selection Sort:** Finds the minimum element from unsorted part and puts it at the beginning. O(N^2). - **Insertion Sort:** Builds final sorted array one item at a time. O(N^2) worst, O(N) best. - **Merge Sort:** Divide and conquer. Divides array into halves, sorts them, then merges. O(N log N). - **Quick Sort:** Divide and conquer. Picks an element as pivot and partitions array around pivot. O(N log N) average, O(N^2) worst. - **Heap Sort:** Uses a binary heap data structure. O(N log N). - **Searching Algorithms:** - **Linear Search:** Checks each element in a list sequentially. O(N). - **Binary Search:** Efficiently finds an item in a sorted list by repeatedly dividing the search interval in half. O(log N). - **Recursion:** A function that calls itself to solve smaller instances of the same problem. - **Base Case:** Condition that stops recursion. - **Recursive Step:** Function calls itself with modified input. ### Module 6: Database Management Systems #### 6.1 Introduction to Databases - **Definition:** An organized collection of structured information, or data, typically stored electronically in a computer system. - **Database Management System (DBMS):** Software that interacts with end-users, applications, and the database itself to capture and analyze data. - **Advantages of DBMS:** - Data redundancy control. - Data inconsistency avoidance. - Data sharing. - Data integrity. - Security features. - Backup and recovery. #### 6.2 Database Models - **Hierarchical Model:** Data organized in a tree-like structure, with a single root and branches. (Legacy) - **Network Model:** Similar to hierarchical but allows a record to have multiple parents. (Legacy) - **Relational Model (RDBMS):** Data organized into tables (relations) with rows (tuples) and columns (attributes). Most common model. - **Object-Oriented Model:** Data stored as objects, similar to OOP. - **NoSQL Databases:** Non-relational, designed for specific data models and flexible schemas. (Key-value, Document, Column-family, Graph). #### 6.3 Relational Database Concepts - **Table (Relation):** A collection of related data organized in rows and columns. - **Row (Tuple/Record):** A single entry in a table, representing a single entity. - **Column (Attribute/Field):** A specific characteristic or property of the entity. - **Primary Key:** A column or set of columns that uniquely identifies each row in a table. - Must be unique and not null. - **Foreign Key:** A column or set of columns in one table that refers to the primary key in another table. Establishes relationships between tables. - **Schema:** The logical design of the database (structure of tables, relationships). - **Instance:** The actual data stored in the database at a particular moment. #### 6.4 SQL (Structured Query Language) - **Definition:** Standard language for managing and manipulating relational databases. - **Categories of SQL Commands:** - **DDL (Data Definition Language):** Defines the database schema. - `CREATE DATABASE`, `CREATE TABLE`, `ALTER TABLE`, `DROP TABLE`. - **DML (Data Manipulation Language):** Manages data within objects. - `SELECT`, `INSERT`, `UPDATE`, `DELETE`. - **DCL (Data Control Language):** Manages permissions and access. - `GRANT`, `REVOKE`. - **TCL (Transaction Control Language):** Manages transactions. - `COMMIT`, `ROLLBACK`, `SAVEPOINT`. #### 6.5 Basic SQL Queries - **`SELECT` Statement:** Retrieves data from a database. ```sql SELECT column1, column2 FROM table_name WHERE condition ORDER BY column1 DESC; ``` - **`INSERT` Statement:** Adds new rows to a table. ```sql INSERT INTO table_name (column1, column2) VALUES (value1, value2); ``` - **`UPDATE` Statement:** Modifies existing data in a table. ```sql UPDATE table_name SET column1 = new_value WHERE condition; ``` - **`DELETE` Statement:** Removes rows from a table. ```sql DELETE FROM table_name WHERE condition; ``` - **`JOIN` Clauses:** Combines rows from two or more tables based on a related column. - **`INNER JOIN`:** Returns rows when there is a match in both tables. - **`LEFT JOIN` (LEFT OUTER JOIN):** Returns all rows from the left table, and matching rows from the right table. - **`RIGHT JOIN` (RIGHT OUTER JOIN):** Returns all rows from the right table, and matching rows from the left table. - **`FULL JOIN` (FULL OUTER JOIN):** Returns all rows when there is a match in one of the tables. - **Aggregate Functions:** Perform calculations on a set of rows and return a single value. - `COUNT()`, `SUM()`, `AVG()`, `MIN()`, `MAX()`. - **`GROUP BY` Clause:** Groups rows that have the same values in specified columns into summary rows. - **`HAVING` Clause:** Filters groups based on a specified condition (used with `GROUP BY`). #### 6.6 Database Normalization - **Purpose:** Organizing columns and tables of a relational database to minimize data redundancy and improve data integrity. - **Normal Forms:** - **1NF (First Normal Form):** Each column contains atomic (indivisible) values, and there are no repeating groups of columns. - **2NF (Second Normal Form):** Is in 1NF and all non-key attributes are fully functionally dependent on the primary key. - **3NF (Third Normal Form):** Is in 2NF and has no transitive dependencies (non-key attributes are not dependent on other non-key attributes). - **BCNF (Boyce-Codd Normal Form):** A stricter version of 3NF. #### 6.7 Transactions - **Definition:** A single logical unit of work, consisting of one or more database operations. - **ACID Properties:** Guarantees that database transactions are processed reliably. - **Atomicity:** A transaction is treated as a single, indivisible unit; either all operations succeed, or none do. - **Consistency:** A transaction brings the database from one valid state to another. - **Isolation:** Concurrent transactions appear to execute serially; one transaction's intermediate state is not visible to others. - **Durability:** Once a transaction is committed, its changes are permanent and survive system failures. #### 6.8 Database Security - **Access Control:** User authentication and authorization. - **Encryption:** Encrypting data at rest and in transit. - **Auditing:** Logging database activities for security monitoring. - **Backup and Recovery:** Regular backups and robust recovery plans. - **SQL Injection Prevention:** Input validation, parameterized queries, prepared statements. #### 6.9 NoSQL Databases (Brief) - **Key-Value Stores:** Simple, highly scalable (e.g., Redis, DynamoDB). - **Document Databases:** Store data in flexible, semi-structured documents (e.g., MongoDB, Couchbase). - **Column-Family Stores:** Store data in columns grouped into "column families" (e.g., Cassandra, HBase). - **Graph Databases:** Store data as nodes and edges, ideal for relationships (e.g., Neo4j). ### Module 7: Software Engineering Principles #### 7.1 Introduction to Software Engineering - **Definition:** A systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software. - **Goals:** Produce high-quality software, on time, within budget, that meets user requirements. - **Key Aspects:** Requirements, Design, Implementation, Testing, Maintenance. #### 7.2 Software Development Life Cycle (SDLC) - **Definition:** A structured process that enables the production of high-quality, low-cost software in the shortest possible production time. - **Phases:** 1. **Requirements Gathering:** Understanding what the user needs. 2. **Analysis:** Detailed study of requirements, modeling. 3. **Design:** Creating the architecture, components, interfaces. 4. **Implementation (Coding):** Writing the actual code. 5. **Testing:** Verifying the software meets requirements and is bug-free. 6. **Deployment:** Releasing the software to users. 7. **Maintenance:** Bug fixes, enhancements, updates. #### 7.3 SDLC Models - **Waterfall Model:** Linear, sequential approach. Each phase must be completed before the next begins. - **Pros:** Simple, easy to manage for small, well-understood projects. - **Cons:** Inflexible, difficult to accommodate changes, late error detection. - **Agile Model:** Iterative and incremental approach. Focuses on flexibility, collaboration, and rapid delivery of working software. - **Pros:** Adaptable to changes, early and continuous delivery, customer satisfaction. - **Cons:** Requires active customer involvement, can be less predictable for large projects. - **Popular Frameworks:** Scrum, Kanban. - **Spiral Model:** Combines iterative development with systematic, controlled aspects of the waterfall model. Emphasizes risk management. - **V-Model:** Extension of the Waterfall model where each development phase has a corresponding testing phase. - **Prototyping Model:** Building a prototype to gather user feedback and refine requirements before full development. #### 7.4 Requirements Engineering - **Functional Requirements:** What the system *should do* (e.g., "The system shall allow users to log in"). - **Non-Functional Requirements:** How the system *should perform* (e.g., "The system shall respond within 2 seconds", "The system shall be secure"). - **Techniques:** Interviews, surveys, brainstorming, use cases, user stories. #### 7.5 Software Design Principles - **Modularity:** Breaking down a system into smaller, independent, and interchangeable modules. - **Coupling:** Degree of interdependence between modules. Aim for **loose coupling**. - **Cohesion:** Degree to which elements within a module belong together. Aim for **high cohesion**. - **DRY (Don't Repeat Yourself):** Avoid duplication of code or logic. - **KISS (Keep It Simple, Stupid):** Design should be as simple as possible. - **YAGNI (You Ain't Gonna Need It):** Don't add functionality until it's actually required. - **SOLID Principles (for OOP):** - **S**ingle Responsibility Principle: A class should have only one reason to change. - **O**pen/Closed Principle: Software entities should be open for extension, but closed for modification. - **L**iskov Substitution Principle: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program. - **I**nterface Segregation Principle: Clients should not be forced to depend on interfaces they do not use. - **D**ependency Inversion Principle: Depend upon abstractions, not concretions. #### 7.6 Software Testing - **Unit Testing:** Testing individual components or units of code. - **Integration Testing:** Testing interactions between integrated units. - **System Testing:** Testing the complete and integrated software system. - **Acceptance Testing:** User-focused testing to verify if the system meets business requirements. - **Alpha Testing:** Internal testing by developers. - **Beta Testing:** External testing by a limited group of real users. - **Types of Testing:** - **Functional Testing:** Verifies specific functions. - **Non-Functional Testing:** Performance, security, usability. - **Regression Testing:** Ensures new changes don't break existing functionality. #### 7.7 Software Maintenance - **Corrective Maintenance:** Fixing bugs and defects. - **Adaptive Maintenance:** Modifying software to adapt to changes in environment (OS, hardware). - **Perfective Maintenance:** Enhancing functionality, improving performance. - **Preventive Maintenance:** Modifying to prevent future problems. #### 7.8 Version Control Systems - **Purpose:** Manages changes to documents, computer programs, large websites, and other collections of information. - **Benefits:** Collaboration, tracking changes, reverting to previous versions. - **Popular Systems:** - **Git:** Distributed Version Control System (DVCS). - **SVN (Subversion):** Centralized Version Control System (CVCS). - **Key Concepts (Git):** - **Repository:** Where project files and history are stored. - **Commit:** A snapshot of the repository at a specific point in time. - **Branch:** A separate line of development. - **Merge:** Combining changes from different branches. - **Pull Request/Merge Request:** Proposing changes to be integrated into a main branch. #### 7.9 Project Management Methodologies - **Scrum (Agile Framework):** - **Sprints:** Fixed-length iterations (e.g., 2-4 weeks). - **Roles:** Product Owner, Scrum Master, Development Team. - **Events:** Sprint Planning, Daily Scrum, Sprint Review, Sprint Retrospective. - **Kanban (Agile Framework):** - **Visual workflow:** Uses boards with columns (e.g., To Do, In Progress, Done). - **Limits Work in Progress (WIP):** Prevents bottlenecks. - **Continuous Flow:** Focus on continuous delivery.