0.0.1 • Published 1 year ago

profet-graphql-server v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

This is an example graphql project that meant to integrate between severl project as ou architecture skeleton.

Working integrations examples: Graphql yoga initial simple server Graphql modules simple schema creation and using it with graphql yoga Graphql mosules pubsub dependancy injection graphql yoga with websocket subscriptions

This is enough to start working on the profet graphql schema, and this repo will serve as the boilerplate.

Todo: connect prisma with mongodb upgrage pubsub to redis cluster(!): https://github.com/davidyaha/graphql-redis-subscriptions upgrade websocket to uWebsocket: https://github.com/uNetworking/uWebSockets, https://github.com/enisdenjo/graphql-ws


building a monolith or am I working on microservices? Remember that monoliths still have a huge place in today's world given the complexity which comes with Microservices as long as your project is small.

Microservice

What does my deployment target going to look like? VM, Containers or Bare Metal? Containers

What is going to be my orchestration layer? Kubernetes, Mesos, Swarm or OpenStack?

Swarm

What are my scaling needs? We need to have a multi-region global execution nodes, and sniffers. the lowest tier are blockhight sniffers that register the ping. if there are query limit, it will also be attached. each sniffer will work with the lowest ping rpcs. we need to save to the db the geolocations of our sniffers. We will need to have our own full nodes in every continent for maximizing mempool listening. we will start in 1 geo location, but will add more and more servers with deifferent geolocations.

What is the performance that I expect? as soon as new information is cought by our sniffers net, it should be spread across all od our nodes as soon as possible, like a ripple. The infrastructure should be notified about a new price as soon as it takes place (within 100ms) and react within 500ms.

Do I need Offline support? No

Cloud or On-Premise? Cloud

What is the programming language which makes sense for my usecase? Typescript

https (1.1(opens in a new tab), 2(opens in a new tab) or 3(opens in a new tab)) or grpc(opens in a new tab) (over http/2) or Thrift(opens in a new tab) or Websockets(opens in a new tab)? Websockets Do you need a Service Mesh(opens in a new tab)? No

Is GraphQL going to be used for communicating between services? Yes

Do I need something like MTLS(opens in a new tab) for securing inter-service communication? Yes

How do I do asynchronous communication? Do I use event queues like Kafka(opens in a new tab), RabbitMQ(opens in a new tab) or NATS(opens in a new tab) ? Redis pub\sub

file structure:

-src -graphql-yoga-redis-subscriptions-ws.ts -application.ts -modules (monorepo) -rpc -token -pool -path -bridging

  • services
    • crud (mongo)
    • skeleton scanners (mongo)
    • skeleton populator (mongo)
    • skeleton reactor (redis)
  • types
  • resolvers
  • bridging-module.ts