Reputation: 799
I've two Applications: App#1 e App#2. They exchange data using an Oracle DB, that is App#1 write data in a table and App#2 reads from it. There are multiple tables but in every of them only one App have write permission, and the other App reads the data and delete them after the reading so I think I don't have any data integrity problems.
How can I check for new data? The only solution I'm thinking of is doing a polling of the tables every X seconds.
Upvotes: 0
Views: 53
Reputation: 43254
Don't use a database. Use a messaging system, such as EasyNetQ
If you can't do that, then your next best option is to add triggers to the tables, and have those triggers update a status table. App2 then only needs to poll the one table for changes.
It may be possible to use Continuous Query Notification or Database Change Notification. Then the application is notified of changes and no polling is required.
If you can't change the database, you are pretty much stuck having App2 poll all the tables for changes periodically.
Upvotes: 1
Reputation: 4344
I will suggest to to poll DB at configured interval so have better control.
And create two set of tables like MyData and MydataProcessed as soon as you process successfully data received in the MyData move that record to the MydataProcessed, this makes polling on MyData table lite and still you have full history of data exchange in the MydataProcessed table.
Upvotes: 0