Sweden’s Karma is on a mission to eliminate food waste by making the sustainable choice the most rewarding one. Since 2016, the company has used its “food rescue app” to connect food retailers with customers and help them sell their surplus food that would otherwise have gone to waste. The retailers gain an additional revenue stream while customers benefit from reduced prices and the knowledge that they are making the world more sustainable, one delicious meal at a time. By offering its users financial incentives and making the process as easy as possible, Karma makes sustainability an achievable goal for many more people.
“It’s about giving people the opportunity to take one simple action every day that makes a difference,” says Charlotte Humphries, Brand Manager at Karma. “If a million people do that, then that can have a huge impact.”
Karma works through two apps, one for consumers and one for food retailers. The first is the public face of Karma, but the second app is just as important. By working closely with retailers on as granular a level as possible, Karma helps them to get rid of food that would have gone to waste, and also tries to prevent them creating that surplus in the first place. “We try to address the root causes of food waste, rather than just treat the symptoms,” says Koen Brörmann, Product Manager at Karma.
In late 2018, Karma began to expand into the United Kingdom and France. What was once a scrappy startup solving a local problem was now developing into a multinational business, and it needed a brand new infrastructure built for scale. For that, Karma turned to Google Cloud.
“Our existing infrastructure was very simple to use, but also very manual,” says Tobias Neil, Software Engineer at Karma. “We needed a more sophisticated solution that could scale at speed while minimizing our overheads. For us, that solution was Google Cloud.”
Overcoming the limits of bare metal with Google Cloud
In its early years, as Karma became a success in Stockholm and throughout Sweden, the company had to adapt its technological infrastructure. Moving to a microservices-based architecture, the company could scale much more quickly than before but it was still reliant on bare metal infrastructure. In practical terms, this meant that DevOps engineers had to manually deal with an increasingly unwieldy back end.
“It was very cumbersome to deal with,” says Neil. “If we needed to ship an update, we had to log in to the remote server, pull in new code and manually restart the program with some sort of node process manager. Rather than a Continuous Integration/Continuous Delivery pipeline, we had people using keyboards.”
As well as taking time, the bare metal infrastructure was also expensive to maintain. By 2018, Karma employed three full time engineers to manage its stack, which was a significant cost for a startup looking to grow quickly.
Towards the end of 2018, on the back of a major investment round, Karma began its expansion to the United Kingdom and France. But as it moved to a new tier of operations, it became clear that its existing infrastructure solution would not be able to scale with its ambitions. With the help of its new investors, who had proven expertise in turning startups into scaleups, Karma began looking for a cloud-based infrastructure that could simplify much of the operations management. After a thorough investigation of the leading cloud suppliers, Karma chose Google Cloud for its scalability, its ease of use and its cost effectiveness. “There was a very convincing business case for us to go with Google Cloud,” says Brörmann.
Karma migrated to Google Cloud in stages to minimize disruption for its app users. “We had already changed to a microservices based architecture, so we just moved over bit by bit,” says Neil. Using Kubernetes, the open-source container-based technology developed at Google, Karma has been able to replicate and improve upon its old setup. With Google Kubernetes Engine (GKE) forming the core of the new infrastructure, the company has greatly simplified much of its operations management, along with Google Cloud Pub/Sub for its messaging system. It has recently built on these efficiency gains by incorporating Google Cloud Functions and Google Cloud Run for even more automation. “The step up to GKE and Cloud Run has been immense for us,” says Neil.
Meanwhile, Karma’s database is now managed with Google BigQuery, which comes with performance boosts over the old platform but also allows non-technical parts of the business to use data quickly and easily.
“Google BigQuery isn’t just powerful, it democratizes the data. It’s so easy to use, even for people who aren’t dedicated software engineers. We can gain valuable insight from live data without forcing some poor data manager to manage our queries for us,” says Brörmann.
Innovation at scale and at speed
Since migrating to Google Cloud, Karma has gone from strength to strength. Today it is present in 225 towns and cities across Sweden, the UK and France, and is used by 1.4 million people.
With managed services on Google Cloud, Karma can also work much more quickly than when it was on the previous bare metal infrastructure. New features and products can be developed and shipped much faster than before, so the company can now respond to its customers’ needs more effectively. For instance, when much of the world went into lockdown in early 2020 during the COVID-19 pandemic, in just two weeks Karma added a temporary delivery feature to its app for customers who couldn’t collect their food from the normal outlets. “I love how Google Cloud allows us to move with enterprise scale and start-up speed,” comments Brörmann.
As well as scale and speed, Karma has also been able to reach a new level of innovation with Google Cloud and cutting edge data analytics. For instance, the company has been using BigQuery ML on its granular sales data to provide businesses with forecasts. “We sell food item by item rather than in a “magic bag” like some of our competitors,” says Humphries. “That means we can collect real-time data about what’s being wasted at a granular level. With machine learning, we can then use that data to start predicting and ultimately preventing food waste from happening in the first place. That’s really the ultimate ambition for us.”
What’s more, Karma has achieved all this while reducing its DevOps dependencies and making significant savings on operations management. Without having to employ three full time DevOps engineers, Karma can re-invest those resources into hiring more developers and building the best products it can for its users. The infrastructure is now managed by the software engineering team, alongside their other tasks. But rather than adding to their workload, says Neil, it has actually enhanced it. “It’s empowered our feature engineers to be a part of the process at every stage,” he says. “We have a much more holistic approach now. We build it, we ship it, we own it.”
For now, Karma is planning further expansions in the UK and France, as well as in new territories. But it is constantly working to improve its technology and innovate newer, better solutions such as utilising Cloud Run for more streamlined infrastructure management or experimenting with Google Cloud AutoML to build on its work with predictive analytics.
“There is no question that we grew much more quickly and efficiently than we would have done on our previous infrastructure, but we’ve also changed the way we work,” says Neil. “Google Cloud isn’t just a tool for scaling, it’s a platform for simplicity, and for growth.”