AWS-Elastic Beanstalk VS Custom Environment Solution

Amazon_S3_Online_Service-123 (1)

AWS has a beautiful feature named Elastic Beanstalk to deploy application in AWS cloud with minimal knowledge on environment setup. Currently it supports Ruby, Java, Node.js, python and PHP applications. But the question is, “should we use Elastic Beanstalk for a low/ medium traffic application?

Advantage:

  • The Elastic Beanstalk is a fully automatic feature for application deployment and versioning
  • AWS has pre-setup templates that can be used like LAMP stack, Ruby Stack
  • Helps to provide single management interface to monitor the activity of your environments like EC2, ELB and S3

Disadvantage:

  • Since this does not support micro instance the cost of for Small instance or higher configuration instance to AWS is redundant
  • There are some limitations to customize the ELB after deployment.
  • AWS scales up and down the resources based on metrics. It supports Elastic Beanstalk on a single metric.
  • AutoScaling cannot be configured with CPU parameters and Network traffic.

Finally, it can be said that Elastic beanstalk is the best fit for application environments that require very little customization with heavy traffic. As it doesn’t support Micro instances, so it is advisable to use customizable environments for low traffic applications.

How to use Amazon S3 Bucket with Paperclip to store images in Rails3

Amazon_S3_Online_Service-resized200-150x150

“S3 Bucket” is Amazon Simple Storage Service – a “highly durable and available store” and can be used to reliably store graphical and other applications contents such as media files, static assets and user uploads. It allows you to off-load your entire storage infrastructure. This feature facilitates better scalability, reliability, and speed than just storing files on the file-system.

It is an online storage web service offered by Amazon Web Services and provides storage through web services interfaces (REST, SOAP etc.)

Here is an example on how to use Amazon S3 with paperclip in Ruby on Rails applications.

Step#1

  • In rails 3.x

Install aws-s3 gem by adding in Gemfile

gem 'aws-s3'

And run

Run “bundle install”

Step#2

To get AWS S3 bucket ‘Access Key ID’ and ‘Secret Access Key’ go to the “http://aws.amazon.com/s3”

Create s3.yml file under config directory and enter your Amazon S3 credentials

development:
bucket: bucket-dev-name
access_key_id: xxxxx
secret_access_key: xxxxx
test:
bucket: bucket-test-name
access_key_id: xxxxx
secret_access_key: xxxxx
production:
bucket: bucket-prod-name
access_key_id: xxxxx
secret_access_key: xxxxx

Step#3

Open your model file that would hold the attachment and modify it as follows

###Paperclip
has_attached_file :photo,:styles =>{ :thumb => "100x100", :medium => "200x200", :large => "600x400" },:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",:path => ":attachment/:id/:style.:extension",:bucket => 'yourbucket'

Step#4

In view, to display the image

How to cut down Amazon Web Services (AWS) billing?

Amazon_S3_online_servicesAndolasoft is specialized in providing Cloud Computing services to its customers. Here we have a huge team of skilled personnel to provide monitoring and support services for 24×7 across the world.

As a technology partner with Amazon Web Services, we would like to share some features as well as some useful tips about controlling the AWS billing cost.

What is Cloud Computing?

Integrating computing resources with World Wide Web to provide remote IT Infrastructure facilities is Cloud Computing. It’s an option to replace traditional IT infrastructures with virtual networking for faster job processing and higher productivity at lower costs.

What is AWS?

Amazon is providing similar IT infrastructure services as a web service, popularly known as Amazon Web Services or AWS. Currently it is providing services to millions of businesses in more than 190 countries.
Features that makes AWS unique in public cloud

  • Auto Scaling

Number of Amazon EC2 instances can be scaled dynamically or by user defined schedule to increase or decrease them automatically depending on the demand. You will receive notifications to initiate Auto Scaling actions, or when Auto Scaling completes an action. Auto scaling feature can be used via APIs or Command Line Tools with no additional fees.

  • Amazon Cloud Front and it’s Functionalities

Amazon Cloud Front is a web service to distribute contents to end users at high speed .Here you can store the original version of your files on one or more origin servers and configure them by using URL pattern matches to specify which origin has what contents. You can use distribution’s domain name in your web pages or application so when users request an object using this domain name, they are automatically routed to the nearest location to deliver your contents.

  • AWS Identity and Access Management (IAM)

Manage IAM users and their access- Identity and Access Management (IAM) offers greater security, flexibility, and control when using AWS. IAM enables you to create users in AWS and manage access to AWS services and resources for your users. It also enables you to grant access to users managed outside AWS. You can assign individual security credentials (access keys, password, Authentication devices) or request temporary security credentials to provide users access to AWS services.

Manage IAM roles and their permissions- You can create roles in IAM and manage permissions to grant specific operations to the entities.Manage access for federated users- You can enable identity federation to allow users to access the AWS Management Console, without creating an IAM user for each identity. It is done by requesting temporary security credentials. This temporary security credentials are comprised of short lived access keys and session tokens associated with them. Users can use the access keys the same way as before, but they also have to pass the token . They can further be restricted by specifying explicit permissions while creating them. Any number of temporary security credentials can be issued.

  • IAM provides the following access controls:

Fine-grained access control to your AWS resources: IAM enables you to add specific conditions to control how a user can use AWS, such as time of day, their IP address, by using SSL, or authenticating with a Multi-Factor Authenticationdevice.Identity federation between your enterprise and AWS services: IAM can be used to grant employees, and applications access to AWS Management Console and AWS service APIs, using existing identity systems.

Mobile and browser-based applications: Mobile and browser-based applications can also be enabled to access specific AWS resources using temporary security credentials for a configurable period of time.

Tips to cut down AWS Billing:

  • Use AWS reserved instance for long running projects and spot instances for short term projects.
  • Use AWS private IP for data transfer between instances.
  • Use AWS Rout53 DNS to reduce Elastic IP usages.
  • Use Linux based Instances.
  • AWS recently lunched Glacier which offers $0.01 per GB / month only. Use Glacier for data storage instead of S3 to reduce the price of S3.

Planning anything on AWS? Talk to our Experts