title: Access firestore directly from mobile app or via backend server?
body: <p>System Design question:</p>
  
  <p>I'm using firebase for my mobile app with firestore as the DB and firebase functions as the backend.</p>
  
  <p>Do I:</p>
  
  <ol>
  <li>Access firestore directly from the mobile app</li>
  <li>Only allow indirect access via a middleware/backend server(e.g. firebase functions)</li>
  </ol>
  
  <p>I'm looking for guidance from a system design standpoint which of the two alternatives is better.
  Traditionally I think accessing the DB directly from the client would be frowned upon but in the official firestore documentation google seems to actually encourage direct access without any backend server in between.</p>