Answer the question
In order to leave comments, you need to log in
Optimized sending messages to all yii2 users?
Created modules: Articles and Notifications (messages). After creating the Article, you need to create Notifications for all users.
Notifications: header, text, author_id, user_id. The author of all messages will be admin. It’s possible to create everything manually, but I made an Event, and after the trigger (creating an article), I launch this event, where I need to create notifications for all users. Question: who had a similar case, how can I make all this more optimized?
Answer the question
In order to leave comments, you need to log in
So what's wrong with the current version? Architecturally, this is the correct approach. If you are not satisfied with the speed, you can go down to the database level and implement a trigger there, but is it worth it ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question