1

I have no doubt regarding what each of the technology does. I have tried all of them as well. What I have doubt with is:

In case we use GraphQL, wont it act like a single point of failure if the GraphQL server goes down? Can it be clustered and if yes, any architecture available?

I know why kafka is used in the Microservices world. If we are using GraphQL, does kafka become irrelevant or is there any place where Kafka still makes sense with GraphQL?

If we build Microservices, we can containerize every Microservice using Docker and use Kubernetes for orchestration and Kafka for the streaming layer, but if we use GraphQL, is it built as a monolith and is the entire application containerized? Or do we still modularize the code, and containerize different modules in servers and query them via GraphQL?

Where and how should my database layer exist when implementing via GraphQL. For microservices, we use one DB instance for every microservice.

For the context, I am thinking of an architecture to build scalable, containerizable and manageable APIs with GraphQL.

1

I am not sure why are there docker and kubernetes in your question. It's on you how you want to setup docker to accommodate your architecture and shouldn't play a role in architectural decisions.

Yes you can always span multiple graphql servers on your application. It's up to you how you want to handle requests coming on these multiple graphql servers. I have seen some application handle this on use-case basis, but yes to handle your question this can definitely scale. You might find this useful as well -https://dev-blog.apollodata.com/graphql-schema-stitching-8af23354ac37.

Kafka can come in handy if you want to have data streaming capabilities. So ideally you can have your database -> Multiple Kafka instances talking to the database -> Each Kafka instance can have multiple GraphQL APIs dealing with it.

  • Thanks for your answer. Docker and kubernetes came in cause I wanted to know what to containerize and how to make it scalable. Schema stitching helped. Will try to make modular graphql servers, containerize each of them and do schema stitching and see how it works out. But, I am still not sure about the kafka part – Vignesh T.V. Jan 6 '18 at 18:06
  • Not exactly sure how GraphQL "talks to" Kafka...? Is it consuming messages? – cricket_007 May 14 '18 at 1:41
0

I saw this video: https://www.youtube.com/watch?time_continue=2308&v=ykp6Za9rM58 (seek to 33 minutes) and got the below model:

enter image description here

There is only one thing to add which is kafka which will come in between the Gateway and Servers which will act as a streaming platform for the graphql queries sent to various servers. (Mainly kafka cause I dont want one module to talk to another module directly). I wanted to have a bus to avoid complexity and use event sourcing and CQRS for graphql.

I could then containerize all servers use schema stitching to make the one single graphql query divide into multiple statements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.