Reputation: 272
I'm using node.js with aerospike in a networking application. When a user post, mention or follow I have to do job on timelines or/and notifications. I would like to run these jobs after node.js has sent a response to the client.
I run about task managers and message brokers and I'm not sure to understand
So my question is because operations in node.js are asynchronous and aerospikeis synchronous and multithread-> Is it a bad idea to just send the response to the client and then make these jobs with aerospike (or may I lose something with replications,cloud,etc)
Or I'm forced to use a RabbitMQ like?
Upvotes: 1
Views: 268
Reputation: 3567
The asynchronicity of node.js does not interfere with the synchronicity of Aerospike server. It is just the behavior of the client and how the APIs are designed. It does not effect the functionality on the server side. Some of Aerospikes clients (like java) offer both synchronous and asynchronous API.
Coming to the second half of the question, you seem to be thinking of responding to client first and then triggering a job on Aerospike. This is not aerospike specific, but the only risk I see is that you might have responded with a "success" message to the client but the server side job may fail for whatever reasons (timeout, mem/disk full, network failure, server down etc). If you are ok with this risk, I do not see any other major issue.
Upvotes: 2