Upstash supports the REST API in addition to the native Redis API. REST API helps developers to access their Redis without connection issues from serverless and edge functions. But if you execute multiple Redis commands in the same function then this means you will make a call to the database multiple times. One of our community members (@MasterGates) came with a great suggestion in our Discord channel. Pipeline API:
Pipeline API is just adaptation of Redis PIPELINE command to the REST API. You send multiple commands in a single http request, the responses are returned in a single request. This improves the performance of your application by reducing the RTT (round trip time) as well as decreasing the socket I/O.
Upstash guarantees the commands in the pipeline are executed in the same order. But the atomicity is not guaranteed. Commands sent by other clients can interleave with the pipeline. Some commands may fail while the remaining are executed with success.
Another limitation of pipeline API is your commands should be independent, so response of a command should not be needed by another command in the pipeline.