

You can then create several database instances in advance and use the Additionally, users in each organization onlyĬonnect to their organization's database when they use the chat app. In this case, organization A and organization B don't share data, there isn'tĪny duplicate data in your databases, and you only perform queries against a You can create a database instance for each organization and store all the chat Store data in siloed database instances, grouped by user or data type.įor example, if you build a chat application that serves multiple organizations,

Have more overhead than directly connecting to the particular database Instance corresponds to the connecting client. This way, you can programmatically look up which database Store a map of how your data is stored acrossĭatabase instances. Each app instance only connects to one database at any given moment.Īs you're mapping your data, consider applying the following strategies: Create a "master shard".No sharing or duplication of data across database instances.Realtime Database doesn't support queries across database instances. Each query only runs against a single database instance.When you're mapping your data to multiple databases, try to satisfy the Configure your app so it connects to the Realtime Database instance necessary.Map your data to multiple databases according to your app's specific needs.To shard your data, follow these steps (described in greater detail below): Reduce the risk of overloading a single database instance.


