Tuesday, January 28, 2014

30DC #1 Reading

I was always fond of reading technology, programming languages, new programming paradigm, best practices... But when it comes to reading novel, literature, religion, sci-fi etc. I couldn't keep my spirits high. I don't know WHY, but this is the case. I am aware of importance of reading, it immensely impacts ones way of seeing the world and life. But reading has been a difficult job for me. I tried different shortcuts to it, following Ted & listening audio books but I cannot find varieties in contents in this mode.
Yesterday, I heard Matt Cutt on his '30 day challenges' theory. Immediately after that, I thought of, why not give it a try? Reading has always been difficult task to me, lets take this as first 30 day challenge.

'Reading (something other than technology) is my #1 30DC'


Wednesday, January 15, 2014

Guidelines to Cloudify


#Loose coupling mantra

When designing an application for cloud, consider design with decoupled components. This can be ensured by minimizing the assumptions that one component makes about another while exchanging message from one to another. Since components are loose they concentrate more on individual features, these components can be tied together using a reliable & highly available infrastructure viz. message oriented middleware or datastore.

#Chatter will shatter

Network in cloud is unreliable when compared to one in hosted environment. Chatty APIs works well in LAN but fall upside down in cloud environment. Relying on chatty protocol can dramatically drop in performance of application. Below are a few important consideration to get this minimized:
  1. Minimize round trips: Closely inspect application APIs to identify if calls can be clubbed together in one. Instead of designing fine grain APIs rely on coarse grain ones, these can be practices by including aggregates over entities as return parameter in interface definition of endpoints.
  2. Service oriented design: Another reason why protocols become chatty, programmers thinks exposed APIs in terms of fine-grained distributed objects rather coarser-grained services.
  3. Design Async-Ackless APIs
  4. Consider thick client based design to hand off responsibility on clients.

#Graceful degradation

"Everything fails all the time" keep this phrase behind the mind while thinking of designing application for cloud. Avoid SPOF (single point of failure) is the key to achieve this, while designing consider assume nothing and consider failures as 'first class citizen' of the service. Failures in the system generally cascades and there by has an effect on all the components of the application.

#Statelessness with REST

In an application with each component running on different compute node, the chance of occurrence of failure increases when they are deployed on cloud, reason being cloud nodes have an inherent behavior of a low availability. Also, to meet the demand there are needs for horizontal scaling in and out. Thereby component has to be designed in a way that they do not contain any internal state, but completely rely on external persistent storage. Since the component instances do not have an internal state, no data is lost if an instance fails. Such a setup also significantly increases the capability of the componentized application to scale-out, because multiple components can share a common data store and thus act as if they all had the same common internal state. Adding and removal of components, part of scaling operations, is also simplified. However, the scalability of the central data store becomes the major challenge when using stateless components.
REST based architecture is an absolute fit per above discussion. REST consider transmitting the state each time component is accessed.

Tuesday, January 14, 2014

Monday, January 13, 2014

Kashid-Lonavala-Mumbai

On the way to Elephanta Caves from Gateway

Leisure at Dukes Retreat



Kashid Beach

Mumbai - Pune Express way from Dukes

Tuesday, January 7, 2014

Getting started with Netflix Suro


#1 Installing the Git
Per the Linux version use the command to install the Git, below are a few samples:
  • Debian/Ubuntu: apt-get install git
  • RHEL/Fedora: yum install git

#2 Building Suro Server
Create a new directory to clone source code
mkdir netflix
Before cloning make sure HTTPs verification is set to false or else necessary certifcates are in place, I choose a simple strategy, i.e. configured ssl verification to false.
git config --global http.sslVerify false
Clone the source from the git root master branch:
git clone https://github.com/Netflix/suro.git
With this you will have all code available in ./suro folder. 

cd suro
Next step is to build the suro server. I am skipping test cases as well.

 ./gradlew build -x test

#3 Starting Suro server


 ./gradlew installApp
Copy all server libraries at a seprate location
cp -r ~/netflix/suro/suro-server/build/install/suro-server/lib/  ~/netflix/installs/suroserver
Finally start the server using below command:
java -cp "./lib/*"  com.netflix.suro.SuroServer -m conf/routingmap.json -s conf/sink.json 

#4 Checking the system health

To check whether server has started successfully:
http://HOSTNAME:7103/healthcheck
This service should return 200 OK with SuroServer-OK message.

Challenges Faced

#PEER NOT AUTHENTICATED

> Could not resolve com.leansoft:bigqueue:0.7.0. Required by: com.netflix.suro:suro-kafka:0.2.2-thrift-0.7.1 com.netflix.suro:suro-kafka:0.2.2-thrift-0.7.1 > com.netflix.suro:suro-core:0.2.2-thrift-0.7.1 > Could not GET 'https://raw.github.com/bulldog2011/bulldog-repo/master/repo/releases/com/leansoft/bigqueue/0.7.0/bigqueue-0.7.0.pom'. > peer not authenticated
Above was the error which I faced. On further analysis found the issue was because of JAVA_HOME was not set.

# RUNNING SURO ON WINDOWS




Wednesday, January 1, 2014

Happy New Year - 2014

We got up early and plan was all set to go out for a long drive with family to Nageshwar Parshwnath & Susner. 2014 started with cold weather, fog is all over even I was breathing fog out as well.



Saurabh also joined us, we picked him up from his home. He carried a book in his hand, I was wondering, is he going to read during trip? Later found he got that book for me, 'Ageless body & timeless mind', title sounds interesting, the book must be a worth read I thought.

It was chilling and fog has covered all over the place, even our place turned a hill station, it was fun driving in this weather. We took several halts for refreshment, one was near Mahidpur dam. Saw people partying at this place, I too thought of a 'Dal-Bafla' party over here sometime ;)

Aryaa enjoyed company of SVJ, Tim & Timsy story is now one of her favorites now. We took a short cut from Mahidpur to Unhel, and the short cut was too long, it took 2-3 hours to cross 30 km road. Because of this we have to cut short our trip and drop our plan to visit Susner.

Shrine was miraculous, sculptor were beautifully carved, construction was in progress. Lord Parshwnath attractive morph can be realized at the first sight.