title: Filters logic should be on frontend or backend?
body: <p>I’m creating a web application </p>
  
  <p>Frontend - reactjs and backend java. </p>
  
  <p>Frontend and backend communicate with each other via rest.</p>
  
  <p>On UI I show a list of items. And I need to filter them for some params. </p>
  
  <p><strong>Option 1: filter logic is on front end</strong></p>
  
  <p>In this case I just need to make a get call to backend and get all items. 
  After user choose some filter option filtering is happening on ui.</p>
  
  <p><strong>Pros</strong>: for that I don’t need to send data to back end and wait for response. Speed of refreshing the list should be faster. </p>
  
  <p><strong>Cons</strong>: If I will need multiple frontend clients. Let’s say a mobile app. Than I need to create filters again on this app too. </p>
  
  <p><strong>Option 2: filter logic is on back end</strong></p>
  
  <p>In this case I get all list items when app is loading. After user changes the filter options I need to send a get request with filters params and wait for response.
  After that update a list of items on UI.</p>
  
  <p><strong>Pros</strong>: filter logic is written only once. </p>
  
  <p><strong>Cons</strong>: Speed probably will be much slower. Because it takes time to send request and get a result back. </p>
  
  <p><strong>Question</strong>: Where the filter logic should be? In frontend or in backend? Or maybe what is a best practice?</p>