I'm developing a GIS web application, and I have a flask backend that connects to Neo4j. Since all docs used by the user are csv, I have 2 options:
- Convert csv to json and send it as variable through query
- Create an API endpoint to access the csv (temporary saved in a variable) and then, sending the query to say Neo4j to load the resource available at that endpoint's url.
I think the max. performance can be achieved sending directly the csv file directly by the driver, similar to how it's done with json. So, I'm in this dilema, what is the best approach?
The option 1 has the drawback of converting the file and all processes that handle with json can be slower (specially in a large files). But in the option 2, I need to send a query first and only after that the Neo4j will curl the file available at the endpoint. Also, I will need to add protection to the endpoint, using tokens or uuids.