Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3667

increase python REST requests efficiancy

$
0
0

before, I used SQL joins to get data, and 10.000 lines would take fraction of a second.

select name,       profession.expertise,       resonsible.name,       building.lockerfrom techniciansjoin profession on technicin.profession = profession.idjoin responsible on techician.responsible = responsible.idjoin building on technician.locker = buiding.id

with migration to the cloud, I no longer have access to this DB and need to go via rest. unfortunatelly, translating this into python REST requests, even just for 50 lines, results in 20s of stall, 10000 lines would just be hours!? Because I have to itterate through all the results and request the related relationship link data, right?

pseudo python

result_list = requests.get("https://sample.com/api/v1/technicians")for technician in result_list:    professn = requests.get("https://sample.com/api/v1/technicians/technician_ID/profession")    resopnsible = requests.get("https://sample.com/api/v1/technicians/technician_ID/responsible")    building = requests.get("https://sample.com/api/v1/technicians/technician_ID/building")

question: am I doing something wrong regarding the requests I make?


Viewing all articles
Browse latest Browse all 3667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>