Wednesday, 6 February 2019

Is there a way to take data from a database in a similar way to taking an item off a queue?

Hi allI'm using node for this, but it's not strictly a node question. But I think maybe some of you have had an issue like this before.I have a lot of experience taking items from queues (e..g RabbitMQ), processing the data, and doing something with it (e.g. inserting into a database).This time I need to take data from a database, process it, and then put it back in the database.I'm hoping there is some way I can sort of simulate the behaviour of a queue. So something like this:Take 1 item. See if it needs to be processed. Process it. Put it back in the database. Repeat.So it would work its way through the records one by one, based on some where clause. For example, records created over 5 hours ago, which haven't been processed yet.Have you ever come across anything like this? Can you think of a solution?I'm using MySQL with node.Thanks for your advice.

Submitted February 06, 2019 at 04:13PM by TuckerMcInnes

No comments:

Post a Comment