Sandip
TTCTheo's Typesafe Cult
•Created by Sandip on 1/10/2025 in #questions
How to send messages to large number of people and is there ways for doing it
Hey everyone, I need some advice on optimizing how we show notifications to users. Here's the scenario:
Current Setup:
Our database has over 1.5 million messages stored.
Every 5 minutes, we query the database to check for new messages for users and display them as notifications.
@DesignationID bigint,
@startDate datetime,
@endDate datetime,
@UserID bigint
AS
BEGIN
SELECT
displaymessage AS DisplayMessage,
'frmViewMessage' AS form_name
FROM pl_action_message pm
INNER JOIN pl_user u ON pm.sent_to = u.user_id
INNER JOIN pl_action_taken pa ON pm.action_taken_id = pa.action_taken_id
WHERE pa.status <> 'Completed'
AND u.designation_id = @DesignationID
AND pm.sent_date BETWEEN @startDate AND @endDate
AND u.user_id = @UserID
END
Problem:
The query is taking a significant amount of time to execute.
I've already implemented indexes and used the UPDATE STATISTICS query to improve performance, but there's no noticeable improvement.
Question:
How would you handle this scenario to ensure notifications are delivered efficiently without querying such a large dataset every 5 minutes?
Are there any best practices, techniques, or articles you can share to help optimize this process?
16 replies
TTCTheo's Typesafe Cult
•Created by Sandip on 1/3/2025 in #questions
Is it necessary to have backend to upload pdfs, in uploadthing ???
i am thinking of only using frontend to upload pdfs and catch the url given by the upload thing and save it in the database. i am using .net as the backend so any recommendation???
10 replies
TTCTheo's Typesafe Cult
•Created by Sandip on 7/2/2024 in #questions
Can i use uploadthing with dotnet core api ???
4 replies