-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Hi there! I want to add a simple notification system for incoming requests to the app.
Business logic:
- user1 creates an event (offline party)
- user2.....userN sends a request to participate in the event (not at the same time, but during the validity period before the event)
- user1 logs in on the site and receives notification of received orders. Processes them (rejects or accepts)
All N users can create events and take part in them. The total number of service users > 10k. But in a specific event, the maximum number of participants is 50.
There was a choice of appropriate technical implementation of such functionality. Searching the information on the Internet I identified 3 main approaches:
- message broker (rabbitmq)
- websocket
- SSE (Server Sent Events)
- maybe something else?
How I see the implementation:
To send a request for participation in the event, a standard post request is used, as a result of which the corresponding record is created in the database
The part that I don't understand at all is the notification of the creator of the event about the requests received.As a variant I assume to use middleware, inside which will be the logic to check for new requests (the question is what to use inside the logic).
It is not necessary to get information immediately online, it is enough to see the notification when the browser page refreshes.
In fact, it is possible to add in the middleware query to the database to check for new records. But this is exactly what I want to avoid. I'm looking for a way to query the database only if there's actually new information there.
Any thoughts and advice are welcome