Skip to content
Browse all topics
SharePoint & OneDrive

SharePoint document libraries — a deep dive

By Emil Björk · Microsoft ecosystem consultant, Gothenburg

Document libraries are the workhorse of SharePoint. Here's what they actually do beyond "a folder in the cloud."

4 min read

Share as imagePNG

A document library in SharePoint Online looks like a folder full of files. Under the hood it's a structured list with rich metadata, versioning, and permissions — and once you treat it as such, much more becomes possible.

What a library actually is

Every document library is a list of items, where each item is a file (or folder). Each item has built-in columns (Name, Modified, Modified By) and can have custom columns you define — text, number, choice, person, date, taxonomy. Custom columns let you tag content for search, filtering, and views.

Views

Views are saved configurations of columns, filters, sorting, and grouping. The same library can have a flat view for everyone, a grouped-by-project view for the PMO, and a filtered "my documents" view. Modern SharePoint also supports:

  • Tiles view for visual content libraries.
  • Conditional formatting with column-based highlighting.
  • JSON formatting for custom rendering of column values.

Views are surfaced as URLs, so you can bookmark or link to a specific view.

Versioning and history

Document libraries keep major version history by default (up to 500 versions). Older versions are recoverable in place. You can also turn on minor versions (drafts vs published) for content that needs an approval flow.

Co-authoring

Office files in a SharePoint library are co-authored — multiple users can edit simultaneously in Word, Excel, or PowerPoint, both in the desktop and web apps. Locking, presence, and merge happen automatically.

Approvals, retention, and labels

A library can have:

  • Content approval — items aren't visible to non-editors until approved.
  • Retention policies from Purview applied automatically.
  • Sensitivity labels at the file level, inherited from defaults or applied by users.
  • Information barriers to prevent specific groups from accessing.

Sync, share, and the file explorer experience

Libraries can be synced to a workstation via OneDrive's sync client, and added as a shortcut to a user's OneDrive (the "Add shortcut to OneDrive" button). Both feel like local folders to the user but are still subject to all the SharePoint permissions, retention, and policies above.

Treating a library as "just a folder" works until it doesn't. Once the metadata, views, and policies are in place, you're using SharePoint the way it was designed.

Content types

A content type is a reusable, named bundle of columns, document templates, and workflow/retention behaviour that can be attached to multiple libraries across a site or a whole site collection — defined once (say, "Contract," with columns for counterparty, expiry date, and value) and reused everywhere contracts live, rather than recreating the same columns library by library. Content types are what make Purview retention labels and DLP policies scale sensibly across many libraries: label a content type once, and every library using it inherits the behaviour, instead of an admin configuring retention per library by hand.

Storage and the "list view threshold" in practice

The 5,000-item view threshold isn't a hard cap on library size — libraries scale to millions of items — but it does mean library structure has to be designed with views in mind from the start, not retrofitted after the fact. A flat library with a single "all items" view and no indexed columns will simply stop returning results once a folder or filtered set crosses 5,000 items, with an error rather than a slow query. The fix is either an indexed column on whatever field is filtered most often (department, status, date), or splitting genuinely distinct content into separate libraries rather than one library growing without any metadata-driven filtering at all.

Frequently asked questions

Can a document library be restored if content is deleted by mistake? Yes, in layers: the site's own recycle bin holds deleted items for 93 days (recoverable by anyone with edit rights), a second-stage recycle bin extends that window further for site admins, and version history separately lets you roll back an overwritten file to an earlier version without needing to restore a deletion at all.

How many document libraries should one site have? As few as the actual access-control boundaries require — a common mistake is creating a new library per project or per team within a single site when a single library with metadata columns (project name, team) and filtered views would serve the same navigational need with far less administrative overhead, reserving a genuinely separate library for content that needs distinct permissions or retention behaviour from the rest of the site.

Frequently asked questions

What is the SharePoint list view threshold?
5,000 items in a single view or query is the point where SharePoint requires an indexed column or filtered view to return results; libraries can hold up to 30 million items, but views and sync behave badly beyond a few hundred thousand. Design libraries and folders so views stay under the threshold.
Should we use folders or metadata in SharePoint?
Both, in moderation. Metadata (columns, content types) enables filtering, views, and search; folders enable simple navigation, sync, and per-folder permissions. Deep folder trees hit path-length limits and hide content; flat libraries with metadata are the recommended pattern, with a few folders for humans.
How does versioning work in document libraries?
Every save creates a version (500 major versions by default, configurable); users can view and restore versions. Since 2024, intelligent versioning trims old versions automatically to save storage. Versions count against storage quota.

Further reading

Microsoft Docs & product blog

Was this useful?

Spot something wrong or want a topic covered? Send it through the contact form.