Connecting to backend directly from Apigee

Hi,

Recently a customer shared the following scenario with me. They have a DB layer which is comprised solely of stored procedures. They have 2 thin layers written on top of the DB layer:

  1. a layer to simply invoke the SPs, do some minor massaging of the data
  2. expose an API on top of the previous layer

As a replacement, I developed a POC on Apigee's HostedTarget itself and used that layer for connecting to the DB, massaging the data as well as exposing the API itself.

Is this a recommended practice? Or am I missing some gotchas here?

Eg: I realized somewhere during the POC that I cannot have multiple versions of the HostedTarget co-exist with variations in the base-path (unlike what is possible with standard Apigee api-proxies).

1 4 248
4 REPLIES 4

Can't you connect to the backend API layer (2) from the proxy without a hosted target?

I could use Java callouts to fire the SPs on the DB from the apiproxy itself without using a HostedTarget. But for a variety of reasons I prefer not to use Java callouts unless there is a performance issue which I'm trying to solve.I could also use node.js from within the apiproxy, however as that is being deprecated I would rather not go that route.

Hence the queries:

  1. What's recommended by Apigee?
  2. What other alternatives exist?

With multiple revision/basepath deployment are you looking at versioning?

Alternatives,

  1. How about deploying your Node app to cloud and calling it using Service callout policy?
  2. Having multiple proxies?
  3. If AWS is in your picture, maybe you can look at AWS Lambda for your Nodejs app connecting to DB.
    1. Within Apigee use the AWS-Lambda-Extension to execute the nodejs functions.
    2. https://docs.apigee.com/api-platform/reference/extensions/aws-lambda/aws-lambda-extension-100

Thanks @Siddharth Barahalikar for the response.

Versioning isn't really my primary use-case. I just wanted to know if there are any other such points that differ between normal api proxies and hosted targets.

Regarding your other points:

  1. For this particular use-case we do not want to introduce any other non-Apigee components.
  2. I'm assuming you suggested multiple proxies to solve the versioning problem. Yes, that's what I thought as well. However, as mentioned above, that's not really a big issue for me right now. I'm just curious about the overall differences.
  3. There is no AWS infrastructure in the picture at the moment.