🧭 Guides

How cloud storage actually works: syncing, data centers, encryption and deleted files

What happens when you save a file to iCloud, Google Drive or OneDrive: how syncing works, where your files live, how they are encrypted and what happens when you delete them.

Guides: How cloud storage actually works: syncing, data centers, encryption and deleted files

In short

"The cloud" is simply someone else's computers. When you save a file to iCloud, Google Drive or OneDrive, an app on your device sends a copy over the internet to servers in the provider's data centers. The service then syncs that copy to every device signed in to your account, so a photo taken on your phone appears on your laptop.

Your files are encrypted on the way and while stored. In most cases the provider also holds the keys. When you delete a file, it usually sits in a trash folder for about 30 days before the provider removes it for good.

Step by step: what happens when you save a file

  1. You save or take a photo. The file lands on your device first, like any other file.
  2. The sync app notices. A small program, built into the phone or computer, watches certain folders for changes.
  3. The file is uploaded. The app sends the file, or just the changed parts of it, to the provider over an encrypted connection.
  4. The data center stores it. The provider writes your file to its storage systems, usually keeping extra copies so one broken disk does not lose anything.
  5. Your other devices update. Each signed-in device checks for changes and downloads the new version, or just a placeholder until you open it.

Steps 3 to 5 happen in the background, often within seconds on a good connection. If you are offline, the app queues the change and catches up later.

What syncing really means

Syncing keeps the same set of files on every device. It works in both directions: change a file on your laptop and the change reaches your phone; change it on your phone and it reaches your laptop.

That is convenient, but it has a consequence people often miss: deletions and mistakes sync too. If you delete a folder on one device, it disappears from all of them. If ransomware scrambles your files, the scrambled versions can sync up as well. Most services soften this with version history and a trash folder, but only for a limited time.

That is why sync is not quite the same as a backup. Our guide to backing up your phone and computer with the 3-2-1 rule shows how to add a separate copy.

Files "on demand"

Many services save space by keeping only a placeholder on your device. You see the file name and icon, but the full file downloads only when you open it. OneDrive calls this Files On-Demand, Apple can optimize storage on Macs and iPhones, and Google Drive for desktop can stream files. This is handy on a small laptop drive, but it means those files are not available offline unless you mark them to keep.

If your phone is short on space, our tip on freeing up storage on your phone explains how to use these settings safely.

Inside a data center

A data center is a large, secured building full of servers, storage drives, cooling and backup power. The big providers run many of them around the world.

A few things make your files safer there than on a single home drive:

  • Redundancy. Data is usually stored on several drives, and often in more than one building, so hardware failures do not lose files.
  • Physical security. Access is controlled, monitored and logged.
  • Professional maintenance. Failed drives are replaced and systems are patched by staff whose full time job it is.

What a data center cannot protect against is you losing access to your account, or you deleting something yourself. Those are the real risks for most people.

How your files are encrypted

Encryption turns your file into scrambled data that is useless without the right key. Cloud services use it in two places:

  • In transit: while the file travels between your device and the data center, so nobody on the same Wi-Fi or along the internet route can read it.
  • At rest: while it sits on the provider's drives, so a stolen disk would be unreadable.

The key question is who holds the keys.

Type Who holds the keys What it means
Standard encryption The provider Protects against outsiders. The provider can help you recover your account, but could technically access the files
End-to-end encryption Only your devices The provider cannot read the data, even in a breach. If you lose all your keys and recovery methods, the data cannot be recovered

Apple is a clear example. With standard data protection, Apple says iCloud data is encrypted in transit and stored encrypted, with the keys secured in Apple's data centers. Some categories, such as passwords and Health data, are end-to-end encrypted by default. Turning on Advanced Data Protection raises the number of end-to-end encrypted categories to 25, including iCloud Backup, Photos and Notes. Apple notes that it then does not have the keys to help you recover that data, so you must set up a recovery contact or recovery key first.

To turn it on: on iPhone, open Settings, tap your name, then iCloud, scroll down to Advanced Data Protection and tap Turn on Advanced Data Protection.

Whatever service you use, the account password is the real front door. Use a password manager and strong two factor authentication, or switch to passkeys where offered.

What happens when you delete a file

Deleting a cloud file is usually a two stage process.

Stage 1: the trash. The file moves to a trash or recycle bin, where you can still restore it.

Service Where deleted files go How long you have
Google Drive Trash Deleted forever after 30 days
OneDrive (personal account) Recycle bin 30 days
OneDrive (work or school) Recycle bin 93 days, unless the administrator changed it
iCloud Drive Recently Deleted on iCloud.com Recoverable within 30 days

Stage 2: permanent deletion. When the time runs out, or you empty the trash yourself, the provider removes the file. Google, Microsoft and Apple each say that permanently deleted files cannot be recovered through their normal tools.

Two practical details:

  • Trash still uses space. Google says files in Drive's trash count toward your storage until they are permanently deleted.
  • Rolling back is possible on some plans. Microsoft says Microsoft 365 subscribers can restore their entire OneDrive to any point in the last 30 days, which helps after ransomware or a mass deletion.

How to restore a deleted file

  • Google Drive: on a computer, open Trash in Drive, find the file and choose Restore.
  • OneDrive: on the OneDrive website, open Recycle bin, select the item and choose Restore.
  • iCloud Drive: go to icloud.com/iclouddrive, select Recently Deleted in the sidebar, then Recover.

What fills your cloud storage

Free cloud plans are small, and they fill up faster than most people expect. The usual culprits are:

  • Photos and videos. Every picture synced from your phone counts, and videos are many times larger than photos.
  • Device backups. Phone backups stored in the same account share the same space.
  • Email attachments. With some providers, such as Google, email and file storage share one allowance.
  • Files in the trash. As noted above, deleted files can still count until the trash is emptied.

When storage is full, new photos stop uploading and backups stop running, and it is easy to miss the warning. Check the storage page in your account settings every few months, and decide whether to tidy up or pay for more.

Moving to a different provider

You are not locked in forever. Every major service lets you download your files, and some offer direct transfers. Apple, for example, lets you request a copy of your iCloud Photos to be sent to another service such as Google Photos. Apple says most transfers take three to seven days, though some take up to 30, and that you cannot export photos this way while Advanced Data Protection is turned on.

Before you switch:

  1. Make sure the new account has enough space.
  2. Copy everything across and check that a sample of files and albums arrived intact.
  3. Keep the old account until you are sure nothing is missing.
  4. Only then delete the old copies, remembering that they may sit in the trash for a while.

Common mistakes

  • Treating sync as a backup. A deletion on one device deletes everywhere.
  • Emptying the trash to free space without checking it. Once it is gone, it is gone.
  • Turning on end-to-end encryption without a recovery plan. Set up a recovery contact or key first.
  • Ignoring "storage full" warnings. When storage is full, new files and backups stop syncing.
  • Weak account security. The strongest encryption does not help if someone can sign in as you.

The short version

Cloud storage copies your files to servers in data centers and syncs them to your other devices. Files are encrypted on the way and at rest, and with end-to-end encryption only your devices hold the keys. Deleted files usually wait in a trash folder for around 30 days, then are gone for good. Keep a separate backup, protect the account, and know where your service's trash folder is.

Frequently asked questions

Where are my cloud files actually stored?

On servers in large data centers run by the provider, such as Apple, Google or Microsoft. Providers usually keep more than one copy, often in different buildings, so a single failed disk does not lose your files.

Is cloud storage encrypted?

Major services encrypt files while they travel to the data center and while they are stored. In most cases the provider also holds the keys. With end-to-end encryption, such as Apple's Advanced Data Protection, only your devices hold the keys.

What happens when I delete a file from cloud storage?

It usually goes to a trash or recycle bin first. Google Drive keeps it for 30 days, OneDrive keeps files for 30 days on personal accounts, and iCloud Drive lets you recover files deleted in the last 30 days. After that, or if you empty the trash, the provider says it cannot be recovered.

If I delete a synced file on my laptop, does it disappear from my phone?

Yes. Syncing copies every change, including deletions, to all your signed-in devices. That is why sync alone is not a full backup.

Do deleted files still count toward my storage?

Often yes. Google says files in Drive's trash still count toward your storage until they are permanently deleted. Empty the trash if you need space quickly.

Can the cloud provider see my files?

With standard encryption, the provider holds the keys and could technically access files, for example to comply with legal requests or to help you recover your account. With end-to-end encryption, the provider cannot read the protected data.

Sources

  1. Apple Support: iCloud data security overview
  2. Apple Support: How to turn on Advanced Data Protection for iCloud
  3. Apple Support: Recover deleted files on iCloud.com
  4. Google Drive Help: Delete files in Google Drive
  5. Google Drive Help: Recover a deleted file in Google Drive
  6. Microsoft Support: Restore files deleted from your OneDrive
  7. Apple Support: Transfer a copy of your iCloud Photos collection to another service