Reputation: 427
I need to implement the following functionality.
The server side should have HTTP/2, TLS 1.3
IBM Kitura makes very easy to generate the client code for Android and iOS to talk to SwiftNIO server.
The Kitura macOS App is really powerful and easy way to create the service definition and generate the client and the server code. The Kitura server is SwiftNIO 2.0 server which is working nicely with latest Apple iOS.
I explored the possibility to run the server code on IBM Cloud. IBM Swift Cloud Functions are very lightweight. But there are two big issues with it.
1) Using custom domain with LetsEncryt - SSL certificate is not updated automatically.
Which means every 90 days it must be updated manually.
Basically - no managed SSL.
2) only ipv4, no ipv6 support with means it cannot pass the
Apple App Store requirements.
So these two issues rule out IBM Cloud.
With Google Cloud these two are not issues.
Now I'm exploring the options to build the RESTful API with one of these:
1) Swift
2) Golang
Option 1) is a good one because of The Kitura macOS App. I can develop with just one language Swift which would speed up the development time. There is a downside - no support for Swift client libraries for Google Cloud API.
So the SwiftNIO based API can be used as a front end and Google Golang Cloud Functions should be called from 1).
Or if I use ColdRun it is possible to call Golang from Swift as it is possible to use Gomobile from iOS. How?
Also Kitura can generate OpenAPI interfaces.
Option 2) - to use Golang exclusively. Downside - I cannot use the Kitura Swift functionality.
What are the options on the Google Cloud server:
1) Google Cloud Run (with container for Swift)
2) Google Cloud Functions for Golang
3) Google Appengine for Golang
Options: 1) I don't have answers about Cold Start and the other parameters as 2) and 3)
2) is very good and inexpensive one: 2 million invocations per month (includes both background and HTTP invocations) 400,000 GB-seconds memory, 200,000 GHz-seconds of compute time 5 GB network egress per month Max function duration = 9 mins Cold Start = .5-1.5 Seconds
3) Cold Start = seconds but I suppose 2) is the best one on this parameter.
I suppose ipv4 and ipv6 and Apple App Transport Security (ATS) requirements are fine with 1), 2) and 3) but I need a confirmation.
I don't have answers about what needs to be done about HTTP/2, TLS 1.3 on 1), 2) and 3).
One more thing. I need to be able to call BigQuery. For now the only supported ready to use client library is for Golang.
So I suppose SwiftNIO on Cloud Run + Golang CloudFunction should be the best possibility.
Upvotes: 1
Views: 238
Reputation: 15963
Cloud Run doesn't support streaming HTTP/2. It should have up to date ciphers.
I have run Swift on Cloud Run (here's an example using Protobufs and client/server swift). It uses Kitura.
Run will likely be cheaper than GCF and GAE, due to concurrency and no billing cliff. Cold start performance will likely be similar across Go and Swift because they're both launching binaries, but I admit I have't
ATS shouldn't be an issue since Run does SSL for you (and .app
domains are pretty neat in that I believe they require SSL and HSTS).
Upvotes: 3