When does it make sense to use a database for a job queue?

I am designing an internal company website where users can submit tasks for computing. An important factor in my design is to keep the job in the queue until it is completed, even if the system crashes.

The internet seems to be against the idea, as it is “not the goal of the database” and is better suited for a key / value store like Redis (or a job queue that uses Redis like Kue for Node.js). I think I get it in the sense that the goal of this project is not to overload the database with read / write for fairly temporary data, as you might find in the job queue. In my use case, although database usage would be pretty low, and it seems that saving the data that the database offers is the key function I'm looking for here.

In my reading, I found that some key / value stores, such as Redis, have a persist function, but are not really created to guarantee that all data will be restored if the system crashes.

Am I missing something or does it sound right?

+4
source share
1 answer

In my reading, I found that some key / value stores, such as Redis, have a persist function, but it is not built to make sure that all data is restored if the system goes down.

In Redis, data is saved from memory to disk using a background stream. In fact, a system down will not damage your database, but the problem is that the system may sink before or during a snapshot to disk and you will lose all the data created after the last successful snapshot.

, Redis 99,9% , , .

, : , NoSQL, SQL, . , RabbitMQ.

+1

Source: https://habr.com/ru/post/1651633/


All Articles