AWS Amplify database options - ios

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

Related

connecting to Dynamodb from iOS (Swift) using AWS Amplify

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)

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.

iOS (Swift) project needs to read an Azure SQL database

I am creating an iOS project that needs to read a SQL database in Azure. I have the database Server location, port, username, and password. I don't need to write to the database, just read it. I am more familiar with Firebase or Parse and have never used Azure. How do I even go about starting this? I tried the sample project that Azure makes for you but I don't have any tables? Do I need this? Any help would be welcome.
Azure Mobile App Service can connect with your existing SQL database
this thread explains the process where you use the existing SQL database. With this option Azure manages most of the inner workings for you.
If you want to build the Rest API from "scratch" using your existing SQL database You have some more options:
Azure API Management allows you to publish API's securely and at scale, A server less Azure Function like the example in this article Rest API with Azure Functions and Azure SQL Database or build a rest API using an Azure Logic App which doesn't require you to write code. You could also use Nodejs or many other tools you just need to evaluate what would work best for your use case.

Transferring from Parse-Server to dynamoDB. What foreseeable obstacles are there?

As we all know, I'm one of the thousands of devs who relied on Parse and now forced to find Parse alternative. While transferring Parse-Server to AWS+MongoDB, I've discovered DynamoDB. I'm thinking of just tranferring my whole server side logic to DynamoDB. What are some of the problems that Parse doesn't have that might exist for DynamoDB?
Since Parse includes a web server, you can interact with it via simple HTTP requests. DynamoDB is just a database, so you would need to connect directly through the AWS SDK, or build an API in front of it, possibly using API Gateway and Lambda.
In addition, since Parse is a full-featured Backend as a Service, and DynamoDB is only a database, there are some features in Parse that won't be available if you just use DynamoDB directly from your iOS application. For example user password resets require sending an email to the user. DynamoDB has no "password reset" functionality and can't send emails directly. You would have to build that feature yourself using something like Lambda and SES.
Parse also handles file upload and file hosting, which are features you would no longer have if you just used DynamoDB directly from iOS. You would have to build those features yourself, possibly using S3.
If you are only using Parse as a data store then using DynamoDB directly could certainly work for you, but then again so could MongoDB or any other NoSQL database. You should definitely explore how your database schema would look in DynamoDB before committing to it, because there are certain restrictions on index types and query types that might make it difficult to transition your current schema.
AWS + DynamoDB would be your way to go.
I worked extensively in both, DynamoDB and MongoDB systems and can give you a short summary of an advise.
MongoDB is very easy to work with and has unmatched flexibility in query structure, requires very little thinking ahead of setting up the system.
DynamoDB will provide unmatched scalability, much stricter (very strict) set of rules for creating schemas and requires a lot of planning before you do the setup. However, you don't need to worry about setting up or managing database environment, no worry about master/slave architecture and no concerns of scaling your database.
I go with DynamoDB these days and it's been great.
Just completed a migration from Parse to AWS Dynamo (a few thoughts were posted here: https://www.linkedin.com/pulse/parse-aws-migration-server-less-mobile-backend-mike-kirkwood?trk=prof-post
My experience was that DynamoDD was an acceptable replacement for much of Parse. However, it required some data model changes as DynamoDB doesn't support Pointers or Relationships like Parse did. So, in the app had to adjust some of the writes to add more data to the record in DynamoDB. This did offer some nice benefits in the queries.
DynamoDB also allows you to add indexes to match specific queries.
And, for my use, DynamoDB has proven to be much faster queries than Parse was.
DynamoDB is just a database service, so you can use it to store Parse data but you'll still need a server to process the data and host APIs, etc... On AWS, you could spin up an EC2 instance to run the server, or try to make it run on Lambda.
Parse Server does not natively support either Lambda as a hosting environment or DynamoDB as a storage backend, but fortunately members of the community have recently developed integration for both of these:
https://www.npmjs.com/package/parse-server-dynamodb-adapter
https://github.com/parse-community/parse-server/issues/483

Backend for iOS

I need a backend to store location updates and messages, I was thinking of using JSON to connect to the Amazon S3 server and to fetch and store data.
How many clients could be connected to this server? Is there a way to link a MYSQL server to Amazon S3 for login and users accounts?
S3 is not a database store; you write/delete/replace an entire object.
You want AWS RDS. Amazon manages the DB (MySQL supported). Skim the reference architectures for something applicable to your needs. Scale them down; they're designed to make use of as many AWS services as possible.
http://aws.amazon.com/rds/
http://aws.amazon.com/architecture/
Other option is Amazon Dynamo DB. This is an infinite-scale nosql db with a fully managed REST API. You dont worry about the data size growth, speed etc. AWS take care of all these.
http://aws.amazon.com/dynamodb/.
Even in this case, you need to have some code running in the backend, which receives your REST calls from the iOS and writes to the Dynamo.
Other even easier solutions are https://parse.com/ and https://www.firebase.com/
These are solutions specifically for your kind of needs - Make a mobile backend Datastore. They give client SDK, which has a very great value in terms of offline synch. You just invoke the SDK from the apps and will synch with the backend datasore when the connections are available - reduces your code complexity a lot !

Resources