# Custom Provider

You already learned that document updates in Yjs are commutative, associative, and idempotent. Yjs doesn't care in which order document updates are applied, as long as all changes are applied eventually. It is the role of the provider to distribute or store updates generated by the Yjs document. A network provider sync document updates to other peers. A database provider syncs document updates to a database. In this tutorial, you will learn how to build your custom provider for Yjs. The [ Document Updates](https://docs.yjs.dev/api/document-updates) section is a prerequisite for this tutorial.

\[\[todo]]

Example: The simplest database provider

Example: The simples network provider

Recommendaditions

*

## TODO

* What a provider does
* Find a new analogy of blocks
* Network provider - y-protocols
* Database provider - tricks how to merge updates (after differential updates feature is finished)
* How to sync subdocuments
*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yjs.dev/tutorials/creating-a-custom-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
