From the description above, you can see that our goal was a total transformation of ZKungFu's software platform from a struggling proprietary system into a Drupal based platform that could work at their scale.

We met our goals at a very rapid pace, and in this case study we share three lessons based on our development success:

Lesson One: Deploy Drupal based micro-services

Drupal is a comprehensive business application platform and is extensible enough to incorporate any feature you might need in a single site. However, to achieve our goals for reliability and scalability, we decided to use multiple Drupal sites to create a network of micro-service providers to support the entire business.

Compared to one big Drupal site with all the features, dividing functionalities into many smaller Drupal sites allowed our development team to work faster, because each micro-service provider needs to know less of the entire architecture to make progress. Additionally, these smaller sites are much easier to scale than one big site under high traffic.

On the other hand, thanks to Drupal, each micro-service provider can use a common set of web services, so our front-end developers don’t have the overhead they would normally encounter developing for applications with distributed data structures.



Visualizing the Drupal based micro-services powering ZKungFu online.

Specifically, we created three Drupal Commerce sites:

One site handles product information and branch management, including pricing rules and variations for duration, location, availability and other business conditions.

Another site handles payment, receiving 50% of the company's revenue (i.e. hundreds of millions of dollars annually!) from QR-Code oriented Alipay and WeChat Pay. This payment instance of Drupal Commerce also supports Cash, Credit Cards, and other smaller types of payment methods.

The third handles order information, tracking the changes from the moment an order is created online or from our POS machines (yes, we built their hardware and software, too!) to run through the food preparation pipeline, to payment, to delivery, to analytics, to business control, to reporting and accounting, and to supply chain planning.

Moreover, besides the Drupal sites we built for Content and Commerce strategies, we also used Drupal to build Marketing, CRM, and ERP capabilities to support customer acquisition, loyalty programs, resources planning, and forecasting. In summary, at the core of this project, we built a swarm of Drupal sites offering micro-services.

Lesson Two: Offline-First and Reliability second

The bloodline of this type of business is its steady flow of orders and payments. This data needs to be precisely managed and monitored at device level, store level, and cloud level. Therefore, we built the POS software with redundancy at these 3 levels, making offline support a mandatory requirement at the device and store levels.



The menu and shopping cart in the self-service POS application.

Assuming stable connectivity is still a luxury in the field of operation. In the system we built, devices like the cash register POS, self-service POS machine, and kitchen control panels can still create or handle orders when they lose their Internet connection.

After the internet connection is restored, multi-level synchronization takes place naturally and quietly in the background. We used CouchDB, PouchDB, Raspberry Pi, Node.js and Electron to build the data infrastructure that guarantees critical order and payment data will always reach Drupal as soon as possible.

Lesson Three: Software Development Process & Style in China

When it comes to engineering style, the Chinese still have a lot to do to catch up to the global best practices on strategic planning and rigorous thinking. However, two traits tend to set a Chinese development team apart: they usually create products targeting a large customer base, and they have a large pool of fresh and young talent. These two traits offer the company’s leadership a new direction to innovate product development - lightning fast product iteration driven by empirical evidence.

Throughout this project, we have been releasing new versions of various parts of the product on a daily basis for months. We were able to rotate groups of customers, support staff, and our developers around the clock to achieve continuous product innovation 24/7. Additionally, thanks to Drupal, which offers a powerful framework with well-known best practices, we could streamline talent on-boarding, training, and retention processes by encouraging the adoption of Drupal’s best practices.

Closing Thoughts

In conclusion, we have empowered a large restaurant chain to run its core business on open source and Drupal. We have really raised the bar with this project by building it to support an immense scale - over one billion dollars in transactions per year.

Special thanks to Heikwan Zheng (SparkPad) and Ryan Szrama for contribution to this case study and to Bojan Zivanovic and Matt Glaman for feedback during the writing process.

You can view the Chinese translation of this case study here (此案例学习中文翻译) .