For my new project, I have to use Micro Services with Api Gateway. So I gathered detailed informations about Micro Service but the Api Gateway part is not clear.
My question is,
I am using C#.Net to develop Api.
I got some info about Api Gateway from https://www.nginx.com/blog/building-microservices-using-an-api-gateway/
The API Gateway offers a reverse proxy to redirect or route requests (layer 7 routing, usually HTTP requests) to the endpoints of the internal microservices. The gateway provides a single endpoint or URL for the client apps and then internally maps the requests to a group of internal microservices.
Kong Gateway is a highly scalable, open source API gateway optimized for microservices and distributed architectures. Kong built the gateway on top of top of the NGINX web server, and governs it using the Apache 2.0 license.
An API gateway's primary benefit is that it standardizes and centralizes delivery of services through APIs or microservices. Beyond this, API gateways also help secure and organize an organization's API-based integrations in a number of ways.
A short answer Yes, you can survive with Spring Cloud API Gateway and no Service Discovery. But it's really dependent on the size of your application and the amount of traffic it will be handling. You can start migration to microservices without Service discovery.
You pretty much asked three questions and they're all somewhat related so I'll try my best to address all three together.
For one, request routing in an API gateway is more than just a proxy and the implementation would not involve conditions to examine the request before shipping it off to a downstream service. API gateway would likely be the only entry point to your services in which authentication would also be taken care of on the layer to make ensure that a request has the permission to go to a downstream service. Authentication is likely to be another service itself. The high level implementation of the API gateway is likely to consolidate most if not all of the endpoints on all the downstream services.
Lets take a small example such as an e-commerce application that includes a service for listing products, searching products, and shopping carts. The API gateway would then also have these same endpoints and will delegate the request further to a service responsible for the request. The API in this example may have /products
to list all products, /products?query=...
to search products, and finally /carts/:id/products
to list the products in a shopping cart. Hope this answers your question.
Aside from that, I know that you've mentioned that its for a new project and just wanted to give you 2 cents that this may not be the best architecture to use for your new project if your team is really small because there is a large operational overhead. Overhead that requires standardization, automating deployments, integration, etc. Its probably best to start off with a traditional MVC architecture and slowly evolve it to microservices when the project has taken off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With