I have an app and it relies on it's Backend (Microservices architectur). I am trying to choose the right protocol and was quite inclined to choose web sockets . But since i last checked AWS API gateway doesn't support it. So that goes out of the window . I have not worked with WebHooks before.What should i consider while implementing Webhooks(Looks like a good fit).The Backend(Nodejs) needs to signal the app(Angular) on certain Events . I am trying to weigh my options . I read this article https://nordicapis.com/5-protocols-for-event-driven-api-architectures/ . But i'd like to hear from people with experience w.r.t scalability,security and performance .
-
You can use websockets or webhooks – Sandeep J Patel Nov 29 '18 at 11:29
-
With Aws i can't use websockets – Jeson Dias Nov 29 '18 at 11:59
-
AWS just announced websockets for API Gateway today at Re:Invent coming soon. – dmulter Nov 29 '18 at 23:55
-
Very interesting . Looking at that – Jeson Dias Nov 30 '18 at 09:31
1 Answers
The exciting bit about websockets is that they allow for stateful, bi-directional communication with your backend, ie: the server doesn't need to wait for the client to check in, in order to communicate.
RESTful APIs on the other hand (I believe that's the primary purpose of AWS' API Gateway) rely on clients contacting the API via HTTP. In that case you're client will be initiating connections to the server, at which time the server can talk back.
Don't let that scare you away though. This is an extremely popular, battle-tested model and you'll find lots of discussion about it on the Web. Options 2 and 3 from your linked article key into this model.
I'll confess I don't have more than a passing familiarity with AWS' API Gateway product but if a RESTful API isn't what you decide on, then API Gateway may not be the best choice.

- 64
- 3
-
Well it is a Restful API . And the api gateway is the single source of entry into my vpc which can then talk to services in my backend . – Jeson Dias Nov 30 '18 at 09:18