distributed system

Design of Fault-Tolerant Virtual Machines

In some situations where failure is caused by a hardware failure, it's useful to have replication in hand. There are other types of failures that can't be resolved with replication, such as software bugs or network issues. In this article, we deal wi…

Read article
distributed system

The Google File System - Case Study

Introduction The Google file system's main goal is to support their applications' workload. Which affected their design decisions, they implemented what they actually need, rather than the de-facto distributed file system. There are 4 main different …

Read article
concurrency

Pessimistic Concurrency Control - 2PL

Introduction In today's high-traffic database management systems (DBMS), leveraging the full potential of hardware is essential. With the advent of modern CPUs, the opportunity for parallel processing has increased significantly. However, executing m…

Read article
Databases

Query Optimization

Introduction SQL is a declarative language, which means that when you request a query, you specify the data you want, but not how to get it. The database management system (DBMS) is responsible for determining the most efficient way to retrieve the r…

Read article
Databases

Query Execution - Joins

Introduction Joins are used to combine data from multiple tables in a database and retrieve the combined data as a single result set. This allows us to effectively retrieve data that is spread across multiple tables and can be especially useful when …

Read article
query-execution

Query Execution - Aggregations

Introduction Once the query planner has determined the optimal plan for executing a query, it's time to implement that plan. But before we can do that, it's important to understand the algorithms used to execute the various operations in the plan. In…

Read article
hashing-schemes

Understanding hash indexes

Why database indexes? When it comes to querying databases, one of the most time-consuming and performance-intensive operations is to do a linear scan of the entire table. This requires the database management system (DBMS) to retrieve all of the page…

Read article
database

Database Buffer Pool - Part 2

Introduction As explained in Database Buffer Pool - Part 1, a buffer pool is a limited chunk of memory, which means that whenever we bring something from the disk, we need to evict something from the buffer pool and replace it. Buffer replacement is …

Read article
buffer-pool

Database Buffer Pool - Part 1

Introduction In order to allow the database execution engine to perform its operations, it needs the pages containing the table records to be brought from disk to memory. However, we want to optimize I/O operations, so there is a subsystem of the dat…

Read article
Databases

Compression In Databases

Introduction It's well-known that the database's main bottleneck lies in I/O. That's what makes database designers aim toward reducing it in any possible way, one of them is to look carefully at the workload and choose the suitable storage model (for…

Read article
Databases

Storage Models for Databases

Introduction Different applications have different requirements, as discussed in What the heck is OLTP, OLAP?, it depends on business rules to define the workload of our database. Therefore, we need different storage models for the database in order …

Read article
database

What the heck is OLTP, OLAP?

What's OLTP? OLTP stands for Online Transaction Processing, in which a database is used to execute huge amounts of transactions. Transaction means to change data, either by inserting, updating, or deleting small amounts of data. It's usually used at …

Read article
operating system

Quorum Consensus

The Problem According to the CAP theorem, you can not achieve consistency, availability, and partition tolerance all at once. However, achieving strong consistency is desirable in many systems, but this strong consistency has a price that should be p…

Read article
operating system

Deadlock prevention & necessary conditions to occur

Deadlock is a state when a set of threads is waiting for an event that can only be raised by a thread(s) from the same set. There are many situations that developers think that it's a deadlock, and it is not. Sometimes it's a livelock or it's just …

Read article
operating system

Mesa VS Hoare semantics

Introduction While designing multithreaded programs, we need to keep sure that our shared objects are synchronized between all of the running threads. Monitors are used to ensuring this synchronization. A monitor provides the programmer with the abil…

Read article
oauth

An introduction to OAuth 2.0

First of all, why does it exist? OAuth 2.0 was created to make a standard way - protocol - for making users delegate access to their resources in a specific application to another application. This is widely used today, whenever you login into an app…

Read article
multithreading

Thread Implementation & Modeling

Threads Implementation Kernel Threads Kernel threads are the simplest type of threads. They are implemented in the operating system kernel itself. It's used to execute the kernel code concurrently. Single-threaded processes with multiple kernel th…

Read article
multithreading

Thread Abstraction

Introduction Our real-world run concurrently, which means that there are many things that happen at the same time. For example, you are reading this blog post while your friend is driving, or maybe he is just sleeping! The fact that you are doing som…

Read article