Hey everyone, I’m working on a project where we’ve built about 10 different ASP.NET sites for a client. Each site has its own way of creating orders. I’m trying to find a better way to process these orders across all sites.
Right now, I’m using a console app that loops through each site to check for pending orders. But this isn’t working well, especially when one site has a huge backlog of orders. It holds up the whole process for other sites.
I’ve thought about using separate threads for each request or maybe using SQL Server Agent to call web services. But I’m not sure if these are the best solutions.
Does anyone have ideas on how to handle this more efficiently? I’m working with ASP.NET Web Forms, C#, and SQL Server 2008.
Here’s a quick example of what I’m doing now:
foreach (var site in sites)
{
var pendingOrders = site.GetPendingOrders();
foreach (var order in pendingOrders)
{
ProcessOrder(order);
}
}
have u considered using a message queue system? smthing like RabbitMQ or Azure Service Bus could help. each site could push orders to the queue, and u could have separate workers processing orders from the queue. this way, no site holds up others and u can scale processing easily
hey swimmingfish, interesting challenge! have you thought about using microservices? each site could have its own order service and be managed with something like kubernetes. it might add complexity, but could resolve issues of scalability. what are ur thoughts on that approach?
Have you considered implementing a distributed processing approach? You could set up a centralized order management system that receives orders from all sites via API calls. Then, use a job scheduling framework like Quartz.NET to manage the processing. This way, you can prioritize orders, set up parallel processing, and avoid bottlenecks from individual sites.
Additionally, you might want to look into database partitioning for your SQL Server. This could help manage large volumes of orders more efficiently. By separating data by site or date ranges, you can improve query performance and reduce processing time.
Remember to implement proper error handling and logging throughout your system. This will help you identify and resolve issues quickly, especially when dealing with multiple sites and potentially complex order processing logic.