If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Exploring AWS Hosting

Started by blazonbazaar, Oct 26, 2023, 12:05 AM

Previous topic - Next topic

blazonbazaarTopic starter

I have never experienced hosting with Amazon Web Services, and I found it quite challenging to understand the multitude of services that are available compared to the typical PHP+MySQL hosting.



Additionally, I struggled to find a method to estimate the cost of cloud hosting for a PHP-based website with a size of up to 150 GB.
If anyone can assist me in navigating through this, I would greatly appreciate it.
  •  


diypudej

First up, an overview. AWS offers a huge suite of cloud-based products, but for a basic web application, you will be using only a few of them:

Amazon EC2 (Elastic Compute Cloud): These are virtual servers where you can run your application. You'll install your PHP environment here.

Amazon RDS (Relational Database Service): This is a managed database service where you can run MySQL databases. It takes care of a lot of the database management tasks for you, like backups and patch management.

Amazon S3 (Simple Storage Service): This is storage for the internet. You can use it to store and retrieve any amount of data, at any time, from anywhere on the web. It's a good place to keep static assets, but you can also host entire static websites here.

For estimating the costs, AWS has a pricing calculator that you can use: https://calculator.aws/. Here's a rough explanation on how to estimate costs for your specific use case.

EC2: On the calculator, add a product and choose EC2. You will be asked to configure it. For a simple PHP application, an instance like a t3.medium might be enough, but this will heavily depend on your specific application needs and expected traffic. Make sure to select the right region (the one closest to the majority of your users). You should also consider if you need to run your instances all the time. AWS charges per second of usage.

RDS: Add another product and select RDS. Choose MySQL as your engine. You can choose a small instance if your DB usage isn't heavy. Remember, RDS pricing also includes automated backups to S3 up to the size of the provisioned database.

S3: Add S3 if you plan to store files. You mentioned 150GB which will be the volume of data you will store. Make sure to choose the correct class storage depending on your needs.

Data Transfer: AWS also charges for data transfer. Outgoing data transfer is what can potentially increase costs. Incoming data transfer is normally free.

Optional - Elastic Load Balancer (ELB): If you're expecting a lot of traffic, you might want to consider adding a Load Balancer, which, as its name implies, distributes traffic across multiple EC2 instances to ensure your application remains available if one instance fails. It's optional and adds to the cost but improves your site's resilience.

It's important to remember that the costs estimated by the calculator will be a monthly cost, and these costs will go down if you reserve instances for a long period or buy in bulk. Prices also differ from region to region.

Because cloud hosting costs can vary based on a number of different factors, it's also a good practice to monitor your usage and costs regularly, which is something AWS allows through another tool they have, AWS Cost Explorer.

Last but not least, AWS has something called the Free Tier where certain services are free till you hit specific usage limits. This can be useful if you are just getting started or if you are running a very low traffic site. But be careful to not exceed the limits of the free tier or you could end up paying more than you anticipated.

I know it's a lot to digest, but once you understand how the services fit together and what each service does, it becomes much easier to navigate AWS and estimate your costs.

As you continue to use AWS, you'll learn that there are several ways to optimize your usage and bring down your costs. Here are a few strategies that could be relevant to your use case:

Right Sizing: This is about using the appropriate services and resources to match the requirements of your application. It is based on understanding your workloads and then choosing accordingly. What does that mean? For instance, if you don't require a RDBMS, and a simple key-value store would suffice, Amazon DynamoDB could be cheaper than RDS.

Auto Scaling: If your workload goes up and down, consider using AWS Auto Scaling. It adjusts the amount of computational resources that are being assigned to match the requirement. For predictable traffic patterns this can be scheduled, or else you can use demand-based scaling. This way, your cost will directly scale with your usage.

Reserving Instances: AWS provides an option to reserve instances for 1 or 3 years, known as Reserved Instances (RIs). If you have consistent workloads or usage patterns, you can save significantly through RIs as compared to On-Demand instances.

Using Spot Instances: Even cheaper than RIs are Spot Instances. AWS Spot Instances are spare compute capacity in the AWS cloud available to you at steep discounts compared to On-Demand prices. The caveat is that these instances can be interrupted with short notice when AWS needs the capacity back.

Using Amazon CloudFront: This is a Content Delivery Network (CDN) offered by AWS(Amazon Web Services). It delivers data, video, applications, and APIs to viewers globally with low latency and high transfer speeds within a developer-friendly environment. The use of a CDN can reduce costs by caching content closer to users, thereby reducing data transfer costs.

AWS Cost Explorer: Use it to view and analyze your costs and usage over a period of time. This service visualizes your cost drivers and usage trends, helping you understand, analyze, and optimize your costs.

Cleaning Up: Regularly review and terminate unused resources. You'd be surprised to find how many unused instances or unattached volumes are still being paid for because they were forgotten.

S3 Lifecycle Management: If you're storing data in S3, use lifecycle management to automatically move older data to cheaper storage classes or even delete them if they're not necessary anymore.

Remember, cost optimization in AWS is a continuous process and involves understanding both the technical AND financial aspects of AWS services. Each application may require a different approach, and the optimizations that could save you the most will depend heavily on the specifics of your application, its architecture, and its usage patterns.


AWS is a deep and complex ecosystem with a variety of services. Here are a few additional services and best practices you might find helpful. Beyond hosting, AWS also offers services for security, data management, analytics, and performance optimization.

Elastic Beanstalk: This is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker, among others. You simply upload your code and Elastic Beanstalk automatically handles the deployment. It's a good way to start hosting PHP applications on AWS without managing everything yourself.

AWS Lambda: If you're willing to refactor your app, you could use AWS Lambda to run your server-side code, with Amazon RDS for the database. This Serverless approach would only charge you when your code is run, potentially reducing costs if your site has variable traffic.

AWS Amplify: AWS Amplify makes it easy to create, configure, and implement scalable mobile and web apps powered by AWS. If you plan to extend your application to mobile platforms, this could be helpful.

AWS Budgets: This gives you the ability to set custom cost and usage budgets that alert you when your costs or usage exceed (or are forecasted to exceed) the budget amounts that you set.

Cost Allocation Tags: Implement a strategy for tagging your resources, and activate cost allocation tags in AWS's billing tools. This will make it easier to categorize and track your AWS costs.

Use AWS Trusted Advisor: Trusted Advisor draws upon best practices learned from AWS' aggregated operational history of serving hundreds of thousands of AWS customers. Trusted Advisor inspects your AWS environment and makes recommendations for saving money, improving system performance, or closing security gaps.

AWS Well-Architected Framework: This set of resources provides guidance on building high-quality applications in the AWS Cloud. The well-architected framework has been developed to help cloud architects build secure, high-performing, resilient, and efficient infrastructure for their applications. It can help you understand the pros and cons of decisions you make while building systems on AWS.

Consider Support Plans: Depending on your size and how critical the application is, it might be worth investing in a support plan. That way, you get faster responses and guidance when you need to understand or troubleshoot AWS services.

Cloud hosting in AWS is vastly different from traditional PHP+MySQL hosting, as it offers you a much wider array of services and more sophisticated controls over scalability, availability, and performance. But learning the ins and outs of AWS takes time and patience. Don't feel frustrated if it feels overwhelming – you're learning a whole new way of managing web applications, but the flexibility and power AWS offers can make it worth it.
  •  

ipnesterov

AWS is not a hosting service, but rather an Infrastructure-as-a-Service (IaaS) platform. If your website is a simple php + mysql site, then it's not necessary to use AWS - it would be easier and cheaper to use a different option. Comparatively, for smaller projects, the same infrastructure in AWS can be very expensive.

Instead of diving straight into AWS, it's worth taking some courses or finding guides that explain how the cloud works and how it is priced. Working with cloud services requires some understanding of networks and administration, so having some basic knowledge is essential.
  •  

SojanBabu

No designer can give you an upfront confirmation of your AWS service costs. The cost calculation is intricate, accommodating factors such as the number and nature of transactions, callbacks (like AWS-lambda), traffic, and instance time resources.

Hence, the most reliable approach is to construct a functional mockup. Integrate this model within AWS and monitor its performance under stress for a one-month duration.

From there, you can inspect the bill you receive and make informed decisions for anticipated volumes. Remember, regular monitoring and in-depth understanding of costs involved can make a significant difference in managing your AWS expenditure efficiently.
  •  

SymnDedyAment

You'll need to determine the resources required to host your site. This includes the instance type, storage, and bandwidth. For a 150 GB site, you may need a small to medium-sized instance, such as a t2.micro or t2.small. You'll also need to consider the storage requirements, which can be met with an EBS (Elastic Block Store) volume. As for bandwidth, you can estimate the monthly usage based on your website's traffic and average page size.

Amazon Web Services (AWS) offers a simple calculator to help you estimate costs. You can also consider using a managed service like Amazon Lightsail, which provides a simplified pricing model.
  •  

astrologerdevanand

Exploring AWS hosting means discovering powerful, scalable, and secure cloud solutions for websites, apps, and data storage. With flexible pricing, global servers, and reliable uptime, AWS supports businesses of all sizes. It's ideal for developers seeking performance, automation, and growth, making cloud hosting efficient and future-ready.
  •  

pelorustech

Amazon Web Services provides businesses with scalable, secure, and cost-effective cloud solutions. With flexible compute power, storage, and a wide range of services, such as EC2, S3, and RDS, AWS allows high-performance hosting tailored to your needs.
  •  



If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...