简体   繁体   English

AWS Amplify数据库选项

[英]AWS Amplify database options

I am considering using AWS Amplify to create a backend for my app(s). 我正在考虑使用AWS Amplify为我的应用程序创建一个后端。 I was hoping to use OrientDB which I have set up on an EC2, but all the examples and tutorials for Amplify only mention DynamoDB. 我希望使用在EC2上设置的OrientDB,但是Amplify的所有示例和教程都只提到了DynamoDB。 Before I spend a lot of time learning how to use Amplify, is it possible to connect to any type of DB that can be installed on an EC2, or is DynamoDB all that is available? 在我花很多时间学习如何使用Amplify之前,是否可以连接到可以在EC2上安装的任何类型的DB,还是可以使用DynamoDB?

Yes, you can. 是的你可以。

After amplify init and amplify add host amplify initamplify add host

Run amplify add api 运行amplify add api

  • Choose REST 选择REST

  • Choose Create a new Lambda function 选择创建新的Lambda函数

  • Don't choose CRUD function for Amazon DynamoDB table 不要 为Amazon DynamoDB表 选择 CRUD函数

  • Choose Serverless express function (Integration with Amazon API Gateway) 选择无服务器表达功能(与Amazon API Gateway集成)

At your project ./amplify/backend/function , you'll see your lambda express. 在您的项目./amplify/backend/function中 ,您将看到lambda表达。 And then you can connect to any database you want. 然后,您可以连接到所需的任何数据库。 Just need to input the connecting DB code. 只需输入连接的数据库代码。

Amplify is at the moment tied to dynamoDB in a very strong way. 目前,Amplify以非常强大的方式与dynamoDB绑定在一起。 But you can use graphQL queries sent to AppSync (the backend layer of amplify) to trigger lambda functions . 但是您可以使用发送到AppSync(amplify的后端层)的graphQL查询来触发lambda函数 From there you can target any type of database you want 从那里,您可以定位所需的任何类型的数据库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM