Amazon web services - basic workflow - mysql

I have a PHP/MySQL application test-deployed on a server, with a domain name that I own. In order for this to be a real world scalable product, I decided to use Amazon Web Services. However, I'm new to using cloud services (this is my first), and since the past 2 days, after going through tutorials and "how to start" guides given on Amazon, I've still been unable to grasp "what exactly should I do, so that I can use my present domain name and use Amazon's services?" My users should be able to access my product using, let's say www.xyz.com which is the name I own. My PHP code gets some data from client, which it then stores in a SQL DB. This is the existing, working set up.
Now, how do I get my PHP code, to use Amazon Web Servics and store it in a database that Amazon provides? My product's DB will be continuously growing, and I will pay for whatever is used. Also, if I decide to use the PHP services from Amazon too, does Amazon host my code? In that case, what will be the domain name?
To summarize, my biggest concern is the domain name I've bought, and I've seen no documentation on how to go forward in such a case.
This is the only part I have been unable to figure out, rest was clear from the documentation..
Thanks for your help!

Amazon Web Services (AWS) is a cloud platform composed of multiple services that jointly enable you to host infrastructure and applications on it. It's not a single offering that magically does everything for you. In order to achieve your goal you will want to do the following:
Use Amazon Elastic Compute Cloud (EC2) to spin up servers that host your PHP application. They will handle the incoming traffic for you. Have a look at this link to get started.
In order to store data you will want to use some sort of database. AWS offers various database types. Since you are looking for a SQL-type database, you will want to use RDS. This service allows you to provision a functional database and relieves you of certain administrative tasks.
In order to use your current domain, you will have to transfer its registration to AWS Route53. Just Google 'Route53 domain transfer' and the documentation will show you how to do it.
There are many whitepapers available that show architectural patterns across the AWS cloud. I suggest you read them so you can get a better understanding of the platform.

To get started quickly I recommend using Amazon Elastic Beanstalk for your purposes:
Amazon Web Services (AWS) comprises dozens of services, each of which
exposes an area of functionality. While the variety of services offers
flexibility for how you want to manage your AWS infrastructure, it can
be challenging to figure out which services to use and how to
provision them.
With Elastic Beanstalk, you can quickly deploy and manage applications
in the AWS Cloud without worrying about the infrastructure that runs
those applications. AWS Elastic Beanstalk reduces management
complexity without restricting choice or control. You simply upload
your application, and Elastic Beanstalk automatically handles the
details of capacity provisioning, load balancing, scaling, and
application health monitoring.
Learn more about it here
regarding the domain, you could transfer it to route 53
OR
route your domain traffic by using route53 name servers

Related

AWS Cognito to authenticate App users and retrieve settings from MySQL database

I am doing some research for a mobile app I want to develop, and was wondering whether I could get feedback on the following architecture. Within my future app users should be able to authenticate and register themselves via the mobile app and retrieve and use their settings after a successful authentication.
What I am looking for is an architecture in which user accounts are managed by AWS Cognito, but all application related information is stored in a MySQL database hosted somewhere else.
Why host the database outside of AWS? Because of high costs / vendor lock-in / for the sake of learning about architecture rather than going all-in on AWS or Azure
Why not build the identity management myself? Because in the end I want to focus on the App and don't spent a lot of energy on something that AWS can already provide me with (yeah I know, not quite in line with my last argument above, but otherwise all my time goes into database AND IAM)
One of my assumptions in this design (please correct me if I am wrong) is that it is only possible to retrieve data from a MySQL database with 'fixed credentials'. Therefore, I don't want the app (the user's device) to make these queries (but do this on the server instead) as the credentials to the database would otherwise be stored on the device.
Also, to make it (nearly) impossible for users to run queries on the database with a fake identity, I want the server to retrieve the User ID from AWS Cognito (rather than using the ID token from the device) and use this in the SQL query. This, should protect the service from a fake user ID injection from the device/user.
Are there functionalities I have missed in any of these components that could make my design less complicated or which could improve the flow?
Is that API (the one in the step 3) managed by the AWS API Gateway? If so, your cognito user pool can be set as Authorizer in your AWS API Gateway, then the gateway will take care automatically of the token verification (Authorizers enable you to control access to your APIs using Amazon Cognito User Pools or a Lambda function).
You can also do the token verification in a Lambda if you need to verify something else in the token.
Regarding to the connection between NodeJS (assuming that is an AWS lambda) that will work fine, but keep in mind the security as your customers data will travel outside AWS, and try to use tools like AWS Secret Manager to keep your database passwords safe and rotate them from time to time in your lambda.

Azure API Management Premium - do we really need a backup strategy

If we use Azure API management premium do we need to create a backup (disaster recovery) strategy?
It is replicated in as many separate regions as you want.
In the past, with non-premium we have called the API Management REST API to backup to Azure blog storage.
Obviously, you should always have a DR strategy but just wondering if it is overkill in this scenario.
Azure ApiManagement offers SLA on Proxy/Gateway uptime, so if you have a API Management deployed in multiple regions, the Proxy will continue to run, automatically failing over to non affected regions.
However the Publisher Portal, Developer Portal and Management REST Endpoint is still only hosted in the Master Region. If there a region wide disaster in the Master region of your service, they will not be accessible. Which would mean you cannot add new API/operations and new customers cannot subscribe for your service.
If one of the additional regions is impacted, the Proxy/Gateway it will sync up to latest configuration before starting up.

Host a mySQL Server

I am making a Javafx program and need to use a small mySQL database. Currently I am hosting one on my computer but I can't access it on other computers on other networks. I need the mySQL server to be accessible from anywhere. How do I host one that does that? Thanks in advance, all help is welcome.
Well you have a few options depending on how important this MySQL database is to you, how you intend to connect to it from outside, and what you want to do with it.
The naive implementation would involve opening your firewall and directing all incoming traffic using whatever port you have configured MySQL for to point to the ip address of your server. If you do this you absolutely must secure your database with a password!!! You'll also need to keep the server's public ip address handy so you know how to find it when you go out.
Use Amazon AWS, Google Compute, Google App Engine, or some other cloud platform to host a MySQL instance. All the big players also tend to host pretty awesome RDBMS solutions. The advantage here is that you're not exposing your home computer to malice and you are connecting into an ecosystem that will answer a lot of other questions for you as they come up along the way (IE - how do you ensure redundancy? Backups? Scale your network for traffic?). There's a ton of other advantages too. It's the cloud... dude...
Use a SaaS DB service such as Firebase (Note: We are leaving MySQL and SQL database territory with Firebase)
If you plan to let other parties access your MySQL instance to make use of your data, you might also want to consider implementing a REST API (or SOAP API if you hate the future) which acts as an abstraction layer to interact with and provide the data from your database in a consistent and reliable format.
Best answer I can give with the details afforded - look around though the options in this arena are near limitless depending on how and what you're trying to do.
You should be able to access your machine from your LAN pretty easily unless there is some firewall rules preventing opening connection to your machine. Another way is there are many cloud shosting providers has free tier you can signup to bring up a test instance of mysql. Example: Open Shift.

Cloud based web service for Web Applications

My web application uses PHP/MySQL on the server side to fetch and store data in a database. The DB size will increase with the user base, and can be huge. The application has been built and run on a conventional server, i.e no "cloud" specific code has been written (I have no experience with cloud systems; Is running services on them any different from running on a normal server?)
My concerns:
1. If I buy space on Amazon Elastic Compute Cloud, can I directly port all my code to the new server, or do I have to use some APIs specific to that? Since it's pay as you go, it's highly suitable for such a requirement.
2. What are the other options for hosting a web service that would require large server space? How might apps like Whatsapp be doing the same?
Thanks.
1) The answer to the first question depends on the type of service you're buying. Cloud comes in many forms, from Infrastructure as a Service (which basically offers you hardware as a service on which you can run your software stack) to Software as a Service (e.g. Gmail, which lets you use applications (or APIs) hosted in the cloud ).
The best alternative, in your case I think it is Platform as a Service (e.g Heroku) which defines a set of technologies supported by the provider and how to use them.
Either case, how difficult it is depends on your app and the specification of the service and the level of support offered, so you have to dig a little deeper (starting with guides of how to deploy a similar app would be a good choice).
2) Startups and other medium size companies use cloud providers such as Amazon, Rackspace etc and when they reach a certain size tend to build their own data centers (e.g Zynga). There's a threshold beyond which is better to manage your own infrastructure instead of buying services from others.

Measuring scalability of the web app hosted on cloud

I have developed a social networking site using the elgg framework and I am hosting it on amazon cloud (Amazon EC2, the free tier micro instance service) and thus develop a benchmark for it.I am creating around 200 columns describing each user (most of them dummy) and after that I should create around a million users with each users profile updated with some data.This is done to reflect the image of big data.When hosted on cloud we should measure the cloud's performance based on a query and an update action for all users. The problem is how to create so many users? Which tool would be optimal to choose? Done this, I should also consider storage on a file system(HDFS) and do the same with some modifications (The output should be a row and the input should be an unstructured data).
For elgg framework we are using mysql as backend. I have no idea how to start with it. Any suggestions would be really helpful.
Thank you.
I had to perform a similar task recently and came up with this script.. maybe it can help you