|
|
|
|
|
by bcaxis
809 days ago
|
|
Sometimes API calls make 5-10 queries to the database. So it's 600ms to setup TLS and make a call at the origin server and the number of db calls is irrelevant.
Or a quick TLS connection to the edge and 1000-2000ms to fulfill because of db distance. Maybe you can do some of the calls in parallel, but sometimes not. Session lookup plus another query after permissions are established and your edge latency savings are almost entirely gone. Follow-up API calls will always be worse because TLS is a one time issue and db distance will continuously bite you call after call after call. Then there's a cold start where the edge function has to link up with the database and do it's own TLS or equivalent. Edge functions have a lot of issues you have to worry about that increase system complexity to solve. |
|