5 Best Strategies to Reduce your AWS billing & Monthly Save Up to $1000 +

5 Best Strategies to Reduce your AWS billing & Monthly Save Up to $1000 +

 

Save 1000$+ monthly on your AWS Bill with these Simple Hacks

 

Recently I did a short video on how to bring your AWS billing down by more than 80%, which went quite viral on the internet achieving thousands of impressions within a day. It made me realize that there are many founders/CXOs who face this issue of the high bill on AWS or any similar cloud platform. This post is a further extension on the points I mentioned in the video and provides additional ways on how you can save money on AWS.

 

1. Selecting the appropriate size for the AWS server –

Selecting-the-appropriate-size-for-the-AWS-server

 

It is crucial for every organization to choose the correct size of the server. At the initial stage of your startup, it is advised to start with a small server. Apart from that setting up auto-scaling really helps. Auto-scaling option continuously scales the servers dynamically based on the traffic. This means that your server will scale up and down automatically based on the traffic on your website, so you don’t need to pay for a big dedicated server.

 

2. Using S3 + CloudFront instead of EC2 –

Using-S3-+-CloudFront-instead-of-EC2

 

Many people use EC2 servers for hosting their website. If you use static or dynamic website go for the S3 + CloudFront option instead of EC2 as it is more scalable and more secure as well as it costs less. Instead of paying for the dedicated EC2 server you can go for the cheaper S3 + CloudFront option.

 

3. Terminate development and QA environment when not required –

Terminate-Development-and-QA-Environment

A simple trick to reduce the cost is to turn-off the development and QA environment on weekends and holidays when no one is using them. You can easily setup Lambda function which triggers the turning on and off of the servers. Just by applying this you can save up to 50% of the cost whenever you are not using it.

We also apply this facility to many of our clients. When our working hours are done, and on weekends when no one is using the service, the servers shut down automatically.

 

4. Use AWS Reserved Instances –

Use-AWS-Reserved-Instances

Another great thing about AWS is that it offers the ability to reserve instances. Suppose you scored a great project whose duration is going to be around one year and you know what all instances you will need from the AWS. In this case, you can reserve the required instances with AWS. All you need to do is tell Amazon that you will require these instances for one year and Amazon brings down the cost for those instances.

 

5. Using the complete AWS features optimally –

Using-the-complete-AWS-features-optimally

Have you heard of SSL certificate? An SSL Certificate is essentially a digital certificate that authenticates the identity of a website and encrypts information sent to the server using SSL technology.

Many of our clients buy SSL certificate from GoDaddy or any other providers, they have to pay a considerable amount for it, but AWS on the other side provides SSL certificate for free if you set it up correctly. So with AWS, you don’t have to worry about buying an SSL certificate, moreover at the time of renewal and again setting it up AWS takes care of it all.

 

Conclusion

 

I am sure that by applying these best practices you can also save a few extra bucks just like we did. Also, feel free to connect with me if you want to discuss or want me to look into your AWS instance, I’d be more than happy to help. I can be reached on pravin@startupgrind.com

Getting started with Google Cloud Functions using NODE.JS

Getting started with Google Cloud Functions using NODE.JS

Serverless-architecture

What is Serverless Computing Architecture?

Serverless architecture is a way to build and run applications without having to manage infrastructure. Your application still runs on servers, but all the server management is done by the provider. You no longer have to think about scaling and maintaining servers to run your applications, databases, and storage systems.

How it works

What we need to do

1. Write the code

2. Upload the code to the cloud service provider

3.Initiate the trigger

After that our service provider will take care of

* Running and maintaining the server

* Scaling according to needs

Isn’t this useful for indie developers who can totally focus on developing apps without worrying about handling servers?

Let’s get to work now – Set Up and Initialize Firebase SDK for Cloud Functions

 

First, install the Firebase CLI as described in the Firebase CLI Reference. The Firebase CLI requires Node.js and npm, which you can install by following the instructions on https://nodejs.org/. Installing Node.js also installs npm.

Cloud Functions runs Node v6.14.0, so we recommend that you develop locally with this version. Once you have Node.js and npm installed, install the Firebase CLI via npm:

npm install -g firebase-tools

Now initialize project:

    1. Run firebase login to log in via the browser and authenticate the firebase tool.

    2. Go to your Firebase project directory and initialize it using firebase init and it will ask you to choose a project/Create new project here.

Firebase Project Directory


3. The tool gives you an option to install dependencies with
npm. It is safe to decline if you want to manage dependencies in another way.

 

4. The tool gives you two options for language support:

    • Javascript

    • Typescript

If you already have firebase project then, Run firebase init functions.

firebase init() function

Now you should have a structure as below

firebase structure


As you can see, the structure of the project is very simple:

  • functions/package.json: Contains a list of NPM package dependencies of the project

  • functions/node_modules: Directory in where NPM packages are installed which are mentioned in package.json

  • functions/index.js: Used for implementing Cloud Functions

  • firebase.json: Contains settings for Firebase project

 

Create cloud function

Open index.js and let’s write HTTP trigger function

const fbFunctions = require(‘firebase-functions’);

exports.welcomeToFBFunctions = fbFunctions.https.onRequest((req, res) => {

       console.log(“Testing FBFunctions“);

       res.send(“You will love these cloud functions”);

});

This is very basic cloud function based on HTTP trigger which is sending response when it is getting triggered on calling the functions.https.onRequest method

To try this, let’s deploy our project to firebase.

firebase deploy –only functions –project projectId Create a project via going to google console and get projectId from there or select project at firebase init command.

— the only flag is directing to deploy functions only for existing firebase project

It will be something like this

create cloud function

 

If deployment is successful, you can see the function URL, copy it and paste it in Browser and you will see the below output :

 

function URL

Function URL triggered the cloud function and it returned output as expected.

Open your firebase console window and navigate to functions menu, there you can see your deployed function.

firebase console

 

Debugging

 

Firebase integrates with the Stackdriver Logging service. All console logs and errors will get logged here.

Switch to Logs tab and here you can see console logs

 

 

Debugging

Firebase Cloud Functions is still in beta. It is still being improved and updated frequently. If you are planning to use Firebase Cloud functions, keep an eye on the changelogs to avoid any breaking changes in the implementation.

 

Use Cases 

 

Firebase Cloud Functions are a very useful and powerful tool. There are many use cases for Cloud Functions. Take a look at the following list of possible use cases:

  • Integrating with third-party services like sendgrid and etc etc

  • Send notifications in case of events like user signup and login

  • Send confirmation emails to users

  • Send bulk emails to users

  • Process payments with third party API like Stripe.