Glossary
Database
Section titled “Database”Connection pooling
Section titled “Connection pooling”- 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.
- There is
min_connectionandmax_connectionconfig available in DB, and most of the DB now offer connection pooling. It is best mechanism to optimise performance and reduce latency.
Auto expiring Data
Section titled “Auto expiring Data”- DB like Redis or DinamoDB offers
ttlon 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.
- 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.
Polling
Section titled “Polling”- 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)
Caching
Section titled “Caching”sd