Phase 1: Cloud Fundamentals

File storage (EFS, Filestore) & shared access patterns

Beginner ~2 min read
Think of it this way A friendly analogy. Read this if the technical version feels dense. Show Hide

Imagine you and your friends are building an enormous LEGO castle. It’s way too big for just one person to build, and you all want to work on it together. But what if everyone has their own small box of LEGOs, and you keep having to borrow pieces from each other, or someone builds a wall that someone else can't even see? It would be messy and slow, and you might accidentally use the same special brick for two different parts!

Instead, picture a giant, special LEGO table. This table isn't just a flat surface; it's like a magic storage system. All the bricks, special windows, doors, even the instruction manuals for different parts of the castle, are neatly organized right there on or around this one table. When you and your friends come to build, you all gather around this same table. No one brings their own small box of bricks; you all use the shared collection. This special table is what we call "file storage" in the computer world. It's a central place where all the "building blocks" (which are files like pictures, documents, or game levels) are kept.

The cool part about this shared LEGO table is that everyone can work on the same castle at the same time. You might be building a tower, your friend might be adding a drawbridge, and another friend might be working on the castle’s courtyard. All of you are using the exact same set of bricks from the table, and whatever one person adds, everyone else immediately sees it become part of the shared castle. This means you’re truly collaborating on one big project, not just working on separate pieces that you try to stick together later.

In the cloud, computer services like "Amazon EFS" or "Google Cloud Filestore" are like these amazing, never-ending LEGO tables. They let many different computer programs or "robot builders" work together on the same important files. For example, if you were making a video game, all the different parts of the game (the characters, the levels, the sounds) could be stored on one of these shared tables. Then, all the different computers helping to build or test the game can access and update those files together, making teamwork super easy and fast.

File storage, often referred to as Network File System (NFS) in traditional data centers, provides a familiar way to store and access files over a network. Unlike block storage (which treats data as raw disk volumes for a single server) or object storage (which handles individual files as objects via APIs), file storage allows multiple servers or applications to access the same shared file system simultaneously. Think of it like a shared drive on your company network where everyone can open, edit, and save documents in the same folders. This makes it ideal for scenarios where collaboration and shared access to data are critical.

In the cloud, services like Amazon Elastic File System (EFS) and Google Cloud Filestore offer fully managed, scalable file storage. These services abstract away the complexity of setting up and maintaining traditional NFS servers, providing highly available and durable file systems that automatically grow and shrink based on your needs. You can easily mount an EFS file system to multiple EC2 instances or a Filestore instance to multiple Compute Engine VMs, allowing them to read and write to the same files concurrently. This management aspect significantly simplifies operations for cloud architects.

Shared access patterns are where file storage truly shines. Imagine a web application running on several servers (e.g., WordPress). If each server had its own local storage for uploaded images or content, keeping them in sync would be a nightmare. With EFS or Filestore, all web servers can point to the same file system for content, ensuring consistency. Other common patterns include development environments where multiple developers need to access shared codebases, content management systems, shared logs, or media processing workflows where various stages need access to the same input/output files. This centralized access simplifies data management and ensures all instances operate on the most current version of the data.

Key Takeaways

  • File storage provides a shared, network-accessible file system, similar to traditional NFS.
  • Managed cloud services like EFS (AWS) and Filestore (GCP) simplify deployment and scaling.
  • Allows multiple compute instances to read and write to the same data concurrently.
  • Ideal for collaborative environments, web applications (e.g., CMS), and shared developer tools.

Code Example

bash
sudo mkdir /mnt/efs_share
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-0123456789abcdef0.efs.us-east-1.amazonaws.com:/ /mnt/efs_share

How this code works

This code connects a computer to a shared cloud storage drive, specifically an Amazon EFS (Elastic File System) volume. This allows multiple machines to access the same files from a central location, similar to plugging a shared USB drive into many computers at once, but over a network. The first command, sudo mkdir /mnt/efs_share, creates an empty folder named efs_share within the /mnt directory. This folder acts as a local placeholder; it's where the content of the EFS drive will become accessible once it's connected. sudo is used to grant administrative permissions, which are typically required to create directories in system paths like /mnt.

The second command, sudo mount, performs the core action of attaching the remote EFS file system to that local folder. The long address, fs-0123456789abcdef0.efs.us-east-1.amazonaws.com:/, identifies the unique network location of the EFS drive. A subtle but important detail here is the trailing /, which signifies that the entire root directory of the EFS file system is being mounted. The -t nfs4 specifies that the Network File System (NFS) version 4 protocol is used for communication, a standard for EFS. The -o flag introduces a series of detailed options, like nfsvers=4.1, which explicitly selects NFS version 4.1 for optimal compatibility and performance with EFS, and hard, which ensures the connection will persistently retry if there's a temporary network interruption.