Giacomo
TTCTheo's Typesafe Cult
•Created by Giacomo on 5/20/2023 in #questions
Simple server solution when serverless is not enough
I am building an app and I need to connect it to either BigQuery or ClickHouse.
Fetching this data warehouses from Next js api folder seem to had connection overhead on every request which makes it slower and more expensive.
Does Theo, or anyone else have a good solution for this?
I guess the reasonable solution would be to have a server always running, what solution would you recomend for this?
For context
Connection Overhead: Serverless environments are designed to handle short-lived, stateless requests. They typically spin up instances on-demand and terminate them after the request is processed. If you connect to ClickHouse from a serverless function, each request would need to establish a new connection, incurring additional overhead. This could impact performance, especially if you have frequent or concurrent requests.
4 replies