title: Algolia backend search or frontend search when an user ID is involved
body: <p>I have my records stored in the Algolia index having a <code>userID</code> attribute associated with each. I want to perform a search such that the records visible to the user will be filtered such that the <code>userID</code>s match. I can easily do this on the frontend using the <code>instantsearch</code> library and the <code>userID</code> stored in localStorage.</p>
  <p><strong>Problem with passing userID on the frontend</strong><br />
  Anyone using the client can manipulate the Algolia request with different <code>userID</code>s that will filter results relevant to those IDs. A security issue here. But as Algolia mentioned <a href="https://support.algolia.com/hc/en-us/articles/4406981933457-Searching-from-the-front-end-or-the-back-end-What-do-you-recommend-#:%7E:text=be%20up%20to-,10x%20faster,-for%20the%20end" rel="nofollow noreferrer">here</a> frontend search can be upto 10x faster.</p>
  <p><strong>Solution using backend search</strong><br />
  Can implement this such that a normal HTTP request is send to the backend with the relevant search parameters and filters and adding the <code>userID</code> in the backend. After that doing the search in the backend and sending the data back to the frontend using a HTTP response. Slower since it has go through multiple servers just to add the <code>userID</code>.</p>
  <p><strong>Question</strong><br />
  I want to know if there is a still a workaround for this using frontend search and preserving security since speed is also important. I'm new to using Algolia and still not fully aware of what it is capable of.</p>
  <p>Thanks.</p>