Celebrating the One Year Anniversary at ShepHertz Technologies


I am very pleased to announce that this is the one year anniversary at ShepHertz – it was on March 1st, 2013. I never dreamed that I will work with such a like minded people, technologies and company.

It has been a such an incredible journey so far. I learned so many things that i can’t put in words over here. I found truly wonderful experience with truly wonderful people at ShepHertz.

I am more happy to say that I am part of company which is A Cloud Ecosystem Provider for Apps and unique in this cloud computing world!.

Here I get opportunity to work on Cloud Computing production like PaaS, BaaS and GPaaS.

ext

Below, I would like to share some highlights from my year experience.

App42 PaaS – At App42 PaaS I am member of the Runtime Systems team, where taking care of distributed systems that manage many application hosting(Rails/PHP/Java/ Node.js), systems development and infrastructure automation.

At this point you must wondering What is App42 PaaS and what it do? Right? Let me explain.

App42 PaaS is a Public Cloud Platform-as-a-Service with support for multiple languages
and platforms. This will enable you to focus on your development rather than putting your time on infrastructure hassles.

Key Benefits:
- A Polyglot platform that supports multiple languages and frameworks like Ruby, Java, PHP, Node.js, JRuby, Jython and more.
- Multiple Cloud Services like MongoDB, CouchDB, PostgreSQL, MySQL and more.
- Control through Command Line as well as Management Console for quick deployment of Apps
- Customizable load balancing for high availability- Quick Scaling/Descaling of resources

My Journey with App42 API - The App42 Cloud API’s consists of a REST based service which has a JSON and XML interface. There are around 22+ modules with over 400+ API’s e.g. User, Session Management, Storage, Recommendation, Photo Gallery, Queue / Message, Game, Geo Spatial etc. which will help developers to develop their applications; irrespective of the type of App they are developing. SDK’s are provided for all popular languages and platforms which will enable easy integration of the API’s into the App code. With just a few lines of code, the App developer gets access to services from a simple to complex technical as well as business services.

I would like to thank Siddhartha Chandurkar and Naveen Goswami sincerely for your all support, kindness and help during years with organization. Thank you ShepHertz family to making this journey so wonderful.!!

Why should i use Ruby on Rails?


Previous yesterday(22 Feb, 2014) we had Delhi NCR Ruby Meetup on Open Source Saturday – How can I contribute to Ruby on Rails?. There i had opportunities to meet few college student, Once of them asked to me – Why should i use Ruby on Rails? Yeah, That’s really good question :) So let’s talk, why should we use Ruby on Rails when dozen of language and frameworks are available.

1. Ruby on Rails provides a consistent approach to build your web applications. If you have already experienced with other web development language or framework, you can understand, how tough it was process, you typically need to survey and ask with expert to choose your various software components to solve the common architectural problems of persistence,  build scripts, testing, logging, database setup, application configuration, web tier components and rest of software life cycle. Using the Ruby on Rails framework these decisions are already made for you, now you can spend more time to understanding software business problem and quickly build a working prototype. By using Rails you become productive in minutes not weeks or months.

2. Ruby on Rails follow CONVENTION OVER CONFIGURATION pragmatic philosophy, this apply in all layers of your software development architecture with the highest productivity gains noticeable in the relationship between the model and the database(ORB- Object Relationship Model). Once the developer understands the rules and constraints, Rails MVC magically connects your view to your controller and model, and your model to the database. That’s awesome .!! You do not have to write any script or tool to manage all this ==> MVC – Model View and Controller.

 

rubyonrails

3. When we talk about OOP’s, Ruby is a fully featured object-oriented language and in addition Ruby come with mix-ins modules which contain independent code to inject into your classes and block. Ruby is an extremely dynamic/run time language, which means that code can be generated and executed on the fly. It’s dynamic nature includes the definition of new classes & methods, as well as the overloading of operators etc. Apart from this you can re-open, redefine and removed existing classes on fly.

4. Unlike other web language and framework, rails has build in templating support, json/xml document and email service.

5. Rails comes with ActiveRecord, Association and ActiveModel(object relationship mapping), which provides seamlessly persisted interface to database like transactions, inheritance, validation, scope and caching.

6. Rails includes support for a variety of web technologies like JavaScript libraries, JQuery, REST, Embedded ruby, HAML, CoffeeScript etc. with configuration in development, test and production environments. If you are planing your application into Web 2.0 space, Rails provides a rich abstracted interface to implementing AJAX operations.

7. Most important rails gives us flexibilities to perform database migration and rollbacks between environments and across development until project at mature stage. However with the Rails framework you will be delighted with the implementation of database migrations for applying and rolling back database changes. You only need to enter your update and rollback scripts in Ruby, framework understands the current version & can move forwards or backwards to any database version.

8. Getting started with Rails is easy as generators/migration will propel you along. DRY(Don’t Repeat Yourself) principle of Rails encourage experience developer to write less code by using the metaprogramming features of Ruby. Overall less code to write means higher productivity, less bugs and minimum complexity.

I hope you convinced, Still doubt? Please go through below links:

http://www.skilledup.com/learn/programming/4-reasons-learn-ruby-first-programming-language/
http://www.techrepublic.com/blog/10-things/10-reasons-why-you-should-learn-ruby-on-rails/3060/
http://blog.teamtreehouse.com/reasons-why-every-web-designer-needs-to-learn-rails

http://articles.businessinsider.com/2011-05-11/tech/30035869_1_ruby-rails-custom-software

Have question? feel free to comment. :)

Why do people use App42PaaS when AWS is present?


Recently i came across question: Why do people use App42PaaS when AWS is present?

It’s really interesting :)

Firstly, let me tell you, AWS and App42PaaS are different kind of cloud service providers. There should not be any comparison between them as AWS provides IaaS(Infrastructure as a Service) where as App42PaaS provides PaaS(Platform as a Service).

Now you must thinking what are the differences between them. Right?

In very short, IaaS gives you instance of Virtual Machine where you need deploy your application on top of it. PaaS gives you an environment where you just push code with some basic configuration by choosing them.

Let’s talk in details:

AWS:

Now a days, people are used to refer IaaS as HaaS(Hardware as a Service) as name suggest, IaaS provide us hardware, servers and networking components including storage. Once you own the instance, its become your responsibilities for housing, running and maintaining it and you typically pays on a per-use basis.

amazon-aws-infographic

App42PaaS:

App42PaaS basically help developer to speed the development of app, saving money and most important innovating their applications and business instead of setting up configurations and managing things like servers and databases. Other features buying to use App42PaaS is the application deployment process such as agility, High Availability, Monitoring, Scale / Descale, limited need for expertise, easy deployment, and reduced cost and development time.

app42_PaaS

Hopefully, i answered above question, if still you have question let me know in the comments.

What is cloud computing? When to use a cloud?


Hi Friends, Sorry i was quite busy from previous couple of months So don’t get time for post. It’s really great experience working on cloud computing, basically on PaaS(Platform as a Service), BaaS(Backend as a Service) and IaaS(Infrastructure as a Service) with ShepHertz. I came across multiple questions, people asking about cloud computing segment. So i thought of write a blog on Cloud Computing.

cloud-computing-concepts
Let me explain cloud computing segments in details to understand Cloud Computing.

Cloud computing: Cloud computing is the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.

Cloud Computing Segment:

IaaS(Infrastructure as a Service) – Infrastructure as a Service is a provision model of cloud computing in which an organization outsources the equipment used to support operations, including storage, hardware, servers and networking components. The service provider owns the equipment and is responsible for housing, running and maintaining it. The client typically pays on a per-use basis. Ex- Amazon Web Services, BlueLock, Cloudscaling and Datapipe

whatisthecloudiaas

PaaS(Platform as a Service) – Platform as a Service is one of the GROWING sector of cloud computing. PaaS basically help developer to speed the development of app, saving money and most important innovating their applications and business instead of setting up configurations and managing things like servers and databases. In one line I can say Platform as a service (PaaS) automates the configuration, deployment and ongoing management of applications in the cloud. Ex: Heroku, EngineYard, App42 PaaS and OpenShift

government-ready-paas-300

SaaS(Software as a Service) – Software as a Service, SaaS is a software delivery method that provides access to software and its functions remotely as a Web-based service. Ex: Abiquo’s and Akamai

saas-in-the-cloud-logo

BaaS(Backed as a Service) – Backend as a service (BaaS), also known as “mobile backend as a service” (MBaaS),is a model for providing web and mobile app developers with a way to link their applications to backend cloud storage while also providing features such as user management, push notifications, and integration with social networking services. Exp: Kinvey, StackMob, App42 API and Parse

layer_4_slide_1

Hopefully this post makes it much easier to understand cloud computing. Let me know in the comments if you love it or find any difficulties to understand.

Setting up Unicorn with Nginx on Ruby on Rails


In this blog post, I am going to tell you, How to configure Unicorn web sever on top of Nginx. I Assume that you already installed Ruby and Ruby on Rails on your production OS(operating system) and a sample application working fine.!! If not, follow my previous blog post Setup Ruby On Rails on Ubuntu.

Nginx and Unicorn

To get you started, Let’s install Nginx first by using apt-get package manager.

$ sudo apt-get install nginx

Sometime you get ERROR because your machine packages are not upto date. Run apt-get update to downloads the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs.

$ sudo apt-get update

Once your nignx will install, you command window will prompt:

Setting up nginx-full (1.2.1-2.2ubuntu0.1) ...
Setting up nginx (1.2.1-2.2ubuntu0.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for sgml-base ...
Updating the super catalog...

At this point switch to /etc/nginx/ and /etc/nginx/sites-available configuration directory and have a look to nginx.conf and default respective configuration file. It’s self explanatory under commented in-lines. If still you need more details. I will recommend you to check wiki.nginx for more info.

While the server configuration it’s always better to create separate user(which we have more control over than nobody) for security reasons and increased control by using below command:

$ sudo useradd -s /sbin/nologin -r nginx
$ sudo usermod -a -G web nginx

Starting/stopping/restarting Nginx is pretty straight forward.

$ sudo service nginx start/restart/stop

Now let’s install Unicorn, Unicorn is distributed as ruby gem So you can install vi ruby gem.

$ gem install unicorn

Once Unicorn installed successfully. We need to create two configuration file.

1.Replace /etc/nginx/sites-available/ default file with below code:

upstream shop {
  server unix:/tmp/unicorn.shop.sock fail_timeout=0;
}

server {
   listen 80;# default deferred;
   server_name localhost;
   root /var/www/shop/public;
   try_files $uri/index.html $uri @shop;

location @shop {
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header Host $http_host;
   proxy_redirect off;
   proxy_pass http://shop;
}

error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
   keepalive_timeout 10;
}

2. Create a unicorn.config file in your Rails application configuration file with below code:

working_directory "/var/www/shop"
pid "/var/www/shop/tmp/pids/unicorn.pid"
stderr_path "/var/www/shop/log/unicorn.log"
stdout_path "/var/www/shop/log/unicorn.log"

listen “/tmp/unicorn.shop.sock”
worker_processes 2
timeout 30

You have to tweak a few things to set the right paths in above configuration. Change “/var/www/shop” with your rails application directory.

In my case my Rails application is in /var/www/ with shop name.

Before start your rails application, make sure to include unicorn gem in your Gemfile and run bundle to install all dependencies.

That’s all.

Setup Ruby On Rails on Ubuntu


Installation of Ruby on Rails for Production server is pretty straight forward. Below are the relevant steps.

1.INSTALL THE NEEDED LIBRARIES

sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev

2.DOWNLOAD AND INSTALL RUBY 1.9.3

sudo apt-get update
 sudo apt-get install ruby1.9.3

Note you can install latest Ruby too.

3.INSTALL RAILS

 sudo apt-get install ruby-dev
 sudo apt-get install build-essential g++
 sudo gem install railsconfigure rails application with nginx and unicorn

4.INSTALL SQLITE ADAPTER

 sudo apt-get install libsqlite3-dev

If you passed all above steps without any ERROR, Now it’s time to create a rails demo application OR SCP existing one and test it out.

Below is the steps to create new rails application

 rails new demo
 cd demo
 uncomment therubyracer gem in Gemfile
 sudo apt-get install build-essential g++
 bundle install
 rails g scaffold order name:string
 rake db:create
 rake db:migrate

Open config/routes file and uncomment root ‘welcome/index’ and replaced with ‘orders/index’

$rm -rf public/index

That’s all, Now run your Rails application.

Some insights into PaaS market


Platform as a Service is a one of the GROWING sector of cloud computing. PaaS basically help developer to speed the development of app, saving money and most important innovating their applications and business instead of setting up configurations and managing things like servers and databases.

Other features buying to use PaaS is the application deployment process such as agility, High Availability, Monitoring, Scale / Descale, limited need for expertise, easy deployment, and reduced cost and development time.

PaaS Market

Major forces driving the PaaS

- Pay as you Go
- Low start up cost
- Leave the plumbing to expert
- PaaS handles auto scaling/descaling, Load blancing, disaster recovery
- PaaS manages all security requirements
- PaaS manages reliability, High Availability
- Paas manages manay third party addon’s for you

Barrier to PaaS adoption?

- Less Control over Server and databases
- Have to be expert to mange security controls and audits
- Costs will be very high if not governed properly
- Premature and dobious in current day and age

Major PaaS providers are Heroku, App42 PaaS , Jelastic, and Engine Yard. When we talk about revenue, The global PaaS market is estimated to grow from $1.28 billion in 2013 to $6.94 billion in 2018 at a compound annual growth rate (CAGR) of 32.54% in this period. In terms of geographies, North America continues to be the biggest market for PaaS solutions. In 2012, PaaS revenues ($1.2 billion) was the tenth of the size of SaaS ($14.4 billion), a fifth of IaaS ($6.2 billion), and just a tiny fraction of BPaaS ($84.1 billion).

PaaS has always taken a very small space in the cloud computing arena as compared to the other two segments: IaaS and SaaS. But the trend has recently shown a drift with PaaS market showing a very high growth rate in terms of revenue. Though it is still not as huge as the other two segments but now holds a significant proportion of the pie. PaaS has now been adopted by most of the big cloud computing and IT solution providers like Amazon, IBM, Google etc. as one of their main services.. Many small players have also emerged and made the market very dynamic and competitive. Application developers are benefiting from this fact resulting in more adoption and thus increasing the demand for PaaS all the more in various sectors.

We expect to see more and more application development companies choosing PaaS over IaaS or traditional Hosting, as they can then focus on driving innovation and building apps that change their interactions with customers, partners and community. It will make them free of the details of infrastructure, so they can push the possibilities of the latest technology to build great web and mobile applications.