DEV Community

loading...

Discussion on: Explain API gateway to me like I’m five

Collapse
crawlingcrusader profile image
Harshit Singh

I'll take a stab at it.

Imagine that you have 3 friends John, Johnny, And Jake. Each of your friend is awesome at one task. You decided to use your friends awesomeness
to help your neigbours. Everytime a neighbour comes in with a request you decide who's the suitable candidate, and assign him the task.
When the task is done, your friend tells you the result, and you convey that to the neighbour.

a- In this scenario you are acting as front door guy. You decide who can ask for help, how many times,
and which one of your friend should tackle the task/job
b- You all are sitting in the same room/garage*.

In a way here you are doing the job of an api gateway. Without you the neighbours won't know whether John or Jake is suitable for the
job. With you in the picture the customer don't even need to know about this. One sad day Jake had to change school, and you had replace his
position with Becky whose doing a better job now. And your neighbours don't really know or care whose handling the job. Then one day few other friends
joined you, and you being the front guy informed your neighbour about you new friends(endpoint)

API Garage

  • there's a lot of metaphors we can get into with each of your friends sitting in a different garage (say, lambda) with each garage configured and scaling as needed.

To a new developer:
API gateway is way to expose all the awesome capabilities you are developing. Say you developed an algorithm for video compression,
and picture compression. To run this algo you need a server. Now at this point while you are capable of running the said algo,
its still not exposed to any other user. And that's where API gateway comes in, you use that as a "front" for your servers running
your super awesome algo.

Forem Open with the Forem app