Skip to content

Glossary

  1. Always do the connection pooling, Task we wanna do may take less time than a server requires time and resources to do the TCP connection with database.
  2. There is min_connection and max_connection config available in DB, and most of the DB now offer connection pooling. It is best mechanism to optimise performance and reduce latency.
  1. DB like Redis or DinamoDB offers ttl on per row basis, so that we can get rid of the data after its expiration instead of having a full blown Cron Job doing it.
  1. It’s good idea to have a batch API if same API is being called multiple times with different param. for e.g. find online status of user u1, u2, u3. Instead of returning one users info at a time, we will have a batch call which returns data for all the users.
  1. Client frequently polls the data asking if it completed the job and if data is available instead of using Web socket or SSE (Server sent events)

sd