A
A
Alline2020-10-19 15:39:15
PHP
Alline, 2020-10-19 15:39:15

Is this architecture normal?

I want to understand, skis do not go or how.
There are two ̶s̶t̶u̶l̶a̶ servers with applications on yii2. One accepts a bunch of messages from users, adds them to the database and does nothing else.
On another server, yii knocks on the database in an endless loop (the bash script pulls the console command). Pulls out the latest messages from there, then puts them in the rabbit's queue. And then the rabbit pulls a new controller that sends pushes.

It blew my mind a little. Isn't it more logical to immediately add a message to rabbitmq from the first application? Without jerking the base in an endless loop. As far as I'm concerned, this is bullshit. But maybe I don't understand? Can such a scheme be theoretically justified?
The people who wrote this have already quit, there is no one to ask for details. And in general, everything is overgrown with grass

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-10-19
@Alline

Isn't it more logical right away, from the first application, to add a message to rabbitmq

Yes, it's logical. But I would also leave saving in the database for a simple reason - consistency. And then on large volumes, the rabbit may lose data + sometimes there is a need for re-processing (CQRS / Event Sourcing)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question