title: Which AWS services should I use for multiple small CSV file data query (cost effective way)
body: <p>I have my Postgres DB with daily increasing data(approx 500 rows added per day) in following format </p>
  
  <pre><code>Timestamp,Val1, Val2, Val3, Val4, Val5
  --------------------------------------------
  1494410340000,1360,1362,1359.2,1354.2,28453
  1494410340000,1360,1362,1359.2,1354.2,28453
  1494410340000,1360,1362,1359.2,1354.2,28453
  </code></pre>
  
  <p>Every End of Day, I can write these data to AWS S3 as CSV file
  Each CSV file contains data in above format for that day.
  10May.csv, 11May.csv
  12May.csv and so on.</p>
  
  <p>These files will be hardly 25 KB each.</p>
  
  <p>I want to store the above data in AWS and allow client to directly get filtered N number of rows</p>
  
  <p><strong>For example:</strong> client can request for data between <strong><em>10May 11 A.M.</strong> to <strong>11May 3 P.M</em></strong></p>
  
  <p>Basically I need to mimic this query on multiple CSV files: </p>
  
  <pre><code>select * from allcsvdata where timestamp between Ts1 and Ts2
  </code></pre>
  
  <p>Relevant things i have found so far: </p>
  
  <ol>
  <li>AWS Athena -> Read csv and query then return result [min charge for
  10MB per scan :(]</li>
  <li>AWS Gateway -> AWS Lambda fn -> Read file from S3
  and return result</li>
  </ol>
  
  <p><strong>What would be better approach to this situation. 70% queries will require multiple days data [reading multiple csv files].</strong> </p>
  
  <p>So should I append all data in single file and use Athena ?</p>
  
  <p>Or should I get an EC2 with presto? </p>
  
  <p>Or Any other architecture to suit this need ?</p>
  
  <p>I am open to suggestions, let me know if any other details are required?</p>