S
S
semki0962018-03-10 17:28:21
MySQL
semki096, 2018-03-10 17:28:21

How to organize daily temperatures database in mysql?

Task.
1. I take the air temperature in different cities through the API service. And you need to write them to the database. This must be done every hour.
2. Data must be for one year, everything older must be deleted.
The question is how to schematically build a database. The first thing that came to my mind was to make a separate page with cities. Then make a linked table with temperatures (temperature field, time, city id), link through the city id field.
The question is that the table with temperatures will be just huge, because data will be written every hour. How it is correct to build and optimize for fast sampling and issuance?
Maybe someone has a similar experience and can share?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2018-03-10
@semki096

The general rule is first normal form, then denormalization. Not vice versa.
Perhaps it's better to look at the time-series database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question