I am developing an e-commerce platform using Laravel 11 for the backend and Vue 3 for the frontend, which requires near real-time updates of product prices and stock levels in response to currency fluctuations. The system will handle approximately 1,000 products with up to 1,000 concurrent users, updating broadcast price changes at 10-second intervals.
I am considering two different broadcasting strategies to manage the updates efficiently:
- Dynamic Broadcast Channels per Product: Assigning a dedicated
channel to each product, ensuring that clients receive updates only
for products they are interested in. - Bulk Updates via a Central ‘Prices Store’: Maintaining all product
prices in a central store, updating this dataset every 10 seconds
based on currency changes, and recalculating each product’s price by
ID before broadcasting these prices to all clients in bulk.
Additional Context:
Given that each user interacts with a subset of products (around 30, typically viewed in suggestions, most viewed lists, last visited, or their cart), the updates need to be targeted efficiently to these active views.
Technical Questions:
- Which strategy might provide more efficient handling of updates for
high volumes of users and frequent data refreshes? - Are there Laravel 11 or Vue 3 specific implementations or
optimizations that could enhance the performance of one strategy over
the other? - What are the potential drawbacks or performance concerns with
managing dynamic channels for a large number of products?
Insights on architectural decisions, experiences with similar scaling challenges, or any relevant optimizations are greatly appreciated!