Exposure Notification Reference Key Server

View on GitHub

Getting Started

    How to Deploy
    How to Publish Keys
    How to Download Keys
    Estimating the Cost of Deployment


    Server Deployment Options
    Server Functional Requirements
    Verification Protocol Design
    API Definitions

Estimating costs of hosting the Exposure Notification Key Server

NOTE: This is for informational purposes only. This does
not account for all costs of operating. This document
should be used to assist in understanding how to calculate
the cost of deploying this service, not to make budgetary

This page outlines how you might estimate the cost of deploying the reference server for your application. Cost estimates assume the use of Google Cloud, deployment and use within the US, and uses the published pricing rates to arrive at the estimation. This could be repeated for other regions as well as for other cloud providers. Please note that for much of this simplifications have been made. Due to a majority of the expected costs to be incurred due to storage serving.

Calculating the overall cost

There are a number of variables that need to be figured out to determine cost.

Let’s assume that we are calculating the cost of operating for an area with:

From which we can derive:

Cloud Components and Pricing

Due to pricing varying by region, and much of this being scalable, we avoid speaking about exact pricing for most of it, instead trying to quantify the magnitude.

To have an idea of the deployment size, this document assumes the defaults configured for Terraform in vars.tf.

The largest cost is likely to be in Network Egress. In this calculation we assume that Google Cloud CDN is not used but instead a Google Cloud Storage bucket is read directly. Please note that using Google Cloud CDN will likely result in lower cost.

Cloud Run Costs


There are multiple containers needed for a complete deployment:

Most of the services run periodically, not constantly. For this reason it is likely no higher than 6 containers at this scale. Likely, estimating as if 3-4 of these containers would get a reasonable upper limit. The resource limits of a container are specified in the terraform resource limits as 2 CPU and 1G memory per container.

Projected Monthly Cost: $500 - $750

SQL Database Costs


The default size for SQL Database is configured to:

The cost of this component can vary greatly on the scale is configured to. Depending on the needed scale of your deployment this could require a different configuration.

For instance, while the default is db-custom-8-30720, the documentation mentions that a db-custom-1-3840 instance is likely sufficient for local development work. This instance should cost around an eighth of the amount.

Project Monthly Cost: $1000 - $1250

Storage Costs


Data Storage Cost

The last 14 days of batches are stored with older batches being deleted. This is a small amount of data storage. 14 days of batches should be around 8 MB.

Projected Monthly Cost: $0 - $10

Network Usage Cost

Each user will download one of the daily batch files. This is a highly variable cost based on adoption. With sufficient users this could easily be in the tens of thousands of dollars. Also, network egress varies depending on the region. Please see the pricing for network usage to determine a more accurate estimate for your use case.

Copied from above:

Projected Monthly Cost: $10,000+

NOTE: Using the Google Cloud CDN is likely less expensive.
Serving costs when using Google Cloud Storage directly are
higher, often by more than 30%, than Google Cloud CDN.

Operations Cost

There are two tiers of operations.

Class A

$0.05 per 10,000 operations

Relevant operations from this include INSERT, UPDATE, and LIST. These will occur as part of batching of exposure keys. These operations will likely remain under 10,000 for storage as creation of files is batched.

Projected Monthly Cost: $0 - $20

Class B

$0.004 per 10,000 operations

Relevant operations from this include GET requests for key batches.

For each user, there will be a minimum of one GET operation per day.

Projected Monthly Cost: $50 - $100

Edit this page