Since the birth of the software industry, technology and business have always been complementary. Business innovation promotes the transformation of software architecture from the earliest single architecture and distributed architecture to the current hot microservice architecture and Serverless architecture born in the cloud era. The API gateway still plays an important role for the Serverless architecture as a traffic gateway and API manager for individual applications and microservices architectures.

What is a Serverless

Serverless architecture, namely “Serverless” architecture, is a new revolutionary architecture mode in the era of cloud computing. The core idea is that users do not need to pay attention to the status, resources (such as CPU, memory, disk and network) and quantity of the underlying server supporting the operation of application services, and the computing resources required for the normal operation of software applications are dynamically provided by the underlying cloud computing platform. AWS Lambda, for example, is a computing service that runs the user’s code according to time, regardless of the underlying computing resources. The emergence of Serverless brings great business value to enterprises:

  • Cost reduction: In order to cope with the possible business peak, we have to buy more resources in advance, such as network, hard disk, CPU, etc., but these resources are often idle and cannot be fully utilized. In the Serverless architecture, services are charged on demand according to the pay-as-you-go principle of cloud computing, saving the cost of use.
  • Simplified OPERATION and maintenance: Serverless architecture decouples software services and servers so that developers only need to focus on their own business and do not need to care about the underlying hardware, greatly simplifying operation and maintenance.
  • Fast development: Application functions in the Serverless architecture are realized by stateless functions one by one, thus reducing the coupling degree between functional modules, thus greatly improving the efficiency of software development and shortening the time to market of products.
  • Fast iteration: With the Serverless architecture, enterprises can quickly develop various application prototypes for users to use and carry out low-cost trial and error, thus enhancing enterprise innovation ability.

Why does Serverless need an API gateway

Most of the capabilities provided by the Serverless architecture are expressed in the form of apis. For service providers, they need to bind their own developed functions when defining the API; For the service caller, the API initiates a call to the function to obtain the execution result.

How should service providers manage the huge number of apis during the development process and open these apis to service callers efficiently and securely? The answer is — API gateways. The following figure shows the API gateway as the entry point for the API call, which eventually triggers the call process of the function. API gateway ensures the traceability of function calls through logging service, cloud monitoring, call chain and other functions.

1. API management

The API gateway provides the functions of API lifecycle management, including CREATING, publishing, editing, and deleting apis. After the API is published, users (service providers) can also debug their own apis. For Function Service, you only need to point the back end of the Service to Function Service when editing the API. The following figure shows how to specify the Function back end in the CONSOLE of JINGdong Cloud API gateway.

2. Ensure the security of API calls

The IDENTITY authentication mechanism of THE API gateway ensures user legitimacy, signature algorithm ensures that data will not be tampered with, and access authorization ensures that user calls are controllable. Functions such as WAF and IP whitelist effectively prevent malicious access.

3. Assisted in troubleshooting problems and recorded the invocation of function services

After the function service is created, each CALL request to the API passes through the API gateway, and the gateway generates a log. You can query the function that is invoked and the execution time from the log, which provides an effective basis for troubleshooting problems.

4. Provide SDK and documentation

After the API is created, users only need to download the SDK and documentation to quickly invoke the API.

Help API providers profit through the API center

Jingdong Cloud API Center is a media platform to realize the commercialization of APIS. You can release apis to the API center through THE JINGdong cloud API gateway for other users to purchase and use, and users pay fees according to the number of calls or traffic, so as to help you complete the commercialization and realization of APIS.

Serverless at your fingertips

The combination of JD Cloud API Gateway and function services will enable your enterprise and business to take one step closer to Serverless and become within reach. In the future, JINGdong cloud API gateway will also provide authentication methods based on wechat applets and Jingdong applets. Meanwhile, it will open API center to the outside world, promote the commercialization of API, provide dedicated services for you in the process of enterprise Serverless, help your enterprise and business better use the tide of cloud computing to improve efficiency and realize value!

Click on the”readingTo learn more about the API

Welcome to”Jingdong cloud”Learn more