博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java开源api网关_常用的几个开源 API网关管理系统
阅读量:7028 次
发布时间:2019-06-28

本文共 4008 字,大约阅读时间需要 13 分钟。

The primary purpose of a web API is to expose data to be consumed or changed. Fairly quickly, the question of securing access to such data presents itself. And other aspects become critical too, such as performance management API or the respect of access quotas.

When it comes to a single API, the most direct approach to treat these secondary but important needs is to directly add these responsibilities in the API itself. Many solutions exist for this. Security solutions can be more or less sophisticated: simple htaccess protecting access to resources, using a library such as spring Security or Apache Shiro if developments are made in Java, Passport with NodeJS bookstore, etc. Once the caller’s identity is known, quota management is only a matter of reads & writes to a counter. Cache management can be done through dedicated libraries or by the same libraries used to build the API (Jersey, Restlet, etc.)

Since creating a Web API is now rather simple, APIs tend to proliferate. When the number of APIs becomes quite important, these requirements obviously can be considered cross-cutting needs. And therefore it is not unreasonable to suggest that they can be treated outside the API.

How to implement these cross-cutting needs? A reverse proxy is a possible approach. This component is commonly called an API Gateway.

A typical API Gateway includes:

Security (authentication, and potentially, authorization)

Managing access quotas and throttling

Caching (proxy statements and cache)

API Composition and Processing

Routing (possibly processing) to an “internal” API

API health monitoring (performance monitoring, error …)

Versioning (with the possible negotiation of automatic version)

0818b9ca8b590ca3270a3433284dd417.png

Advantages:

Implemented in one single place

Simplifies the API source code itself, since these concerns are externalized

Provides a central and unique view of the API and therefore be more likely to allow a consistent policy

Drawbacks:

Possible single point of failure or bottleneck

Risk of complexity, since all the API rules are in one place

Risk of lock-in, and migrating away may not be simple

Is it a great idea that nobody has thought of yet? No, far from it, since many publishers now have solutions of this kind, with variable amounts of features and different maturity levels. Commercial products are now numerous and started to get acquired by large publishers cycles (example: Intel acquired Mashery in 2013, Computer Associates acquired Layer 7 in 2013) or to enter partnerships (SAP and Apigee 2014). Not all are equal, some stand out and have already gained notoriety (Layer 7 for instance, with his API guru workforce).

What about open-source?

There are some open source initiatives but strangely, this market is yet to be taken (anyone up for it?):

All these solutions do not have the same traction in the world of open source and are not equal, far from it, in terms of features. To date, WSO2 API Manager is the richest in features and is well-polished. It is a good platform candidate to implement an API Gateway at a reasonable cost (cost of learning the technology and deploying it). Even though this solution is advanced, it does not necessarily cover the full spectrum of features of its commercial competitors.

There is always the possibility of custom-assembling a solution when the needs do not seem to justify the adoption of a turnkey product. Several open source reverse proxy solutions can be configured to provide the basic functionality of an API Gateway. But beware the long-term costs of this approach.

In conclusion, carefully analyze your needs to identify the appropriate strategy: supporting these aspects in the API itself may look like a good and cheap option, but it will lose its appeal if your API portfolio grows. Soon enough, the adoption of a specialized solution will prove to be a good investment. Whether it is open source or not, free or not, custom or off the shelf, on-premise or SaaS, and so on, will depend on many other parameters that need to be examined.

转载地址:http://thexl.baihongyu.com/

你可能感兴趣的文章
Struts2 标签库讲解
查看>>
vlc
查看>>
提高电影制作水平
查看>>
.net Form在ios上无法存储HttpCookie 经历
查看>>
Android PackageManagerService详细分析
查看>>
Ubuntu_12.04 server amd64安装读取数据失败以及samba的配置
查看>>
读懂Oracle 10053事件
查看>>
android SD卡路径问题以及如何获取SDCard 内存
查看>>
我的友情链接
查看>>
原型模式与对象的拷贝
查看>>
一元二次方程的求解
查看>>
国外那些优秀的 Drupal 教程博客
查看>>
JavaScript强化教程——AngularJS 指令
查看>>
ubuntu登陆界面只有guest session的解决方法
查看>>
MongoDB分页以及复杂条件查询例子
查看>>
log4j.properties配置详解与实例
查看>>
「RAAS」又什么?气隙技术的发明加密货币安全
查看>>
第三关练习题 权限
查看>>
IOS开发--循环引用问题,普通控件为什么用weak,代理为什么用weak,block内用到外面的东...
查看>>
Java初学者怎么学习才能快速入门?
查看>>