\documentclass[border={30pt 0pt 0pt 30pt}]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows, shapes.geometric}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black]
\tikzstyle{ha} = [rectangle, minimum width=3cm, minimum height=1cm,text centered, draw=black]
\usepackage{environ}
\usepackage[margin=2cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\setlength{\parskip}{6pt}
% https://tex.stackexchange.com/questions/442991/database-shape-in-tikz/442994
\makeatletter
\tikzset{
database/.style={
path picture={
\draw (0, 1.5*\database@segmentheight) circle [x radius=\database@radius,y radius=\database@aspectratio*\database@radius];
\draw (-\database@radius, 0.5*\database@segmentheight) arc [start angle=180,end angle=360,x radius=\database@radius, y radius=\database@aspectratio*\database@radius];
\draw (-\database@radius,-0.5*\database@segmentheight) arc [start angle=180,end angle=360,x radius=\database@radius, y radius=\database@aspectratio*\database@radius];
\draw (-\database@radius,1.5*\database@segmentheight) -- ++(0,-3*\database@segmentheight) arc [start angle=180,end angle=360,x radius=\database@radius, y radius=\database@aspectratio*\database@radius] -- ++(0,3*\database@segmentheight);
},
minimum width=2*\database@radius + \pgflinewidth,
minimum height=3*\database@segmentheight + 2*\database@aspectratio*\database@radius + \pgflinewidth,
},
database segment height/.store in=\database@segmentheight,
database radius/.store in=\database@radius,
database aspect ratio/.store in=\database@aspectratio,
database segment height=0.1cm,
database radius=0.25cm,
database aspect ratio=0.35,
}
\makeatother
\begin{document}
\begin{tikzpicture}[node distance=4cm]
\node(clientA)[startstop]{Mobile Client A};
\node(clientB)[startstop, right of=clientA, xshift=8cm]{Mobile Client B};
\node(haA)[ha, above of=clientA, minimum height=3cm]{Health Authority A};
\node(haB)[ha, above of=clientB, minimum height=3cm]{Health Authority B};
\node(dsA)[database, above of=haA, database radius=0.8cm,database segment height=0.25cm]{};
\node(dsB)[database, above of=haB, database radius=0.8cm,database segment height=0.25cm]{};
\node(dsAT)[below of=dsA, yshift=3cm]{Datastore A};
\node(dsBT)[below of=dsB, yshift=3cm]{Datastore B};
\node[right of=haA, yshift=-0.15cm, xshift=0.1cm] {5. Process record};
\draw [<->] (clientA) -- node[anchor=south] {1. A and B exchange contact} (clientB);
\draw [->] (clientA.west) -- ++(-1cm,0) |- (dsA) node[pos=0.25,sloped,above]{2. Transmit contact log to health authority A};
\draw [->] (dsA) -- node[anchor=west] {3. Process logs} (haA);
\draw [->, transform canvas={yshift=1cm}] (haA) -- node[anchor=south] {4.1. Send B's TempID to health authority B} (haB);
\draw [->, transform canvas={xshift=-0.2cm}] (haB) -- node[anchor=east] {4.2. Fetch user record and generate PseudoID} (dsB);
\draw [->, transform canvas={xshift=0.2cm}] (dsB) -- node[anchor=west] {} (haB);
\draw [->, transform canvas={yshift=0.4cm}] (haB) -- node[anchor=south] {4.3. Return PseudoID} (haA);
\draw [->, transform canvas={yshift=0cm}] (haA.east) -- ++(1cm,0) |- ([yshift=-0.5cm]haA);
\draw [->, transform canvas={yshift=-1cm}] (haA) -- node[anchor=south] {6. Inform health authority B of contact using PseudoID} (haB);
\end{tikzpicture}
\end{document}