Case Study

How We Scaled Our Retail Operations With Cloud and App Platforms During the Lockdown

Jun Kaneko
Firebase Developers
5 min readJun 23, 2020

--

It has been an unprecedented year for everyone, and for me, it was one of the busiest periods as a hands-on engineering/e-commerce manager.

Before the memory fades, I want to share my experience of how technology helped to scale our retail (3 stores and online/wholesale) and hospitality business (10 restaurants) during this pandemic period with two engineers including myself.

Here are some of the highlights:

  • The number of online orders increased to five times higher than usual.
  • The fulfilment team scaled up from 20 to 60 staffs to cope with the surged demand, in two weeks.
  • The import container from Japan stopped, and the purchasing team needed a full sales and demand analysis of all 3000+ inventories to switch to the local suppliers.
  • Launched fresh Ramen DIY kit delivery as all of the 12 restaurants were closed, and the first 250 slots were sold out just in 30 minutes.

All of these were not achievable if we haven’t built our e-commerce and smartphone app-based fulfilment system in-house on the cloud.

The system overview

Aggregate Every Data Into BigQuery

When I joined the company almost three years ago, all the systems and data were scattered, and there was even no way to figure out how much one product was sold in the business for a day.

So I started to consolidate the EPOS systems and aggregate all the sales data into the data warehouse, Google Big Query. Although the most EPOS system provides the analysis and reporting functions, none of the existing solutions in the market suited to our requirements. They are either optimised for retail or hospitality (restaurants) use cases, but our business is a mixture of them as well as online stores and wholesale of imported food.

So we decided to aggregate all the transaction data, not limited to the sales but also internal procurement transactions between the warehouse/central kitchen and stores/restaurants, then designed the dedicated dashboards for each department. The dashboards are a combination of Google Data Studio and automated Google spreadsheet reports triggered by Cloud Functions.

The Real-Time Dashboard to Control the Kitchen Production

The real-time dashboard changed every operation in the company; for example, it reduced the food wastage significantly as the kitchen can fully control the production based on the ongoing demand during the day.

However, the real strength we appreciated during the pandemic period was Big Query’s powerful online query editor and Google sheet integration.

Since the lockdown changed customer behaviours completely, I needed to scrap and build a new KPI dashboard almost every week as the various circumstances change dramatically. The real-time big data analysis helped a lot to guide and give confidence in the executive decisions.

Especially when collaborating with remote working colleagues, well-processed data is essential for productive and positive decision making.

React Native App to Scale the Warehouse Operations

Another key technology which helped to scale the fulfilment operation was our in-house developed smartphone app built with React Native (Expo.js) on iPod touch + scanner device attached.

Our online store sells a unique selection of Japanese food. The products directly imported from Japan are fun to see, but the foreign packages become tricky when they come to be picked by non-Japanese speakers in the warehouse.

iOS Scanner app

We have developed the iOS app to pick the online orders and been improving the usability over the past year.

This app played an essential role to scale the fulfilment team from 20 to 60 staffs in two weeks. It instructs everything, which shelf to go, what to pick, check the best-before date, where to place the basket and so on. A new starter can join the operation without any prior knowledge, just by scanning the barcodes of the picking sheets and products.

We could shift all the experienced staffs to the packing process, as it requires skills, and recruit the 40 extra help staffs from our closed restaurants during the lockdown.

From the system point of view, what we needed was to order 20 extra iPod touch and the scanner module online, assemble, and install the enterprise iOS app.

In two weeks, we were able to dispatch five times more orders a day, though there was a huge hustle to redesign the operational area to accommodate three times more staffs while keeping the social distancing.

Bridge Systems With GraphQL and Cloud Functions

The app looks simple when using, but it connects to three different systems, online store, wholesale store and the warehouse management system, thus three different data schemas.

We added GraphQL API to all the systems built on Ruby on Rails, and the initial version of the app was accessing GraphQL APIs directory via Apollo client. But soon it became a nightmare to maintain multiple endpoints and GraphQL schemas within an app.

So I decided to move the data processing layer to Firebase Functions to act as the API gateway to aggregate the data. The functions fetch the data from multiple GraphQL endpoints, parse and store in FireStore as the unified database.

Sync the Consistent Data With FireStore + TypeScript

FireStore works quite interestingly with React Hooks. If you store some of React Component state to the FireStore table, it can be easily synced between multiple app installations by subscribing the record.

For example, when picking a large wholesale order containing 200+ products, as many as pickers can join in swarming way by sharing the picking process between their apps.

It is always tricky to update the API and the client separately. TypeScript helped a lot to maintain the data consistency between the backend (Node.js) and the app (React Native). It is much more manageable if both ends maintain the unit tests based on the shared types, even when making a change on the data structure.

Scaling the Business, Not Only the System

What I have learnt from this pandemic operation was that scalability is not only about web performance. The scalable system is a combination of structured data, cloud architecture, end-user usability and most importantly, physical operations.

Thanks to all the cloud solutions, any traditional business could be redesigned to scale if it is fully rebuilt on the new paradigm, even if you are not tech giant.

--

--

Jun Kaneko
Firebase Developers

Based in London and Devon, I love surfing and technology.