Functional requirement
I have devices . Each device, roughly, has its unique identifier, an IP address, and a type.
I have a pings routine for every device that has an ip address. This routine is nothing more than a C # executable, which runs every 3 minutes and attempts to ping the device's IP address.
The result of ping I need to save to the database, as well as the date of the check (regardless of the ping result).
Technical part:
Assuming my ping and bank structuring process is ready from 01/06/2016, I need to do two things:
- Daily extraction (which is a fed table)
- Extraction in real time (last 24 hours)
Both should return the same thing to me:
- Devices that have been unavailable for more than 24 hours.
- Devices that have been unavailable for more than 7 days.
The device that is pinged does not respond to ping .
It is understood that the device that pinged successfully responded ping .
What I have today and it works very badly:
A historico_disponibilidade
table, with the following structure:
create table historico_disponibilidade (id_dispositivo number, respondeu number, data date);
This table has a large amount of data (today it has 60 million, but the tendency is to grow exponentially)
The questions:
- How to achieve such goals without running into problems of slowness in queries?
- How to create a table structure (s) that is prepared to receive millions / billions of records within my corporate universe?