connecting to Dynamodb from iOS (Swift) using AWS Amplify - ios

I used to directly connect to access to Dynamodb table from iOS using AWS mobile SDK. Now AWS encourages to migrate to Amplify. in the documentation there is no guideline for Dynamodb read/write operations. Should we use API to access to Dynamodb or can we use AWSDynamoDBObjectMapper (see https://docs.aws.amazon.com/aws-mobile/latest/developerguide/mobile-hub-add-aws-mobile-nosql-database.html)

Unless I'm mistaken, because I'm new at this, I believe we have to use the REST API in order to make our calls to various AWS services in an Amplify context. So a Lambda function would perform your DynamoDB accesses.
UPDATE
When you add the REST API you will be asked what kind of function template you want to use. The first option is:
CRUD function for Amazon DynamoDB table (Integration with Amazon API Gateway and Amazon DynamoDB)

Related

How to traffic data between Google Cloud SQL and Flutter?

Cloud SQL documentation about connecting with external apps didn't helped me much. Isn't there some library to handle data traffic like Firebase's Cloud Firestore and Realtime Database offer?
Either use cloud functions to provide an API for Flutter and access to the DB
or run your custom server in the Google cloud that does that.
SQL databases should never be accessed over the internet directly and instead hidden behind a web server that only exposes a limited or specialized API.

AWS Amplify database options

I am considering using AWS Amplify to create a backend for my app(s). 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. 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?
Yes, you can.
After amplify init and amplify add host
Run amplify add api
Choose REST
Choose Create a new Lambda function
Don't choose CRUD function for Amazon DynamoDB table
Choose Serverless express function (Integration with Amazon API Gateway)
At your project ./amplify/backend/function, you’ll see your lambda express. 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. But you can use graphQL queries sent to AppSync (the backend layer of amplify) to trigger lambda functions. From there you can target any type of database you want

Does using ios-aws-sdk pass everything over SSL

I use AWS Lambda as a backend service to authenticate users from my ios app. When learning about Lambda I was pointed to use the Amazon API Gateway to make the data over the network go over HTTPS:// and NOT HTTP://.
Someone recently pointed out that all calls to AWS Lambda, DynamoDB, S3, and Cognito directly from my app automatically go over HTTPS://. Is this true or not?
Unfortunately the docs are not explicit on the matter, that I could find, but inspecting the source on github:
AWSService, one of the base services used by the sdk, uses https by default, and will only switch to http if the AWSServiceConfiguration particular configuration is established with the parameter useUnsafeUrl set to true.
And AWSLambdaService, even if initialised with a configuration object, appears to set the useUnsafeUrl option to NO.
So - inspection of the source suggests that all access to the service is by default https.
This is consistent with AWS SDK defaults in other languages/frameworks as well.
-- Edited to note --
I had a thought after posting this - it's possible that the advice to use API Gateway for https was based on the common practice of exposing Lambda functions as API endpoints. If you want to do that, then API Gateway gives you a way, and if you are using API Gateway, then you do need to ensure it is configured to use https.
What is not clear from your question is - from your app, are you invoking the lambda functions via the API Gateway endpoint? Or directly via the AWS SDK? If invoking directly via the AWS SDK then there is no need to use API Gateway at all.
If you are already using the API Gateway, and issuing HTTPS web requests to invoke your lambda functions, I wouldn't necessarily stop, because it gives you a nice point of abstraction and decoupling - you could completely change your backend implementation and as long as you keep the API Gateway endpoint configuration the same, your clients will still work. Alternatively, you could start to implement other clients or expose your API to 3rd party clients who aren't in a position to use AWS SDK and they will still be able to interract with your backend via standard HTTP protocols.

How do you load data to DynamoDB from Xcode using Swift?

I am a fairly new developer, and right now I am developing an app where I am using the DynamoDB database to collect user account info, then acquire it to verify during a login. However, I'm having trouble because all the instructions detailing how to deploy data to DynamoDB are written for iOS developers using Objective-C. I do not know Objective-C and am having a hard time trying to figure out what it means. Also, for those familiar with DynamoDB, do I have to use Amazon Cognito when uploading to DynamoDB?
The DynamoDB Object Mapper is a ORM layer that lets you use DynamoDB as a back-end for storing your data.
It seems like this is an example of how to use DynamoDB mapper with swift.

Using google endpoints with sql

I'm still new to GAE, and I would like to have more wisdom about couple of things.
I searched in documentation, but I think I'm just too stupid to understand some things from documentation.
How can I combine Google Cloud SQL with endpoints? Is there such possibility?
How can I use endpoints to upload videos to google platform?
You should be able to use anything you can do on a non cloud endpoints api to cloud endpoints like google cloud sql. But since it's on preview you might encounter bugs/changes when it goes out of preview. You should create a Cloud SQL tests models on regular app engine app then try to use it on cloud endpoints, so you can minimize debugging for errors.
https://developers.google.com/appengine/docs/python/cloud-sql/
You will need to use a blobstore api:
https://developers.google.com/appengine/docs/python/blobstore/
on your endpoints have a method that creates the upload url and use that to upload from your app then on the uploadHandler it will trigger once the whole file has been uploaded, process your blobInfo key store it appropriately.

Resources