The server I developed with golang is divided into two categories when accessing the database. One category is data with redis cache, which is generated very frequently, but inserted into the database in real time is not required. The other category is business data, which must be written and read in real time.
Is there a mechanism to set different priorities to ensure that access to business data has a higher priority, while redis cached data updates have a lower priority?
No, there are no priorities in PostgreSQL.
To avoid the database being swamped with Redis cached data, give that application a connection pool that is small enough. Then there will be enough resources left for the important data.