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:
- a layer to simply invoke the SPs, do some minor massaging of the data
- 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 Like
Can’t you connect to the backend API layer (2) from the proxy without a hosted target?
1 Like
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:
- What’s recommended by Apigee?
- What other alternatives exist?
With multiple revision/basepath deployment are you looking at versioning?
Alternatives,
- How about deploying your Node app to cloud and calling it using Service callout policy?
- Having multiple proxies?
- If AWS is in your picture, maybe you can look at AWS Lambda for your Nodejs app connecting to DB.
- Within Apigee use the AWS-Lambda-Extension to execute the nodejs functions.
- 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:
- For this particular use-case we do not want to introduce any other non-Apigee components.
- 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.
- There is no AWS infrastructure in the picture at the moment.