UKHSA-Internal / coronavirus-dashboard-api-net-sdk

Coronavirus (COVID-19) in the UK - API Service SDK for .Net
https://coronavirus.data.gov.uk/
MIT License
12 stars 4 forks source link

Is the API OSS? #3

Closed jchannon closed 4 years ago

jchannon commented 4 years ago

I was looking at the actual HTTP API for coronavirus and as someone who has a keen interest in HTTP/REST I was wondering if the implementation is OSS? I couldn't see anything in the PHE Github org but maybe I missed it. Thanks

xenatisch commented 4 years ago

Hi @jchannon

I haven't push the the API code to a public repository yet, but I will just as soon as I finish documenting it... so yeah, it will be OSS, but maybe not under MIT. It's something like Apache or BSD-3 would be a better option.

The code is written in Python mostly from the scratch. It is a purpose specific service that is designed to be very light and very fast because it runs as a micro-service on Azure Functions. The API is managed via Azure APIM policies, with a Redis Cache as primary and a disk cache as secondary (backup). It uses CosmosDB as database (SQL flavour).

As of yesterday, the service is handling in excess of 26.5 million requests a day, which is quite considerable by any standard, but is certainly the most hit GOVUK service.

This is the architecture:

                                 Disk Cache (support) ---------+
                                                               |
CosmosDB ----- Python micro-service ------------------------- APIM ------------ HTTP GET [v1/data] {PUBLIC}
                                                               |
                                          Redis Cache ---------+

CosmosDB ----- Python micro-service ------------------------- APIM ------------ HTTP HEAD [v1/data] {PUBLIC}

                                                              APIM ------------ HTTP OPTIONS [v1/data] {PUBLIC}

                                 Disk Cache (support) ---------+
                                                               |
Storage ---------------- CDN -------------------------------- APIM ------------ HTTP GET [v1/timestamp] {PUBLIC}
                                                               |
                                          Redis Cache ---------+

                                 Disk Cache (support) ---------+
                                                               |
CosmosDB ----- Python micro-service ------------------------- APIM ------------ HTTP GET [v1/lookup] {WEBSITE ONLY}
                                                               |
                                          Redis Cache ---------+
jchannon commented 4 years ago

Brill, thanks!