title: Firebase User photoURL and displayName
body: <p>I'm having a time trying to wrap my head around what I thought was a simple concept. </p>
  
  <p>I have an app where I sign up a user, allow that user to set a 'photoURL' to their 'user' information in the Firebase Auth system. This works. When the user creates a post in my app, I want to display the title, image and 
  'photoURL' of the creator. </p>
  
  <p>Currently, I save the post:</p>
  
  <pre><code>-Post {
   -id
   -title
   -image
   -photoURL &lt;- from current logged in user }
  </code></pre>
  
  <p>I also allow users to visit the posters page via routing /poster/'displayName'</p>
  
  <p>So later, when a user updates their profile information like displayName or photoURL, do I need to go find all posts, comments, messages, replies and any other place that this user has a record and update the photoURL?</p>
  
  <p>What I thought I would be able to do is say: (pseudo code)</p>
  
  <pre><code>get all posts =&gt;
   foreach(post)
     post = {
            title: post.title.val()
            image: post.image.val()
            avatar: firebase.database().ref().child('users' + post.key)
            }
  </code></pre>
  
  <p>Everything I read says I need to store that photoURL in my own 'Users' table. If I do that, then none of the posts get updated unless I write a server call to do that every time there is a change. Problem is, if I have 100K users, and 10% of them change their photoURL, I then have to change it in posts, comments, replies and messages per user. If the average user has 100 posts, 4000 comments, 6000 replies, we're looking at about 10K places * 10K users that have to be updated and if the average server call is 137ms, then my costs are around $175 (<a href="https://firebase.google.com/pricing/" rel="nofollow noreferrer">costs</a>)</p>
  
  <p>The other option is to pull information from two tables and create a new object every time. This would lead to about double the server calls and time thus doubling my costs. </p>
  
  <p>Is this the best approach for this? I thought this would be a lot easier to just get the user photo and display name. </p>
  
  <p>Sorry for the epic long post but I'm trying to learn. Thanks all!</p>