Disk Concept -Boot Disk and Persistent Disk

 

Google Cloud — Easy Study Notes

Essential Google Cloud Infrastructure: Foundation


1. What is Google Cloud?

Google Cloud is basically a collection of computing, storage, networking, database, security and other IT services provided by Google.

Instead of buying physical servers yourself, you can rent/use Google's infrastructure.

Simple example

Traditional company:

Company
  ↓
Buy physical servers
  ↓
Install OS
  ↓
Configure network
  ↓
Maintain hardware
  ↓
Run application

Google Cloud:

You
 ↓
Choose Google Cloud service
 ↓
Configure it
 ↓
Run your application

Google manages the underlying physical infrastructure.


2. Cloud Computing — Basic Idea

Cloud computing means:

Using computing resources over the internet instead of owning all the physical hardware yourself.

You can get:

  • CPU

  • RAM

  • Storage

  • Network

  • Databases

  • Kubernetes

  • Application platforms

  • Security services

when you need them.


3. Google Cloud Projects

A Project is one of the most important concepts in Google Cloud.

Think of a project as a container/folder for your cloud resources.

Google Cloud
│
├── Project A
│    ├── VM
│    ├── Storage
│    └── Network
│
└── Project B
     ├── VM
     ├── Database
     └── Network

Resources are created inside projects.

Why projects?

Projects help with:

  • Organizing resources

  • Separating environments

  • Access control

  • Billing

  • Resource management

Example:

Company
│
├── Development Project
├── Testing Project
└── Production Project

4. Projects and Billing

A project can be associated with a billing account.

Think:

Project
   ↓
Uses cloud resources
   ↓
Creates usage/cost
   ↓
Billing account pays

So:

Project = organizes resources

Billing account = pays for usage


5. Ways to Work with Google Cloud

There are three major ways to interact with Google Cloud.

1. Google Cloud Console

A web-based graphical interface.

Browser
   ↓
Google Cloud Console
   ↓
Click buttons / configure services

Good for beginners and visual management.


2. Cloud Shell

A command-line environment available from Google Cloud.

Example:

gcloud compute instances list

You type commands instead of clicking.

Cloud Shell is useful for learning and automation.


3. APIs

Applications can communicate directly with Google Cloud services.

Your application
       ↓
Google Cloud API
       ↓
Cloud service

Useful when software needs to automate cloud operations.


Easy memory

Console → Click
Cloud Shell → Command
API → Program

6. Google Cloud Marketplace

Marketplace provides ready-made software/application solutions.

Instead of manually installing every component, you can deploy a preconfigured solution.

Example: LAMP

LAMP means:

L → Linux
A → Apache
M → MySQL
P → PHP

Marketplace can deploy this kind of environment for you.

After deployment, you can access/manage the application using the provided site URL.


7. Compute Options in Google Cloud

Google Cloud gives you different levels of control.

Think of this as:

More control
    ↑
Compute Engine
    │
GKE
    │
Cloud Run
    │
Serverless functions
    ↓
Less infrastructure management

8. Compute Engine

Compute Engine = Virtual Machines (VMs).

A VM is basically a computer running inside Google's data center.

Think:

"Google gives me a computer, and I control the computer."

You can choose:

  • Operating system

  • CPU

  • RAM

  • Disk

  • Network

  • Software

  • Security settings

Compute Engine gives you a lot of flexibility.

This is called:

Infrastructure as a Service (IaaS)


9. What is a VM?

VM = Virtual Machine

Think of a physical computer:

Computer
│
├── CPU
├── RAM
├── Disk
├── Network
└── Operating System

A Google Cloud VM provides the same basic concepts virtually.

Google Cloud VM
│
├── Virtual CPU
├── RAM
├── Disk
├── Network
└── Operating System

10. Creating a VM — The 4 Things to Remember

When creating a VM, think about:

1. WHERE?
2. HOW POWERFUL?
3. WHICH OS?
4. HOW CONNECTED?

1. Where?

Choose:

Region + Zone

2. How powerful?

Choose:

Machine type

CPU + RAM

3. Which OS?

Choose:

Boot disk / OS image

Example:

  • Linux

  • Windows

4. How connected?

Choose:

Network / VPC / firewall configuration


11. Region and Zone

Region

A region is a geographical area containing Google Cloud infrastructure.

Examples:

us-central1
europe-west1
asia-south1

Zone

A zone is a smaller location inside a region.

Example:

Region: asia-south1

├── Zone A
├── Zone B
└── Zone C

A VM is normally created in a zone.

Easy memory

Region = bigger area

Zone = smaller location inside region


12. Machine Type

Machine type determines how much computing power your VM gets.

Main things to think about:

Machine Type
     │
     ├── CPU
     └── Memory (RAM)

For example:

e2-medium
├── 2 vCPU
└── 4 GB memory

Different machine families are designed for different workloads.


13. CPU and Memory

CPU

CPU performs calculations and executes instructions.

Think:

CPU = worker

More CPU → more processing capability.

Memory / RAM

RAM is temporary working space.

Think:

RAM = worker's desk

A worker with a bigger desk can keep more things available while working.

Simple analogy

CPU = Worker
RAM = Desk
Disk = Cupboard

CPU works on things.

RAM holds things currently being worked on.

Disk stores things for longer.


14. Machine Family Concepts

Google Cloud provides different machine types for different needs.

Common categories include:

General purpose

Balanced CPU and memory.

Good for normal applications.

High-CPU / compute-focused

More CPU relative to memory.

Good for CPU-heavy workloads.

High-memory

More RAM.

Good for memory-intensive applications.

Memory-optimized

Designed for workloads requiring very large amounts of memory.

Compute-optimized

Designed for demanding CPU workloads.

Shared-core

Smaller machines where CPU resources are shared.


15. Boot Disk vs Persistent Disk — IMPORTANT

This was the confusing part, so remember it this way:

"Boot" describes the PURPOSE

Boot disk = disk used to start the VM.

It contains the operating system.

VM starts
   ↓
Boot Disk
   ↓
Linux / Windows
   ↓
Operating System loads
   ↓
VM starts working

"Persistent" describes the BEHAVIOR

Persistent disk = storage that remains available independently of the VM's compute lifecycle.

So these are NOT opposites.

A disk can be:

Boot + Persistent


16. Very Simple Disk Example

Imagine your laptop.

The laptop has an SSD.

That SSD can contain:

Windows
Applications
Photos
Documents

The same idea applies to a VM.

VM
│
└── Boot Persistent Disk
      │
      ├── Linux
      ├── Applications
      └── Files

So:

Boot = what the disk is used for

Persistent = how the disk behaves


17. Can We Separate OS and Data?

Yes.

Option 1 — Same disk

Boot Persistent Disk
│
├── Linux
├── Applications
└── Data

Simple setup.

Option 2 — Separate disks

VM
│
├── Boot Persistent Disk
│      └── Linux / OS
│
└── Additional Persistent Disk
       └── Database / Application data

Both are possible.


18. Persistent Disk

Persistent Disk is network-attached storage.

It is separate from the VM's CPU and RAM.

VM
│
├── CPU
├── RAM
└────── network ──────→ Persistent Disk

Because the disk is separate from compute, the disk can survive independently.

Important features

Persistent disks can:

  • Survive VM restart

  • Remain after VM deletion if configured correctly

  • Be resized

  • Be snapshotted

  • Be attached to VMs

  • Be used for boot or data storage


19. Delete Boot Disk When Instance Is Deleted

When creating a VM, there is an option:

Delete boot disk when instance is deleted

If enabled:

Delete VM
   ↓
Boot disk deleted

If disabled:

Delete VM
   ↓
Boot disk remains

This is important when you want to preserve the disk/data.


20. Persistent Disk Types

There are different performance/cost options.

Standard Persistent Disk

Uses HDD technology.

Good for:

  • Large capacity

  • Lower cost

  • Sequential I/O

  • Workloads where very high performance isn't required

Think:

Cheap + capacity


Balanced Persistent Disk

Uses SSD.

Balances:

Cost ↔ Performance

Good general-purpose option.

Think:

Normal applications


SSD Persistent Disk

Uses SSD.

Good for:

  • High-performance applications

  • Databases

  • Lower latency

  • Higher IOPS

Think:

Performance


Extreme Persistent Disk

Designed for very demanding workloads.

Good for:

  • High-end databases

  • Very high IOPS

  • Random-access workloads

  • High throughput

You can provision desired IOPS.

Think:

Maximum persistent-disk performance


21. Zonal vs Regional Persistent Disk

Zonal Persistent Disk

Associated with one zone.

Region
│
└── Zone A
      └── Persistent Disk

Regional Persistent Disk

Data is synchronously replicated across two zones in the same region.

Region
│
├── Zone A → Disk replica
│
└── Zone B → Disk replica

Useful when you need higher availability.

Easy memory

Zonal = one zone

Regional = two zones


22. Disk Snapshots

A snapshot is a point-in-time backup of a persistent disk.

Persistent Disk
       ↓
    Snapshot
       ↓
Backup / Recovery

Snapshots are incremental, so later snapshots can store changes rather than making a completely independent full copy each time.


23. Persistent Disk Can Be Resized

One useful feature is that persistent disks can be expanded.

Example:

100 GB
  ↓
200 GB

You don't have to replace the physical disk.

The disk and underlying infrastructure are managed by Google Cloud.


24. Read-Only Persistent Disk

A persistent disk can be attached in read-only mode to multiple VMs.

             Disk
              │
       ┌──────┼──────┐
       ↓      ↓      ↓
      VM1    VM2    VM3
      READ   READ   READ

Useful when multiple VMs need the same static data.


25. Disk Encryption

Google Cloud encrypts data at rest by default.

You don't have to manually encrypt every file yourself.

You can also have more control using encryption keys.

Google-managed

Google manages the encryption.

Customer-managed encryption keys

You manage keys using Cloud KMS.

Customer-supplied encryption keys

You supply/manage the keys yourself.

Easy memory

Default → Google manages encryption

More control → You manage keys


26. Local SSD

Local SSD is different from Persistent Disk.

Local SSD is physically associated with the VM's host infrastructure.

It provides very high performance.

VM
│
├── CPU
├── RAM
└── Local SSD
       ↓
   Very fast

But it is ephemeral.

That means:

Don't use it as the only place for important permanent data.

The course notes that Local SSD data survives a VM reset, but not a VM stop/terminate.


27. RAM Disk

A RAM disk stores data in memory.

Linux can use tmpfs.

Application
     ↓
    RAM
     ↓
Very fast

RAM disk is extremely fast but volatile.

If the memory is lost, the data is lost.

Good for:

  • Temporary data

  • Cache

  • Small data structures

  • Very performance-sensitive temporary workloads


28. Storage Performance vs Durability

Remember this simple order:

Durability

Persistent Disk
      ↓
Local SSD
      ↓
RAM Disk

Speed

Persistent Disk
      ↓
Local SSD
      ↓
RAM Disk
       ↑
    FASTEST

The basic idea:

Persistent Disk → durable

Local SSD → very fast but temporary

RAM Disk → fastest but extremely temporary


29. Number of Disks

The number of persistent disks that can be attached depends on the machine type.

From the course:

Shared-core
→ up to 16 disks

Many larger machine categories
→ up to 128 disks

So one VM can have a large amount of attached storage.


30. Disk I/O and Network Bandwidth

This is an important performance concept.

Disk I/O and network traffic can compete for available bandwidth.

             VM
              │
       ┌──────┴──────┐
       ↓             ↓
   Disk I/O      Network I/O
       │             │
       └──────┬──────┘
              ↓
       Shared resources

So adding lots of disks doesn't automatically mean unlimited throughput.

If your VM is doing:

  • Heavy disk operations

  • Large network transfers

both can consume bandwidth.


31. Physical Disk vs Cloud Persistent Disk

Traditional physical computer:

Physical Disk
     ↓
Partition
     ↓
Filesystem
     ↓
OS/Data

You may need to manually handle:

  • Partitioning

  • Resizing

  • Redundancy

  • Encryption

  • Backups

Google Cloud Persistent Disk abstracts much of this complexity.

You can:

  • Resize disks

  • Snapshot disks

  • Use built-in redundancy

  • Use encryption

  • Use customer-managed keys

Think:

**Google

Comments

Popular posts from this blog

Async/await

First negative in every window of size k

Valid Parentheses