Dạ theo anh, khi nào mình dùng grpc và khi nào mình dùng restapi trong dự án là phù hợp ạ. 1 service có nên implement rest and grpc k ạ
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hiện tại bọn anh chia thể này:
1. Restful: Dành để giao tiếp với user hoặc cho các api gateway để các bên thứ 3 gọi vào, vì nó đơn giản cho người dùng và scale nó cũng dễ hơn là dùng gRPC (socket)
2. gRPC: dành cho các service bên trong, không cần cấu hình SSL, dùng protobuf cũng tiết kiệt được nhiều dung lượng, vì nó là tcp socket nên cũng nhẹ hơn là Restful base trên HTTP