Sending a notification to each participant 3 hours before the meeting starts

Let’s assume an application that deals with meetings where some users will participate.

What is an efficient way to achieve this use case:
3 hours before the meeting should start, one reminder mail should be sent to each participant.

It’s pretty easy to trigger a notification based on an Event, let’s say a creation, or a cancellation of any meeting.
However, waiting for the “3 hours before” isn’t an event..because each meeting has its own start date.

An easy way (and surely not performant) would be to have a background-process, that queries the storage (database for instance) in order to find events that matched the rule “within 3 hours before”, and not flagged with some kind of processed.
What about a very high frequency of created meetings… this kind of process would be likely to be inefficient (without evoking the huge impact on the database) to ensure the exact precision of 3 hours (even with a marge of 5 minutes).

Any idea?

I’m not sure that I see what “huge impact on the database” a process would have that polled the database every 5 minutes.

Presumably, you have some sort of table that stores your meetings and their start times. It should be relatively easy to index the column that stores the start time and to write a query that looks for all the meetings set to start between 3 hours and 3 hours 5 minutes from now that would return a relatively small number of records relatively quickly. Adding a column to this table to indicate whether the reminder had been sent or, even better, creating a table that mapped meetings to individuals and tracked whether individuals had been notified (people may be added to a meeting after the 3 hour window) would complicate the logic a bit but the same principles would apply– you should be able to index the data in a way that would allow you to get the subset of data you need relatively quickly.

If you are really exceptionally performance-conscious, your DBA (or back-end developer) likely has a ton of options for tuning these sorts of queries. Those will likely depend on the specific technology chosen (indexed views in SQL Server, materialized views in Oracle, etc.).

0

The most efficient way would be for the client application that is responsible for sending the email to query the DB at startup and remember the next meeting time. It would sleep until 3 hours before this time, then wake up and send the email.

However, the application would also have to be informed of changes to the meeting schedule – either meetings that are added or deleted, and update its next-wake time accordingly. Typically, reading the next-meeting time at each update. How you notify the application of changes is up to you – I would reuse the application as the entry point to the meetings data, so all meeting changes, additions or deletions are sent to the application for processing which then stores the updates in the DB (after all, something has to do this job, might as well be this app).

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật