title: firebase realtime schema design
body: <p>i have two set of entities in my firebase realtime schema. Called Orders and customers. </p>
  
  <p>so far i was not actually relating them in my app but was just showing them related. the current schema looked like:</p>
  
  <pre><code>{
  "orders" : [ 
               {"id" : 1, "name": "abc", "price": 200, "customer": "vik"}
             ],
  "customers" : [
                   {"cust_id" : "10", "name" : "vik", "type": "existing"}
                 ]
  }
  </code></pre>
  
  <p>so i have a orders list page showing all the orders in a table  which i get firing /orders.json </p>
  
  <p>But practically, instead of having the customer name directly in the orders i should have cust_id attribute as that is the key. </p>
  
  <p>That naturally makes it a standard relational schema where i will be free to change customer attributes without worrying about mismatch in orders.</p>
  
  <p>However, the downside i see right away is that if i have say 20 orders to show in the order list table then instead of 1 i will end up firing 21 rest calls (1 to get order list and 20 to fetch customer name for each of the order)</p>
  
  <p>What are the recommendations or standards around this ? </p>