Best Practice Multiple API proxies OR Multiple revisions deployed in same environment

what is the best practice when you have different backends and base paths while the proxy code remains same(except for target servers)?

Should you have a new proxy with a new base path or deploy the same proxy as two different revisions for the different base path.

0 3 860
3 REPLIES 3

Hi @Nagashree B, according to docs, deploying to same revision is generally done for Seamless deployment (zero downtime). I am not sure if it is a best practice in your requirement.

How about using multiple Proxy Endpoints with Route Rule(Conditions) routing to different backends?

If the Proxy/Target Endpoint Policies remain same for all basepath, maybe we can make use of Shared Flows with Flow hooks.

multiple-basepaths-targets-rev1-2017-09-17.zip

5651-screenshot-1.jpg

@Barahalikar Siddharth - The policies in the proxy remain same. the base path needs to be different and the corresponding backend targets need to be different. We are using target server configuration for configuring the backends in the target endpoints, that are determined by route rules.

Here is an example

basepath - v1/lookup points to target server T1 with backend servicev1/lookup

basepath - v2/lookup points to target server T2 with backend servicev2/lookup

What is the maintainability of the code in production if we have different base paths in the same proxy vs multiple proxies each having a single base path?

@Nagashree B, My preference is to have separate proxy considering following aspects:
  1. Keywords like v1 and v2 as part of the base path hint that these are different versions of the same service. As different versions may have different lifecycle, it would be easier to consider different proxies for managing deprecation, etc.
  2. Shared flow may be configured to reuse policies. In the absence of shared flow, Multiple Endpoints could have allowed to reuse policies.
  3. Higher number of proxies means deployment effort may increase if this is not automated. Otherwise, it's one time effort to create deployment task.