2
votes

I have a working app I made using Amplify (with AppSync API and Cognito). I'd like to make another app which is different, but shares some data with my first project (same product, but different targets, usages and security rules).

Is there a clean way to use Amplify for that new project, telling the GraphQL API to fetch some data in the DynamoDB from my first Amplify project ?

This data will change often and will be heavy - so I'm not too much into any synchronization solution.

I thought about those solutions, but I'm not experienced enough to tell if one of them is good:

  • Not using Amplify but SAM for this new project (but I will lose all the build pipeline provided by Amplify)
  • Using Amplify for the Hosting and the Auth, but configure AppSync with SAM and plug it into my existing DataSource
  • Maybe CloudFormation can be the answer, but I don't see how to interact directly with it within Amplify

Schema

1
Have you thought about using the multi-frontend workflow? docs.amplify.aws/cli/teams/multi-frontenddfranca
Yes, but I'd like to get different backends as well - with different GraphQL api schemas and different User Poolsmaxime
You can use a micro services architecture with AppSync aws.amazon.com/blogs/mobile/appsync-microservices If this is the only data you need, maybe the easist way to do is crating a resolver to query the data from there.dfranca
I'll expand this on an answerdfranca

1 Answers

1
votes

There is an article from Amazon about microservice architectures that might be useful for you https://aws.amazon.com/blogs/mobile/appsync-microservices/

I'm not sure if Amplify supports adding multiple APIs to it, if so, you could add it and then pull only that api on it.

IMO the easiest approach would be just creating a query endpoint to fetch the data from your other datasource, using lambda.

So, in that case you would edit your schema to something like this

query
{
  externalData [ExternalData] @function(name: "getExternalData")
}

Then you need to add the lambda function getExternalData, which will be responsible to query the data as needed.

The article above has more in-depth details about this architecture