# associated Firebase data with Users

associated Firebase data with Users [How to Connect Firebase Users to their Data - 3 Methods](https://youtu.be/2ciHixbc4HE)

* Keep data shallow in NoSQL vs SQL
* use auth state to get current user id. And then can do queries based on that auth state, for items nested under that user id.
* firebase security rules on firestorm

Other option

* adding user id on the item&#x20;

Multiple users

### ADR around reasoning to design of schema and security

{% embed url="<https://github.com/bbc/digital-paper-edit-firebase/blob/master/docs/ADR/2019-12-02-nosql-schema-security.md>" %}
ADR around the NoSQL Schema
{% endembed %}

### Example of implementation

{% embed url="<https://github.com/bbc/digital-paper-edit-firebase/blob/master/firestore.rules>" %}
Security Rules
{% endembed %}


---

# 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://textav.gitbook.io/firebase-react-notes/firestore/associated-firebase-data-with-users.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.
