Site navigation

Cloud, Optimisation and Kindness: Responding to the Pandemic

Jonathan Forbes


Jonathan Forbes, CTO of Phlo reflects on the impact of the pandemic and the role of Cloud and analytics in helping the organisation to scale, optimise and adapt.

If you had any doubt about the adverse impact on mental health following the onset of the coronavirus pandemic, let me quantify one aspect of it for you – £139 million.

That’s the additional cost of antidepressant (AD) medicines prescribed through NHS England in 2020. An extra four million prescription items over the 2019 base figure of 78 million.

This is the conclusion of a paper published in March 2021 in the DARU Journal of Pharmaceutical Sciences. For context, the cost at list price to the NHS of prescribed medicines was £18.9 billion in 2018/19, an increase of 4.1% from £18.2 billion in 2017/18.

At Phlo Digital Pharmacy, we saw increases across the board in our prescription request and order data in 2020. Demand for prescription antidepressants rocketed in early 2020, which is hardly surprising news.

It probably won’t surprise you to know that we’re seeing even higher demand in 2021 – lockdowns take an insidious toll on people’s health.

Like many other businesses, Phlo operates a just-in-time inventory model, getting stock delivered twice a day so that we can respond to patient’s requests with our unique same-day delivery model. We buy medicines on 30-day terms, then claim back costs from NHS England up to six months later.

The NHS itself largely controls drug prices in the UK through a mechanism called the NHS Drug Tariff, which is updated once a month or more frequently if needed, through price concessions and Serious Shortage Protocols.

On top of operating in a price-controlled market, pharmacy is a regulated sector, and our medicines are largely produced overseas and imported to the UK under licence and are subject to trade agreements.

So, when Phlo sets out to get the right medicine safely and securely to the right patient wherever in the country they need it to be sent, it must be an efficient mix of your expert healthcare partner, Amazon Prime, and your bank.

What has all this got to do with cloud analytics?

Well let’s start with an admission. Analytics is the least well-developed domain in Phlo. We’re scaling up now, but in 2019 and most of 2020 we spent all of our time, money and energy building our patient-facing apps and our pharmacy operating system.

Then we had to attract patients to use a same-day medicine service that delivered to them rather than them having to visit a pharmacy every time they needed their prescription.

You’d be correct in thinking that this is probably a useful service when lockdowns are in force, and 4.9 out of 5.0 on Trustpilot with more than 500 positive reviews from our patients is testimony to that.

Now Phlo provides the UK’s only “single view of prescriptions” service, whether you’re an NHS England patient or a private healthcare patient or use a mix of both.

To manage all of this in a pandemic, Nadeem Sarwar, Phlo’s founder/CEO and his team of investors quadrupled Phlo’s pharmacy operating space and tripled the size of the company to cope. Our fantastic pharmacy team adapted, developing a new way of working and maintaining our clinical services even as lockdowns threw up barriers over and over again.

Operating a “Team of Teams” model, our Product, Engineering, and Design teams have delivered new mobile apps and a new platform for our healthcare partners, as well as numerous refinements and enhancements to our systems and processes.

Similarly, our Marketing team persuades people that having their medicines brought to them quickly, safely and securely is a really great idea. Why didn’t we think of this sooner?

We have hired our first Data Scientist, who comes to Phlo from The Data Lab’s M.Sc. programme. We’re grateful that Gillian Doherty, Brian Hills, Rhona MacLennan and the Data Lab team have been quietly nurturing, educating and growing Scotland’s data science and engineering capabilities since 2014.

It means people arrive with us already knowing what they should be doing and the positive difference that data-driven decisions can make.

It might be clear to you already why Phlo values analytics, and cloud analytics in particular; analytics is an optimisation game. It gives you the ability to understand what makes everything in your organisation tick and make better decisions as a result.

Analytics helps to separate the signals from the noise, whether in data from patient interactions or changes to drug demand or prices, GP behaviours or the seasonal and environmental impact on prescribed medicines on inventory levels, operations and logistics and deliveries.

Rapid Development

As the pandemic took hold, we wanted to put something in place very quickly that gave us the ability to consume, process and analyse data from all of those different sources so that we could make the best decisions possible for a given set of circumstances.

Phlo runs its operational systems on Google Cloud Platform (GCP) and Azure DevOps – yes, we happily mix our cloud services and perhaps counter to expectations, it makes our lives a little easier. Having those capabilities and platforms embedded in our processes made them the natural choice to service our analytics too.

As we deal with medical data, we take great care to protect our patients’ data. We work with local information security and data privacy experts 7Elements, Pen Test Partners and Digital Orchard IT to stay on top of that.

Phlo has a strong in-house Engineering team with mature DevOps, automated testing and CI/CD skills under the direction of James Maciver, our Head of Engineering.

We’ve embraced infrastructure-as-code and it liberates us from much of the fear we might have felt specifying kit for large-scale capital expenditure to deliver at speed. It certainly enables us to make mistakes and start again without too much pain.


We quickly configured our data lake to act as a staging and refinement area for our raw data. While it’s true that data lakes are slow storage and operate with eventual consistency, they can be mounted to compute instances as file systems.

This makes it easy to export data from systems and partition appropriately for subsequent processing, whatever the scale of the data being consumed.

Phlo’s not generating huge data volumes yet; that will come as we increase our patient numbers and partner services, and as we develop our machine learning models.

Our current infrastructure will happily cope with everything that we’re going to throw at it, and we have a gallery of cloud processing options, off-the-shelf modelling tools and automation to choose from when needed.

We’re going with Python as our analytics language of choice, so we have access to Jupyter notebooks, TensorFlow and a host of supporting algorithm libraries. We’ll use serverless Cloud Functions to host many of our models as it makes things straightforward, adaptable and manageable by our analytics team without the need for Engineering help.

Cost control and design flexibility

Analytics infrastructure is all operating expenditure now, and serverless to boot, if you’ll forgive the pun. Combined with our operational cloud services, our costs are currently the equivalent of buying everyone in Phlo three Starbuck’s Grande Lattes per week.

That’s cost-effective whichever way you look at it. Costs will increase as we place more workloads into the mix, but it is a predictable, largely linear burden.

We’ve still got plenty of work to do. We have gaps in our architecture. We’re going to redesign our data warehouse as the current approach isn’t doing it for us.

Additionally, we’ll sort out better data pipelines too, and start to produce advanced analytics models, then push their insights back into our operational systems in a positive feedback loop so that decisions can be automated, and responses optimised for circumstances.

We’re looking forward to trialling GCP’s new Datastream Change-Data-Capture solution, and their Analytics Hub and Dataplex products too – we think they can do a job for us.

Our new healthcare platform is designed with an event-driven architecture, which means we can incorporate streaming analytics into our operations. Most importantly, later in the year we’ll grow our team with a few more data people, and start to think in terms of data products and services.

So, we’re not yet as advanced as many of you out there will be. But I take some solace from Jeff Hammerbacher’s writing in the book Beautiful Data‘.

In their early days, Facebook needed to redesign their operational and analytics systems three times before they got something that worked for them, all the while scaling up to billions of users. Phlo doesn’t have Facebook’s reach or data workloads but if it took that team a while to achieve their goals, I think we can feel a little better.

Prescription trends and the mental health challenge

Back to the mental health challenges noted earlier. Remember that behind increased demand for medicines, and higher prescription costs for the NHS, are more people struggling with illnesses. One drug in particular, Sertraline, contributed £113 million of that extra £139 million cost in 2020.

Sertraline is a Selective Serotonin Reuptake Inhibitor (SSRI) antidepressant drug. It’s usually the first port of call for treatment for conditions such as anxiety disorder, obsessive compulsive disorder, panic disorder, bulimia and post-traumatic stress disorder because it has fewer side effects that most other types of antidepressant.

The concerning thing for all of us is that Phlo’s data for 2021 so far reveals two things:

  1. The increase in Sertraline prescriptions is even higher than in 2020 across almost all ages, and
  2. Prescriptions for antidepressants are noticeably higher amongst patients in the 46 to 55, age group, and the 16 to 35 age ranges, despite being only halfway through the year.

Many people’s metal health, and younger age groups in particular, have taken a battering in the last two years.

It’s going to take time, effort and resources to help everyone recover – bear that in mind and please cut people some slack when you can.

Join the Debate | Cloud First Summit

Jonathan Forbes will be speaking about Phlo’s Cloud Analytics journey at the upcoming Cloud First Virtual Summit on 23 June.

The conference will bring together senior technologists, Cloud architects and business transformation specialists to explore current trends, new advancements and best practice in Cloud computing.

Register your free place now at:

Jonathan Forbes, CTO at Phlo

Jonathan Forbes

Chief Technology Officer, Phlo

Latest News

%d bloggers like this: