Does Istio provide the ability to merge content of multiple backend APIs in a single endpoint? - istio

We're evaluating Istio and KrakenD for our API Gateway solution and trying to understand the differences in their functionality. One thing that stood out in the KrakenD docs is its ability to merge the content of multiple backend APIs into a single endpoint response to caller, as well as the ability to filter the content of responses, to remove "extra" data and/or change the names of attributes, etc. Trying to determine if Istio has similar capabilities but so far the Istio documentation hasn't been too helpful.
Does anyone has experience/info with this?

As of v1.16.x istio does not have capability of aggregation and transformation out of the box.
But it supports Proxy Extensions with WASM plugin.
That allows you to write custom code to decorate request/response.
You can use any language as long as it compiles to WASM.
https://events.istio.io/istiocon-2021/slides/c8p-ExtendingEnvoyWasm-EdSnible.pdf
https://istio.io/latest/docs/concepts/wasm/

Related

Strongly typed calls to other microservices in LoopBack v4

I'm currently evaluating the suitability of LoopBack for a future microservice-based project. Moreover, I'm new to LoopBack, so please correct me, if a misunderstood the concepts of Loopback.
At times, you need an aggregator microservice which calls several others. Is it possible to generate a strongly typed client library stubs (in the form of a Service) analogous to the lb4 openapi command?
And if not, what is the point of using TypeScript (as advertized), when one has to use pure JavaScript as shown in these examples (1) (2)?
Also is there an option to use an OpenAPI spec file from existing services?
It seems to me that this is a 'terra incognita' at this point for LoopBack v4 with TypeScript.
Disclaimer: I'm a maintainer of LoopBack.
There are a few things involved here:
Communication between microservices - we support REST and gRPC via connectors, such as loopback-connector-openapi and loopback-connector-grpc.
As you mentioned, it's on the roadmap to generate service stubs - see https://github.com/strongloop/loopback-next/issues/1070#issuecomment-403530459. The lb4 openapi command has implemented a lot of logic that can be applied to lb4 openapi-stub. Contributions are welcome!
You should also check out https://github.com/strongloop/loopback4-example-shopping/pull/268.

Migration path for Fql.multiquery

I'm new to Facebook development. I'm working on migrating an existing app in accordance to the Graph API upgrade guide. I'm looking for guidance around calls such as api.facebook.com/method/Fql.multiquery.
My question is: does this type of API need to be upgraded as well, or does it only apply to graph.facebook.com calls? I want to ensure that api.facebook.com/method/Fql.multiquery calls will still work after 4/30/15.
You may want to take a look at the Batch Requests of the Graph API. You can also specify dependencies between the requests.
Calls to http://api.facebook.com/method/Fql.multiquery will no longer work. The REST API is long deprecated anyway.
As #luschn said, you have to migrate to the Graph APIs batch requests, and use the /fql endpoint. You can only use FQL if you have a v2.0 app, and not higher.

Considerations for using auto generated proxies for web services (Advantages and Disadvantages)

We are using a lot of manual code in .net (through HttpWebRequest) to access some web services. I was reading we do not need to do this as we can easily generate proxies. Has anyone converted from manual to auto-generated services. We do need to use some customized settings like UseProxyServer based on config settings and client certificates.
What are the considerations I need to take care of? Any helpful link is really appreciated.
Update (as pointed by John Saunders): Our web services are using WS-Security and hence the need to pass UsernameToken.
Anything you would have set "manually" can be set on the proxy class. You should use the proxy unless you have a specific reason not to. It will save you a great deal of time that you could spend solving other problems.

Describing REST services using WSDL

I understand that you can describe your REST webservice while using WSDL.
Is this a good idea if you don't use WCF? Is there a better way to allow service discovery and bind your request/response to certain types?
If you use json you can use SMD and JSON-Schema but what if you use XML or YAML?
EDIT:
I have found this specification for WADL.
How widely used is it?
The Http Accept header and Content Type headers are there to allow a client to dynamically request and respond to different types. Statically describing what those types are in some kind of description file like WSDL would be unnecessarily limiting.
The use of hyperlinks within the returned representations allows for incremental service discovery. This allows the service discovery to be dynamic based on a whole range of factors.
The use of a global static service discovery document like WSDL or WADL is really not the optimum solution with a REST service.

Advantages of Name Value Pairs to SOAP/WSDL

I see APIs such as PayPal, etc. offering to call their services using NVP or SOAP/WSDL. When using a .NET environment (3.5) using traditional web services (no WCF) which is better and why? I know WSDL lets you drop in the API URL and it generates the wrappers for you. So then why do companies even offer NVP?
There seems to be never-ending confusion in this industry about the different types of web services.
SOAP is a messaging protocol. It has as much in common with REST as an apple has with a lawn tractor. Some of the things you want in a messaging protocol are:
Headers and other non-content "attributes."
Addressing - routing of a message to different servers/recipients based on the headers;
Guaranteed delivery via queuing and other methods;
Encryption, signing, and other security features;
Transactions and orchestrations;
Accurate representation of complex structured data in a single message;
...and so on. This is not an exhaustive list. What WSDL adds to SOAP, primarily, is:
Discoverability via a contract, a form of machine-readable "documentation" that tells consumers exactly what is required in order to send a message and allows proxies to be auto-generated;
Strict, automated schema validation of messages, the same way XSD works for XML.
REST is not a messaging protocol. REST is a system of resources and actions. It is a solid choice for many architectures for several important reasons as outlined by other answers. It also has little to no relevance to "NVP" services like PayPal and flickr.
PayPal's NVP API is not REST. It is an alternative, RPC-like messaging protocol over HTTP POST for clients that don't support or have difficulty supporting SOAP. This isn't my opinion, it's a statement of fact. One of the fields in the NVP is actually METHOD. This is clearly RPC verbiage. Take a look at their API for UpdateRecurringPaymentsProfile and try to tell me that this makes a lick of sense to describe as a "resource". It's not a resource, it's an operation.
In the case of PayPal specifically, the "NVP" (HTTP POST) API is inferior to the SOAP API in almost every way. It is there for consumers who can't use SOAP. If you can use it, you definitely should.
And I'm not necessarily bashing PayPal for this, either. I know a lot of folks have bashed them for not putting together a "proper" RESTful API but that is not what I am getting at. Not every service in the world can be accurately described with REST. PayPal isn't really a resource-based system, it's a transactional system, so I can forgive their architects and developers for not having a perfectly elegant REST architecture. It's debatable perhaps, but it's not black-and-white. It's fine; I'll just use the SOAP system if I need to.
Compare this to, say, the Twitter API. This is a true REST service. Every "operation" you can perform on this API is accurately described as either the retrieval or submission of a particular kind of resource. A resource is a tweet, a status, a user. In this case it literally makes no sense to use a complex SOAP API because you're not really sending messages, you're not performing transactions, you're just asking for specific things, and these things can be described with a single URL. The only difference is that instead of getting an HTML web page back, you're getting some XML or JSON data; the way you request it is exactly the same.
A REST Web Service usually (always?) uses HTTP GET for the retrieval of some resource. And Twitter does exactly this. GET still uses "Name-Value Pairs" - that's the query string, ?q=twitterapi&show_user=true. Those bits after the ? are name-value pairs. And here's a great example of why you would want to use REST over SOAP; you can hook this up to an RSS feed and get streaming updates. I can turn it into a Live Bookmark in Firefox. Or I can download it in JSON format and bind it to something like a jqGrid. The interesting thing is not that the request uses "Name-Value Pairs"; the interesting thing is that it's a simple URL and can be consumed by anything that knows how to request a web page.
So to try and summarize all of what I've said, think of it this way:
Use a REST API (if available) when you want to expose data, or consume or publish it, as a permanent resource.
Use a SOAP API when the system is transactional in nature and/or when you need the advanced features that a complex messaging protocol can offer, such as RM and addressing.
Use an RPC API (which includes just about any API that's modeled entirely around HTTP POST) when there is no SOAP API or when you are unable to use the SOAP API.
Hope that clears up some of the confusion.
I assume that by Name Value Pairs, you mean REST services.
The benefits to REST are primarily ease of development, simplicity and elegance, and lower overhead (which is very important if you are sending and receiving a lot of small messages).
Here are some of the advantages of REST:
REST is more lightweight
Human readable results
Everything is a URI addressable resource
REST services are more easily cached
REST is easier to build (no toolkits are required)
REST is easier to call (HTTP - GET, POST, PUT, DELETE)
NVP is HTTP POST
name=fred
amount=100
code=403
etc
This is the default format from any HTML browser so it's simple to implement for sending data to a web service
I don't think it's a good format for receiving data from web service? JSON or XML would be more suitable
No everyone uses VisualStudio, or has access to automatic wrapper generators, or wants to use such a beast
Many web mashups are coded in Javascript, so using HTTP POST to send data is the simplest way. The return result is a standard HTML response code (200, 403, 500, etc) and/or some JSON
Many service providers offer multiple API's to cater for all customers