与对象更改通知相比,Google Club Pub/Sub 的可扩展性如何 [英] How scalable are Google Club Pub/Sub compared Object Change Notifications

本文介绍了与对象更改通知相比,Google Club Pub/Sub 的可扩展性如何的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

As the title asks, how scalable is Google Club Pub/Sub compared to Object Change Notifications in Google Cloud Storage when using Signed URLs to upload objects?

How do each compare in terms of being able to handle many objects being uploaded in a short period of time? Will delivery be slower if many objects are uploaded quickly? For example, 1000 objects/second?

If neither are scalable what other options are there?

For my purposes, I need to upload an image, then when a notification is delivered to my Google App Engine app, I need to make a write to my database. It is essential that the period of time between uploading the image and the notification is short (2-3 seconds at the most).

解决方案

At 1000 object changes per second, you want to use Cloud Pub/Sub notifications.

Both Object Change Notifications and Cloud Pub/Sub notifications will work just fine at 1000 QPS. However, at those sorts of load, there are a few reasons to prefer Cloud Pub/Sub.

First, Cloud Pub/Sub subscriptions support pulling messages. With one call to pull(), you can retrieve 100 or more messages at once, and then acknowledge them all with one call to acknowledge(). Object Change Notifications always make one call to your service per message. Using Cloud Pub/Sub can instantly reduce the number of RPCs your server needs to deal with by two orders of magnitude.

Second, at high QPS, you will want to start considering failures, timeouts, and retries. Cloud Pub/Sub is a superior option here as well, for a variety of reasons. For one, it supports configurable ack deadlines, while object change notifications always must be processed within 20 seconds. For another, you can query to see the size of your current backlog, in case you get behind. If you're using push subscriptions, Cloud Pub/Sub also has a much friendlier traffic ramp-up if your message receiver goes offline for a bit, so you don't overwhelm your own servers as they come back online.

Third, flexibility. Cloud Pub/Sub is designed around this use case. Receiving a high volume of messages is their whole bread and butter, and there are many features and libraries focused on it. Cloud Storage, though, is focused on storing data. Object change notifications works, but it will never offer as many notification features as Cloud Pub/Sub.

这篇关于与对象更改通知相比,Google Club Pub/Sub 的可扩展性如何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆