When we chose Firebase as our backend, the most common pushback was: "Can Firestore handle real-time inventory at scale?" After processing millions of stock movements across hundreds of warehouses, the answer is definitively yes — but the architecture matters.
The key insight is that Firestore's real-time listeners are incredibly efficient for inventory because most operations are highly localised. A warehouse picking operation only needs to watch the bins being picked from, not the entire inventory. We use a combination of document-level listeners for hot data and Cloud Function triggers for cross-document consistency.
Our predictive stock allocation engine runs as a set of Cloud Functions triggered by order events, inventory changes, and channel demand signals. It uses BigQuery for heavy analytical workloads (demand forecasting, seasonality detection) and writes allocation decisions back to Firestore for real-time access. The entire pipeline runs in europe-west1 with sub-second latency for allocation decisions.