user3335395
user3335395

Reputation: 59

Getting started with AWS backend for iOS

I've been coding on iOS for awhile. I'm getting started to use AWS as a cloud backend to store my user's data for my iOS app as well as a server that can handle real time event in multiplayer mode. I understand that there are many services like Amazon Cognito that allows user login via public providers, Dynamo DB that provides noSQL storage, EC2 that help me create server instances. However, I'm really confuse on how I can actually get started.

Here's some stuff that I really need help on: I don't really want to use public providers like facebook for my users to sign in/sign up. I'd really prefer it if there could be relational database that is similar to how I cache data on local sqlite files using core data. And I also need some help on getting my ID tokens for those services if I choose not to use cognito, or must I?

I would really appreciate it if you guys can give me some clues on how I can get started on these. Thank you so much! :D

Upvotes: 0

Views: 986

Answers (1)

Mika
Mika

Reputation: 5845

Depending on how you expect your app to evolve there are several approaches you can take.

Option 1: Minimal scalability / low cost

All you really need is a single free EC2 micro instance. On the instance you can build a full LAMP stack in seconds. Once you have built it you can start writing an application to handle your app in your preferred language. Ruby is a la mode but any language will work. Your database will be stored on the actual instance. If you go with this route, one thing you should do is use an elastic IP address so that if your server ever goes down you can point the elastic IP to another instance. You should also periodically backup your server.

Option 2: Maximum scalability / variable cost

Use RDS to store your database. This will mean that any EC2 instance will be able to reach your data so you can have an unlimited number of servers. Then build an EC2 instance just like in option 1 but point your application to the RDS instance. Use a load balancer in front of your EC2 instance to scale up in response to changes in utilisation. And the elastic IP address should point to the load balancer.

Building a LAMP stack on EC2

  1. Open the EC2 console
  2. Select launch instance
  3. Pick the Linux AMI offered by Amazon and a micro instance
  4. Create a .pem key (keep is safe on your system or you will not be able to access your instance)
  5. Select the default security group
  6. Open your terminal window and type: ssh -i path_to_pem ec2-user@your_instance_public_address
  7. In the EC2 instance type sudo yum update
  8. Then type sudo yum install httpd24 php55 php55-mysqlnd mysql55
  9. sudo apachectl start

You now can navigate to the public address of your instance in safari and assuming I did not forget any steps you should see the apache welcome page.

Upvotes: 1

Related Questions