title: How to optimize size of big amount of data? Am I approaching this correctly?
body: <p><strong>Introduction</strong></p>
  
  <p>Let's assume that I have 1000 sensors. Each sensor sends measurements to my API every 1 minute. This API simply puts the values into my database.</p>
  
  <p>There will be:</p>
  
  <ul>
  <li>Static sensors - they're in one location and never moves.</li>
  <li>Dynamic sensors - their location can be changed every measurement.</li>
  </ul>
  
  <p>Some sensors measure air quality, humidity, temperature and pressure and some sensors measure only air quality. And maybe in the future there will be sensors which I don't know what they will measure yet.</p>
  
  <p><strong>Additional information</strong></p>
  
  <p>After gathering the data I want to represent them as a web heatmap. So, I probably want to be able to query database in the way that it will return the measurements in selected area.</p>
  
  <p>You can simply calculate that I will have 43.2M requests every month - which is about 1.4 GB. So the optimization of a size of the data which will be stored here would be appreciated.</p>
  
  <p><strong>I thought about making 3 tables:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Qbqnq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qbqnq.png" alt="database tables"></a></p>
  
  <p><strong>How am I going to deal with it?</strong></p>
  
  <p>There are 2 different tables - am_static_measurements and am_dynamic_measurements since there will be much more static sensors than dynamic (as for now, I believe) and I don't want to waste storage for the same localization data.</p>
  
  <p>If any sensor won't have (for example) pressure measurement, I will simply put NULL to the table and if some sensors will collect any other data which I didn't predict, I will just add another column to the table.</p>
  
  <p><strong>Questions</strong></p>
  
  <p>Is it good approach? Is relational database (MySQL) good for this? Any advises? Should I consolidate both am_static_measurements and am_dynamic_measurements into one table in order to have larger size of the stored data but easier requests?</p>