Skip to content

SharePoint Best Practices

Chris Millar edited this page Nov 9, 2023 · 2 revisions

The following is a guide on SharePoint best practices.

Throttling

When doing any operation with MS Graph or SharePoint APIs, you should always consider rate limits. Often during development you may have a handful of files / operations, but this can give a false sense of rate limiting. In real world scenarios, authors will use your tool for hundreds or thousands of documents. This should be accounted for during development.

Handling locked files

You should never overwrite locked (or open / checked out) files. Any SharePoint app or service that runs into a 423 error should notify the author trying to perform an action. Ideally, you should surface the person who either has the file locked or the last person who modified the doc. You should provide either a report or immediate feedback to the author when encountering locked files. Handling locked or open files requires human intervention to either close or check-in the document.

User-based vs App-based permissions

Depending on the problem space, you will want to consider whether to use user-based permissions or app-based permissions. They both have advantages and disadvantages.

App-based permissions

  • Pro - Better rate limit thresholds.
  • Con - Requires a server-side component

User-base permissions

  • Pro - Simpler to implement (no server required)
  • Con - Easier to run into rate limit thresholds