Amazon DynamoDB 是否支持 HTTP/2?

Does Amazon DynamoDB supports HTTP/2?

根据https://github.com/aws/aws-sdk-go/issues/2984,Amazon DynamoDB 似乎不支持HTTP/2。还有其他服务支持 HTTP/2 但不支持 Amazon DynamoDB。

我测试了 https://docs.aws.amazon.com/general/latest/gr/ddb.html 列表中的几个端点,但它们似乎不支持它。

$ curl -v --http2-prior-knowledge https://dynamodb.us-east-1.amazonaws.com
*   Trying 52.119.233.242:443...
* TCP_NODELAY set
* Connected to dynamodb.us-east-1.amazonaws.com (52.119.233.242) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=dynamodb.us-east-1.amazonaws.com
*  start date: Dec  9 00:00:00 2020 GMT
*  expire date: Dec  8 23:59:59 2021 GMT
*  subjectAltName: host "dynamodb.us-east-1.amazonaws.com" matched cert's "dynamodb.us-east-1.amazonaws.com"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: dynamodb.us-east-1.amazonaws.com
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Server
< Date: Fri, 13 Aug 2021 23:03:18 GMT
< Content-Type: text/plain
< Content-Length: 42
< Connection: keep-alive
< x-amzn-RequestId: B0M1S6B7509A9FS62EMN7MV8QJVV4KQNSO5AEMVJF66Q9ASUAAJG
< x-amz-crc32: 3128867991
<
* Connection #0 to host dynamodb.us-east-1.amazonaws.com left intact

有谁知道这是不是真的,或者为什么他们不支持它? 在他们的文档中找不到它。

DynamoDB 今天似乎确实不支持 HTTP/2。我认为没有充分的理由“为什么”。这只是亚马逊没有做的事情,我猜他们 将来会 做,因为他们的许多其他服务以及他们的图书馆都支持 HTTP/2 .

一年多以前,我写了 a blog post 比较 DynamoDB API 和 Cassandra 和 Scylla 的 CQL API。我提到的 DynamoDB API 的缺点之一就是缺少 HTTP/2 支持,这意味着您需要打开与要发出的并发请求数一样多的连接,这会产生开销.我是这么说的:

The DynamoDB API had to work around its transport’s lack of multiplexing by adding special multi-request operations, namely BatchGetItem and BatchWriteItem — each can perform multiple operations and return reordered responses. However, these workarounds are more limited and less convenient than generic support for multiplexing. Had DynamoDB supported HTTP/2, it would have gained multiplexing as well, and would even gain an advantage over CQL for large requests or responses: The CQL protocol cannot break up a single request or response into chunks, but HTTP/2 does do it, avoiding large latencies for small requests which happen to follow a large request on the same connection. We predict that in the future, DynamoDB will support HTTP/2. Some other Amazon services already do.