Why would I use xml instead of node? In what situations is node preferable?

Not applicable
 
1 4 238
4 REPLIES 4

Hi @Josh Martin,

Personally to me I would go to node for the following scenarios:

* If you are using BaaS and you want to add business logic on top of the data then use node.

* Use node for any sort of server side business logic which you may want to write.

*. If I am trying to build a mashup. You can build it using policies and js and those work fine too but if you are trying to make more than 2 or 3 downstream calls then I think using node makes more sense.

- If you have a requirement of making multiple calls in parallel there is no policy way of doing that. You can use node's parallel module to achieve this though.

* If I am trying to connect to a non HTTP backend like database,MQ etc.

* If I am trying to host a few quick an easy html pages.

*. If I am trying to run a complex business logic to connect to different backends.

eg. If condition A matches then go to URL1. Construct URL1 with these variables. If condition B matches then go to URL2 . Retry on URL2 for 5 time before responding with a error.

The XML based policies are great for doing relatively simpler repetitive tasks which do not need complex business logic like XML to JSON to threat protection or caching etc.

Let me know if that helps.

Awesome, @sarthak. In our StreetCarts API project, we ended up using Node for ease/convenience/familiarity. And because we're proxying API BaaS, we could use Node script to map the actual API design we wanted (in the proxy) to the BaaS API.

One potential benefit of XML, we found, was the ability to use named TargetServers for routing to a backend. In a test environment, the "foo" target server is configured with one server/port/config. When the proxy gets moved to production, we don't have to change the name "foo" in the proxy. Instead, production has a TargetServer configured with a different server/port/config. So deployment in that case becomes seamless.

@Floyd Jones Similarly on the lines of TargetServers there are a few other benefits:

Cache - you cannot use cache from node.

KVM - No direct way to use KVM.

Similarly today you cannot use Vault without node.

Hello all, I wanted to add an important note: encrypted KVMs are here. Details are in our documentation: http://docs.apigee.com/api-services/reference/key-value-map-operations-policy . You now have an option for encrypted data without having to use Node.js.