You are viewing content from a past/completed QCon -

Presentation: Orchestrating Robot Swarms with Java

Track: Evolving Java & the JVM

Location: Mountbatten, 6th flr.

Duration: 11:50am - 12:40pm

Day of week: Monday

Slides: Download Slides

This presentation is now available to view on

Watch video with transcript

What You’ll Learn

  1. Hear about a performant system written in Java and how they did it.
  2. Learn about some of the tricky things that can be done in Java and some of the pitfalls to avoid.
  3. Listen about the importance of knowing what is below the surface, how some of the components actually work.


Delivering a profitable online grocery sales operation has, until now, been an almost unsolvable challenge. With huge product ranges, diverse shelf lives and temperature requirements, coupled with customer demands for accuracy and reliable delivery slots, grocery far surpasses the complexity of other retail sectors.


Many of the world’s largest retail giants have looked to their physical infrastructures and human beings to tackle this problem.


For the past 19 years, Ocado has taken a fundamentally different approach. Starting from a blank slate, Ocado has built the most advanced eCommerce, logistics, and fulfilment platform which powers the operations of the world’s largest online-only grocer, Today, leading brick-and-mortar retailers around the globe are adopting this technology to remain competitive as demand for online grocery delivery accelerates.


Java and the JVM have played a huge role for this success. In this talk, we will look at the evolution of our automated warehouses and highlight how Java has helped us overcome a number of challenges. We will then focus on our latest generation of highly automated warehouses and take a deeper dive into Java’s role for orchestrating huge swarms of robots for superior efficiencies of scale. We will explore in detail some of the benefits and challenges the use of Java has presented.


The aim is, that by the end of this talk, you’ll have a new appreciation of the versatility of Java and just what is possible with the language.


Tell us a bit about the work that you do.


I've been in the software industry for just over 10 years now, working primarily as a software developer and team lead. I have worked mostly in Java across several industries, telecommunications, finance, investment, banking, pensions, and now in automation. I've seen lots of different business, and all the software problems tend to be the same. I benefited from that, from my experience of different pressures either writing code for your business, writing code for users, B2B, B2C. I've been seeing a broad range of the software development industry. Recently I actually have moved into a more strategic role a bit away from day-to-day coding in the last maybe five or so months, getting into a bit more about a high level strategy at the company, having an input into the strategic decisions about what products we're building and what software we're developing and a bit less focused on how we are developing it.


Your talk is "Orchestrating robot swarms with Java." The robot swarm is totally run by Java?


In large part yes. We use the analogy of air traffic control, the control system which is telling all the robots where to go, what to do, making the most efficient use of them. That is run in Java.


How does that affect your system? How do you deal with GC, with pauses?


We are using plain old Java, very few frameworks. In our particular app, and the one we talking about, no Spring, no frameworks, not running on a web server. Just running as a JAR, containerised now. Very standard in that sense. However, the app is far from a standard app. Yeah, latency is a serious challenge in our application. And so naturally through our use of Java we have invested considerable effort in optimising garbage collection. And I'll be talking about some of that in the talk. But because we're dealing with real hardware, with warehouses which take many months to build and get to their full capacity. I'll also mention the heavy use of simulation techniques and how that helps us to validate new designs, new facilities, that they can achieve the desired throughput. How we use simulation to evaluate new algorithms when we're looking to optimize. And then some of the other implications that real-time control systems throw up as well and how we tackle that.


What are some of the takeaways from your talk?


I hope the audience will begin to consider some concerns which they may have never thought about before, to broaden their perspective of what Java can do, and a bit about where some of the pitfalls are and how you can get around them.

We have a very evolved and performant system that has been thoroughly optimised, but one thing that will be repeated in the talk is only optimize when you need to. Do the simple most idiomatic Java thing first, test it, measure it, and then only when it is for sure investigate and optimize. That's the approach we've taken and we take it every day in development. I hope that message comes through. Another one, maybe not so explicit, but reading the docs and knowing the language helps. Knowing a bit more about the details of the language or the garbage collection, for example. Exactly why G1 GC is good or exactly why some other garbage collector is good. Understand what you're working with so you can make the best choices. Try and get into a bit of detail. A touch on thread execution and schedulers, and why they fall short in some of our scenarios. Knowing about the layer of abstraction below what we are working to be a good developer. Not just knowing your schedule executor will execute some tasks, but what is it doing with its threads, asking why the scheduler is working the way it is.

Speaker: Matthew Cornford

Technology Lead and Evangelist  @OcadoTechnology

Matthew is a Technology Lead and Evangelist at Ocado Technology, helping develop the pioneering software underpinning Ocado’s highly automated warehouses - the most evolved of their kind in the world.  With 10 years previous experience as a Java software developer and software engineering team lead, Matthew is passionate about the development of software which not only performs well, but meets real business needs. As well as being excited by the automation of physical processes within Ocado’s warehouses, Matthew is also a strong proponent of all aspects of software automation.


Prior to Ocado, Matthew has worked in companies large and small, including Cisco Systems and Goldman Sachs. He completed both a BSc in Mathematics and an MSc in Mathematical Modelling and Scientific Computing at the University of Oxford. Outside of work, you'll find Matthew raising his two young daughters and training for his next half marathon.

Find Matthew Cornford at

2020 Tracks

  • Monday, 8 March

  • Tuesday, 9 March

  • Wednesday, 10 March