If you're new to DynamoDB, rest of the video gives good insight to serverless-websockets. Please do not use dynamodb scan as noted here. Instead do something like a custom ID by new chat created and query accordingly. Scan will literally scan every item in your DB. Large enough dataset and you'll either throttle or be bankrupted.
Hi, thanks for the great tutorial!! Idle time(10min) and max connection(2hr) still an issue for realtime application. What would be the best way to handle this for a real-time application to make sure all client is always connected when server need to send message? Heartbeat?
I would like notify "user A" when another user has added items on my DynamoDB table. I thought maybe I could set DynamoDB Streams to trigger a Lambda to push those items to connected clients. Is WebSockets APIs the best way to do this? Or is there a simpler option?
Great video. Helped me so much! One question: I want to implement graphql subscriptions with that. Do I always have to persist the relation between a connectionId and the parameters for the information of the subscription like userId and so on?
Great approach and straightforward instructions. I am working on a multiplayer card game for fun, and I want to migrate from EC2 to serverless. I am wondering if we can replace DynamoDB with Redis/Elastic? Thanks!!
for this? why would u want to use those? redis is for caching, elastic is for searching (mostly). DDB is a better use for that, but nothing says you CANT use those.
I'm struggeling with graphql sbscriptions with apigateway websockets. the handler for both are working in separate project but when I bring them together I get cors errrors from the graphql endpoint. any suggestions or links?
I'm having a very difficult time trying to find good examples/tutorials of using API Gateway Websockets with Cognito (bonus for Serverless framework + Cloudformation)...
Hello , This was a really helpful video. I really need your help to make a chat application whose frontend I have already designed using Angular 6 and Need a AWS websocket api gateway to enable multiple users to chat. However I fall out of resources to learn. I shall be very thankful if you can demonstrate how to connect this API gateway to frontend and begin chatting. That video would be something "on demand". :)
You need to use a websocket module for the client, like isomorphic-ws, to set up a WebSocket client that connects to the API Gateway. There are plenty of other options, so pick one that suits your needs. Remember that in the case of Socket.io, it tries long polling first, and you need to set websocket as the protocol explicitly. - www.npmjs.com/package/isomorphic-ws
estoy implementando un webscoket pero estoy recibiendo un internal server error al enviar un mensaje a los clientes conectados, me podrias dar una orientación por favor
Why after changes of yml file, at the end, i dont get endpoint anymore, it response with 'endpoints: none' ? I suggest to do some debug-setup tutorial with RDS/mySql db, beacuse its little confusing and 99% of using these services is all about do proper config and setup. Good tutorial! :) Thumb up!
What about the lambda pricing? if a lambda its triggered in every client's message sent, wouldn't it be expensive? assumingly an app in a very large scale...
Hi thanks for this great article. Can we use single serverless.yml which can deploy both http and websocket API together and want to specify deployment role in each function.
@@foobar_codes thanks and yes but it says error "cannot read properties undefined" to my role arn defined in provider tab. We can't define roles for each func if we have 2 different API endpoints, hence stuck as I also want to deploy my web socket function with custom role
@Foo Bar thanks and yes but it says error "cannot read properties undefined" to my role arn defined in provider tab. We can't define roles for each func if we have 2 different API endpoints, hence stuck as I also want to deploy my web socket function with custom role
a very good tutorial. i would like to know how api websockets work with a service like athena or ECS task could you please help me. that will great. Thanks you, Vamse.
Hola! Marcia, a mi me manda el error "error: Unexpected server response: 502" desde wscat, desde una pagina web. Hice todo manual desde la consola, implemente la api y la probe me sigue marcando 502. Te suena el error? que crees que pueda ser? El log dice: 2019-06-14 13:55:05.513 (-05:00) undefined ERROR Uncaught Exception {"errorType":"ReferenceError","errorMessage":"event is not defined","stack":["ReferenceError: event is not defined"," at Object. (/var/task/handler.js:13:12)"," at Module._compile (internal/modules/cjs/loader.js:701:30)"," at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)"," at Module.load (internal/modules/cjs/loader.js:600:32)"," at tryModuleLoad (internal/modules/cjs/loader.js:539:12)"," at Function.Module._load (internal/modules/cjs/loader.js:531:3)"," at Module.require (internal/modules/cjs/loader.js:637:17)"," at require (internal/modules/cjs/helpers.js:22:18)"," at _tryRequire (/var/runtime/UserFunction.js:75:12)"," at _loadUserApp (/var/runtime/UserFunction.js:95:12)"]}