Hello,
for a traffic accounting system I need to store large amounts of datasets about internet packets sent through our gateway router (containing timestamp, user id, destination or source ip, number of bytes, etc.).
This data has to be stored for some time, at least a few days. Easy retrieval should be possible as well.
What is a good way to do this? I already have some ideas:
Create a file for each user and day and append every dataset to it.
- Advantage: It's probably very fast, and data is easy to find given a consistent file layout.
- Disadvantage: It's not easily possible to see e.g. all UDP traffic of all users.
Use a database
- Advantage: It's very easy to find specific data with the right SQL query.
- Disadvantage: I'm not sure if there is a database engine that can efficiently handle a table with possibly hundreds of millions datasets.
Perhaps it's possible to combine the two approaches: Using an SQLite database file for each user.
- Advantage: It would be easy to get information for one user using SQL queries on his file.
- Disadvantage: Getting overall information would still be difficult.
But perhaps someone else has a very good idea?
Thanks very much in advance.