Posts

GT-lecture_01

### 1. **Graph Theory Introduction**    - **What is Graph Theory?**        Graph theory is a branch of mathematics that studies graphs. A graph is a collection of points, called nodes (or vertices), connected by lines, called edges. Graphs help us represent and analyze relationships between things.    - **Why is Graph Theory Important?**        Graphs are used in computer science and many other fields to model relationships, such as connections in a network or links between pages on the web. They help us solve complex problems and make it easier to understand relationships between different objects. ### 2. **Applications of Graph Theory**    Graph theory applies to many areas, which is why understanding it is so valuable. Here’s a breakdown of key applications:    #### **Social Networks**    - **Friendship Connections**        Social networks like Facebook or Twit...

Data Replication using sync and async mode

### Data Replication Overview Data replication means copying data from one main source (the "master") to other locations ("replicas") to make it accessible across multiple systems or locations. This helps with data availability and reliability, especially in distributed systems. Here’s how it works differently in **synchronous**, **asynchronous**, and **semi-synchronous** scenarios. ### Synchronous Replication 1. **Process**:    - When a client writes (or sends) data to the master, the master saves it to its own storage.    - Then, the master **sends this data to all replicas**.    - **Only after all replicas confirm** that they have received and saved the data, the master tells the client the write is successful. 2. **Consistency**:    - This guarantees that all copies of the data are **exactly the same** at all times.    - If one replica fails to receive the data, the client gets an error, meaning the write didn’t complete everywhere. ...

Lecture-1.1 PDC

### Synchronous Communication 1. **Definition**: In synchronous communication, components work in a coordinated way with a set order and timing. Here, the sender waits until the receiver confirms receipt before continuing.     2. **Characteristics**:    - **Real-Time Interaction**: The sender waits for the receiver’s reply before moving forward.    - **Request-Response Pattern**: A request is sent, and the sender pauses until a response comes back. 3. **Advantages and Disadvantages**:    - **Simplified Design**: It’s easy to design since processes are in sync, knowing exactly what’s happening when.    - **Potential Delays**: If the receiver takes time to respond, the sender is idle, which can slow down the system. 4. **Example**:     Imagine a **chat system** where every message you send has to be acknowledged by the other person immediately before you can send the next message. If the other person delays, you’re left wait...

Lecture-1 PDC

### Distributed Systems 1. **Definition**:    - A *distributed system* is a network of independent computers that work together to appear as a single, unified system. Imagine multiple computers collaborating to act as one "supercomputer." 2. **Key Points**:    - **Autonomous Components**: Each computer (or component) operates independently.    - **Collaboration**: These computers work together to solve problems, sharing data and processing tasks.    - **Diversity**: Distributed systems don’t require all computers to be the same; they can range from powerful servers to tiny devices.    - **Consistency for Users**: The system hides complexity, making it look like a single system to users.    - **Expandability**: Distributed systems are designed to scale up, which means new computers or resources can be added easily. 3. **Transparency and Reliability**:    - **Transparency**: The system hides where data or resources are ...

SE

  SDLC Models in Detail: 1. Waterfall Model: - This is the basic/classic SDLC model - The phases happen in a strict linear sequence - requirements, design, implementation, testing, deployment, maintenance - Each phase must be completed fully before moving to the next phase - It is like a "waterfall" of progress flowing steadily downwards - Easy to understand and use, but very rigid and no room for revisions once a phase is over 2. Iterative Waterfall Model:  - Provides a feedback path to previous phases to allow changes/revisions - For example, if an issue is found in testing, you can loop back and rework the design - More flexible than the basic waterfall, but still quite rigid and sequential 3. Incremental Model: - The product is built and delivered in incremental releases - For example, an email app may release basic emailing first, then add calendaring, contacts, etc. in later increments   - Each increment goes through the full SDLC cycles - Allows faster deliver...

POS-Quizes-Answers(A1/A2)

A2 Q-1. **Advantages and disadvantages of threads compared to processes:**    - *Advantages*: Threads share resources, such as memory, more efficiently than processes. They are lighter-weight, as they share the same address space, which reduces overhead. Threads can communicate more easily since they share memory.    - *Disadvantages*: Threads can lead to synchronization issues, such as race conditions and deadlocks. They are also harder to debug due to shared memory. Q-2. **Priority scheduling:**    - Priority scheduling assigns priorities to tasks, with higher-priority tasks being executed first. Potential drawbacks include the possibility of starvation for lower-priority tasks and the potential for priority inversion.    - Drawbacks can be mitigated by implementing techniques such as aging (increasing the priority of tasks over time) and priority boosting (temporarily raising the priority of certain tasks). Q-3. **First Come First Served (FCFS)...

Synchronization

Image
1. **Synchronization Hardware:**    - Imagine you have a group project where each team member needs to work on a specific part simultaneously. Synchronization hardware ensures that everyone knows when to start and finish their task, preventing chaos and ensuring smooth collaboration. 2. **Atomic Operations:**    - Think of atomic operations as a "do not disturb" sign on a door when someone is inside doing something important. It guarantees that either the entire task is completed successfully, or none of it happens at all, avoiding halfway-done tasks and maintaining consistency. 3. **Memory Barriers and Fences:**    - Picture a bulletin board where everyone posts updates and announcements. Memory barriers and fences act like moderators, making sure that everyone sees the updates in the correct order and preventing misunderstandings or outdated information. 4. **Cache Coherence Protocols:**    - Imagine you and your friends have copies of the same ...