This question might be a little too subjective, but I am looking for an optimal way to send millions of datapoints to a flask API.
My current approach is essentially as follows:
- Send a list of data points that are JSON objects, as well as sending some information that pertains to all of the data points such as the person it was collected on and the date it was collected
- This updates two tables, a
Use
table that records the person, date, etc. and then aData
table that associates data points to a given use. This all occurs as one POST request to theUse
endpoint
I'm afraid that with this approach it might timeout when sending millions of datapoints.
I'm looking for a way to combat this, some ways I have been considering are
- Sending an initial POST request to create the
Use
, then sending the datapoints in patches as a PATCH to the same endpoint or a POST to a newdata
endpoint - sending a csv in a POST request and then parsing through the csv on the server
Haven't been able to find any similar questions online, so looking to see if there is an industry standard or best practice when doing something like this