Re: Pulling data from Postgres DB table for every 5 seconds. - Mailing list pgsql-general

From github kran
Subject Re: Pulling data from Postgres DB table for every 5 seconds.
Date
Msg-id CACaZr5Ta1S_wXm-ZaA=2pQU+rsR_tzN5d4NWdju8JYxX-qNnEQ@mail.gmail.com
Whole thread Raw
Responses Re: Pulling data from Postgres DB table for every 5 seconds.  (Rob Sargent <robjsargent@gmail.com>)
Re: Pulling data from Postgres DB table for every 5 seconds.  (Ron <ronljohnsonjr@gmail.com>)
Re: Pulling data from Postgres DB table for every 5 seconds.  (Mark Fletcher <markf@corp.groups.io>)
Re: Pulling data from Postgres DB table for every 5 seconds.  (Tony Shelver <tshelver@gmail.com>)
List pgsql-general

Hi Postgres Team,

I have an application using RDS Aurora Postgresql 9.6 version having 4 TB of DB size. In this DB we have a table PRODUCT_INFO with around  1 million rows and table size of 1 GB.
We are looking for a implementation where we want to pull the data in real time for every 5 seconds from the DB ( Table mentioned above) and send it to IOT topic whenever an event occurs for a product. ( event is any new product information or change in the existing 
product information.). 

This table has few DML operations in real time either INSERT or UPDATE based on the productId. ( Update whenever there is a change in the product information and INSERT when a record doesnt exists for that product).

We have REST API's built in the backend pulling data from this backend RDS Aurora POSTGRES DB and used by clients. 

UseCase
We dont want clients to pull the data for every 5 seconds from DB but rather provide a service which can fetch the data from DB in real time and push the data to IOT topic by pulling data for every 5 seconds from DB.

Questions
1) How can I get information by pulling from the DB every 5 seconds without impacting the performance of the DB.
2) What are the options I have pulling the data from this table every 5 seconds. Does POSTGRES has any other options apart from TRIGGER ?.


Any ideas would be helpful.

Thanks !!
GithubKran

pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: (multiplatform) replication problem
Next
From: Rob Sargent
Date:
Subject: Re: Pulling data from Postgres DB table for every 5 seconds.