在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):benjsicam/nodejs-graphql-microservices开源软件地址(OpenSource Url):https://github.com/benjsicam/nodejs-graphql-microservices开源编程语言(OpenSource Language):JavaScript 98.3%开源软件介绍(OpenSource Introduction):Node.js GraphQL API + gRPC microservicesThis project is a monorepo containing a GraphQL API with gRPC back-end microservices all written in Node.js. This project is mainly used for learning/trial and boilerplate purposes only. Graph ModelWhen creating GraphQL APIs, one must understand what Graph Theory and Graph Data Modelling are. One must also think in graphs as per the GraphQL specification recommends. A diagram of the graph data model is shown below. Explanation
Architecture OverviewThe GraphQL API acts as a gateway/proxy for the different microservices it exposes. The resolvers of the GraphQL API make calls to the gRPC microservices through client-server communication. The services and the data interchange are defined using Protocol Buffers. The gRPC microservices handle and fulfill the requests whether they are database or storage operations or any other internal or external calls. DiagramA diagram of the architecture is shown below. This architecture implements the following Microservice Design Patterns:
LayersAPI LayerGraphQL acts as the API Layer for the architecture. It takes care of listening for client requests and calling the appropriate back-end microservice to fulfill them. Microservice LayerMaliJS was chosen as the framework to do the gRPC microservices. Protocol buffers was used as the data interchange format between the client (GraphQL API) and the server (gRPC microservices). Persistence LayerPostgreSQL is used as the database and Sequelize is used as the Object-Relational Mapper (ORM). DeploymentDeployment is done with containers in mind. A Docker Compose file along with Dockerfiles for each project are given to run the whole thing on any machine. It's recommended to use Kubernetes for deploying microservices at scale in production. Istio takes care of service discovery, distributed tracing and other observability requirements. How to RunPre-requisitesYou must install the following on your local machine:
Running
Video Demo (old) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论