I am looking for advice on an optimal architecture pattern that will meet the needs of my application.
I have a couple of client applications using various FE technologies (primarily angular 1.x and angular 4.0 both using Typescript). These applications make use of several RESTful APIs. Pretty straightforward.
There are a couple of things I would like do optimize and there are opportunities for these applications to share code.
Currently, the front end applications are doing a lot of transformation work and post-processing of the API data for the view. I would like to move this work to a middle-tier application in order to make it more performant and cacheable. Modifying the APIs directly is not an option. This middle-tier currently handles a request from a front-end application, makes the associated API call, transforms the data and returns it to the client.
I am looking to build an SDK for working with the middle-tier API from the clients and from the actual REST API from the middle-tier.
All code will be in Typescript. Eventually everything will be consolidated into an isomorphic application so I'd like to start sharing code on the client/server where possible.
Does it make sense to create a single, configurable SDK (basically change the URL and request headers) that both client and server can use since this is essentially just proxying the request?
Or is it preferable to create an SDK for the middle-tier and one for the REST API even though the code is going to be mostly identical?
Is there a better pattern for this type of thing?
Aucun commentaire:
Enregistrer un commentaire