Is it possible to use gRPC with Fastify? - fastify

Looking around the docs, I don't see any support for gRPC with Fastify. Is there a way to use Fastify with gRPC as the transport protocol?

Related

Sanic with websocket and SocketIO. Which one to use?

Using Sanic, you can handle websockets connections using #app.websocket('/socket.io/') but the protocol used in Socket.io is specific.
Python has Python-Socketio as a module to handle Socket.Io specific communications, but they recommend to use the code like this :
sio = socketio.AsyncServer(async_mode='sanic')
app = Sanic()
sio.attach(app)
#sio.on('connect')
def on_connect():
...
So, which one should be used? Should we implement SocketIo protocol inside #app.websocket from Sanic, or should we ignore this and directly use the implementation from SocketIo?
I'm asking for both rapidity and best practice here. If the best decision is to go with #app.websocket, how can we set up Socket.io inside the Sanic handler?
The Socket.IO protocol is very complex, it will take you a decent amount of time to implement it all manually in the websocket route. Also note that Socket.IO uses the same route for HTTP and WebSocket, something that I understand it is not possible to do (easily, at least) with Sanic.
The python-socketio package integrates with many frameworks, including Sanic to implement all the details of the Socket.IO protocol.

How to make local call on apollo graphql?

I am using apollo graphql in a nodejs application. It is not a server/client mode. Everything is running in one application so there is no http required.
How can I implement graphql in one application?
I have defined schema, resolvers. But I don't know how I can make a in memory graphql server? And how can I query the server without using http link?
Graphql spec doesn't mention anything about implementation which means I can use different transports like http, websocket etc. In my case, I just want to use a local transport without network.

What is the best Socket.io alternative in AWS serverless

I'm building a custom serverless chat on AWS.
I want to use WebSockets for updating the messages.
I found that Socket.io is amazing for what I need and it also supports heartbeat as fallback if WebSockets does not work.
My problem with Socket.io is that is does not have server for AWS ApiGateway.
Is there any library that will replace Socket.io for me on serverless?

nestjs, GRPC server and micro services architecture

I've started a new project with nestjs with microservices, but it's my first microservices project and i don't' have enough knowledge.
During my documentation study, I can't find a way to use a microservice with grpc and HTTP at the same time.
In my architecture, I have got a few microservices that have to serve REST API for the client but have also to serve grpc request for "internal" purpose, is that a right decision?
It is not correct to say "I can't find a way to use a microservice with grpc and HTTP at the same time" since GRPC uses HTTP. GRPC is not a protocol, it is a way to serialize messages, by exposing HTTP endpoints you have the possibility to choose between different alternatives such as XML; REST/JSON or GRPC.
Normally following the "hexagonal architecture" philosophy (https://en.wikipedia.org/wiki/Hexagonal_architecture_(software)) you should be able to separate the logic from the adapters and your project can implement multiple adapters for the same logic, for example one adapter in HTTP/REST and another in HTTP/GRPC. On the other hand, a way to avoid having to implement multiple ports is to always choose HTTP/GRPC and use Envoy as a proxy between HTTP/REST and HTTP/GRPC (see https://grpc.io/docs/tutorials/basic/web/) but final solution depends on many factors

Sails.js with native WebSockets

I want to make public WebSocket API with sails.js. So I'd like to use native WebSockets instead of the built-in socket.io but with Sails.js controllers and models. Is it possible? Maybe I can implement custom transport or something else. Thanks for any help.
I implemented WebSockets support for Sails.js as a custom hook:
https://github.com/provectus/sails-userhooks-ws
Using raw socket.io functionality in a Sails.js controller
https://gist.github.com/mikermcneil/6598661

Resources