614950 (1) [Avatar] Offline
Hi Yan,

I have about websockets/real-time data consumption with serveless. I know this two things doesn't go well together but there seems to be some solutions to it (AWS AppSync, AWS IoT). I think this is required in many applications and chapter or your insight on this topic would be very appreciated.

Yan Cui (68) [Avatar] Offline
You're right, AppSync and IOT Core both offers websocket support, in fact I think when you use AppSync's realtime streaming feature (which we're currently experimenting at DAZN) it actually uses IOT Core under the hood.

The thing to keep in mind here is that, they both work also both services have its quirks. With AppSync we find that it works well up to a certain scale (in terms of number of concurrently connected devices), after which you need to work with AWS to get them to remove some limits for you, and that depends on your use case as well. Either way, neither would be cheap when used at scale and when clients have to stay connected for a long time. That said, other similar services - PubNub, Pusher - are also quite expensive if you need to use them at scale. Firebase is another one that's worth considering, used to be quite expensive but the new pricing seems to make it a lot more affordable now.
ehemmerlin (3) [Avatar] Offline

Problem now solved, as AWS announced the launch of WebSockets for Amazon API Gateway.

See more information here :
Yan Cui (68) [Avatar] Offline
@ehemmerlin - yes, web-sockets for API Gateway is yet another option, but I'll hold off calling it the answer until it's GA and that we've had the chance to explore the edge conditions and how the pricing works.

For a lot of user cases, IOT Core and AppSync can work just fine already. I suspect the pricing model for API Gateway websockets would be similar - based on number of connected devices and connected duration, plus no. of messages.

Personally I'm really interested to see if it supports both targeted delivery to specific devices (by connection ID) as well as broadcast (to all connected devices) and what sort of limits would be in place for that. I have a number of use cases where we need to broadcast to millions of connected devices regularly throughout the duration of a sporting event, we have been implementing the solution on AppSync and it has a few limitations for our use case.