Hi everyone,
I am currently working on scaling a GrandNode-based project and would like to get some guidance on the best practices for scaling the web server layer.
While scaling MongoDB is pretty clear, I have a few questions regarding the application instances:
1. Session Management & Sticky Sessions: When running multiple web instances behind a Load Balancer (like Nginx or HAProxy), is it mandatory to use "Sticky Sessions" (Session Affinity)? Or does GrandNode support distributed sessions out-of-the-box (e.g., via Redis) so that any instance can handle any request?
2. Cache Synchronization: I am aware of the caching mechanism in GrandNode. If I update a product or a setting on Instance A, how do I ensure Instance B invalidates its local cache? Should I use the built-in Redis integration for IDistributedCache, or is there a specific message bus configuration (like RabbitMQ or Redis Pub/Sub) required for cache synchronization?
3. Static Resources: What is the recommended approach for handling wwwroot files and user-uploaded content (images, PDF) in a multi-instance setup? Is it better to use a shared file system (Azure Files/AWS EFS) or a CDN-first approach?
4. Scheduled Tasks: How do I prevent scheduled tasks (e.g., sending emails, clearing logs) from running simultaneously on all instances? Is there a way to lock these tasks so only one instance executes them?
Thanks in advance!