Tuesday, August 20, 2013

Cloud Computing: for my sophomore



Me: Do you know, what is cloud computing?

Yash: Are we doing some computing with clouds! :-)

Me: Nope.  Do you want to know about what is Cloud Computing?

Yash: Yes.

Me: Lets us make an analogy for Cloud computing.  OK, I have one.
I have few questions for you.  In which type of house, your friends John, Ram, Rita and Tom lives?

Yash: Means?

Me: Let me rephrase. Does your friends John, ram, Rita and Tom lives in independent single family houses or in apartment complex?

Yash: Each of these my friends live in independent single family houses.

Me: Ok. Does it also mean that each of your family is responsible for their water bill, electric bill, gas bill, maintenance of house, and front yard.

Yash: Yes. It is their house. It is their responsibility to maintain their houses.

Me: Understand. But is also means that they (or their parents) have to assign some minimum number of hours per week for upkeep of house.

Yash: Yes, they do.

Me: But in return of this sweat, they gate freedom to remodel their houses internally as well as externally. One import aspect we were missing – Huge money to purchase a house. Your friends had spent lot of money to purchase a house.

Yash: Yes. Provided they get permit from city.

Me: Sure. 

Me: Now assume all of your friends are living in a multi-story apartment complex on lease. In this case your friends (actually their parents) can offload some of the responsibilities of maintenance to apartment complex management like maintenance of green areas, shared lights, common walk ways, parking areas, building façade, etc. They need to worry only about consumables like electric bill, water bill, etc.

Yash: Yes.

Me: Also, in limited sense your friends can customize their houses – decoration etc. but cannot change basic structure of apartment.

Yash: Yes.

Me: Now, let us draw analogy. Independent houses are equivalent to computing environment where each enterprise (company) purchases computers, maintain them and get freedom to run any type of software program to run on those computers. This is traditional computing

Yash: Then, what is cloud computing?

Me: In case of multi-story apartment complex building, each tent is not owning any apartment but leasing it. Similarly in cloud computing environment, each tenant (company/enterprise) lease computers (computing power) and pays money on regular cycle. Tenant also pays money on consumables – like bandwidth used, number of users on computers, etc. So tenant does not pay any money to purchase of computers upfront but pays regularly for the resources consumed.  This is cloud computing.

Yash: So cloud computing essentially about leasing of computing power and paying money regularly instead of upfront.

Me: Yes, but not forget about offloading of day to day work to cloud provider (maintaining front yard, etc.) but limited flexibility to work within limits set by cloud computing provider.

Yash: This cool.

Me: Cloud computing provider ensures that one tenant does not encroach into another tenant’s house.

Yash: Yeah, it is must. No one likes that someone peak into their house.

Me: Depending upon level of flexibility to modify apartments, there are various types of cloud provider.

Yash: so what are various types of clod computing providers?

Me: Let us assume multi story apartment complex apartment’s management rents not the apartments but an area in building with defined boundaries. In this case tenants can design their own apartments.  These types of cloud computing providers are equivalent to Infrastructure as a Service (IaaS).

If multi-story apartment complex provider provides fully built apartments but allows sufficient flexibility to shift few walls here and there. These types of cloud providers are called Platform as a Service (PaaS).

In last case, fully built apartment is provided with only choice is left to lease of decoration. These types of cloud computing providers are called Software as a Service (SaaS).

Yash: I feel cloud computing can be summarized in one statement.

Me: which one?

Yash: As Spiderman said - With great power comes great responsibility.

Multi-threading: For my sophomore



Yash: Today I have learned about Multi-threading in Java.

Me: Excellent. Explain to me.

Yash: I can explain it as a game.

Me: Wow!!

Yash: It is very easy. Let us assume that I have four of my friends are at home.  Each one has one marker and an eraser. There is also one small size white board in the room.  In this game each person is supposed to write his name at white board. But board is so small that only one name can fit in at a given point of time. Now let us begin the game.

In the start of game each person is asked to write his name on the board. Now everyone tries to write his name on board. Since board can hold only one name, so it is possible that nobody able to write his name on the board. Ouch!! It is mess.

Now let us change rules little bit. Now you pitch in seeing the mess and set one more rule. Rule is: Any one can write his name on the board if he has token provided by you.

Now game starts again. This time boys have raced to get token from you not at white board. One who gets the token gets a chance to write his name on the board.  This means at a given point of time only one person is working on board.

Here you can replace boys with threads, white board with object of piece of code on which multiple threads want to operate, token with monitor.

This is how multi-threading is implemented in Java.

Me: Superb…

Agile Manifesto

Today, I got confirmation from Agile Manifesto team that same is available in Hindi as well. I was trying to get is published since long.

Thanks Shane Hastie, Maha Raja and other team members.



Agile Manifesto in Hindi.

Tuesday, August 13, 2013

Process and Thread: For my sophomore



Yash: What is a process?

Me: Let me think.

Yash: Also what is Thread?

Me: Now you are making things simpler.

Yash: How?

Me: Let us start from scratch. In computers, a program has two characteristics. It has some memory space (contiguous memory locations) and instructions to be executed by processor. So process is a thing which has its own memory space and instructions to be executed. No two processes share memory space. Each process has its own memory space.

Yash: So you mean to say, if I have two processes are running in a computer, both have its own non sharing memory space at a given point of time.

Me: Yes.

Yash: Now what is thread?

Me: Not it is tricky. If you consider a process as a set - remember your eight grade mathematics, and then threads are sub set of process set. It means threads run within memory space of a process and even threads can share memory space.

Yash: I can draw this into a picture.

Me: Try it.

Yash: so this is my understanding.




Me: Excellent.
 


Monday, August 12, 2013

Book Review: Testable JavaScript


Book Review:  Testable JavaScript by Mark Ethan Trostler: Publisher- O'Reilly: ISBN- 13: 978-144932339


There are not many books which not only talk about testing but also about code style to facilitate testing. Testable JavaScript is a book which talks about both. This book methodically talks about tests, code coverage, automation, event based, and over all complexity. To the point approach and supported by examples makes this book valuable.

Certainly this book will be in my book shelf for long time.

Disclaimer: I did not get paid to review this book, and I do not stand to gain anything if you buy the book. I have no relationship with the publisher or the author. I got electronic format of book from publisher for review.


One can get more information about book and related topics from:

  1. Amazon: http://www.amazon.com/Testable-JavaScript-Mark-Ethan-Trostler/dp/1449323391
  2. Publisher -- Oreilly http://shop.oreilly.com/product/0636920024699.do