Download Android App


Alternate Blog View: Timeslide Sidebar Magazine

Saturday, September 10, 2011

Why Har ek friend jaroori hota hai - The new Airtel Advertisement

It is impossible to believe that any Indian would have missed watching this ad:


Catchy it is, pleasant to the ears, but soon due to its excessivity,  like the flood gates have been opened, it starts hurting your ears. I fear watching television these days, for I do not know when this megaton bomb would be dropped. My hand automatically reaches for the mute button on the remote to spare my brain of this incessant pain.

It looks like Airtel has made it the national anthem of India and it won't spare any Indian till each one of us has learned the lyrics by heart.

Chai Ke Liye Jaise Toast Hota Hai
Vaise Har Ek Friend Zaroori Hota Hai
Yeh sun sun ke bheja roast hota hai
Har Ek Friend Zaroori Hota Hai

With the success of Facebook, I think the song will be next picked up by them to promote the social networking website. "Facebook...Kyonki har ek friend zaroori hota hai!"

No wonder Airtel is soon going to increase the mobile phone tariff by 20% soon. I guess it is time for them to pay the broadcasters.

Till this ad goes off air, I have decided to watch my TV in mute :)

You may also like this article on my blog: The new Sony Vaio Ad.

Friday, September 9, 2011

Messaging using JMS, ActiveMQ, Apache Camel

Event drive architecture (EDA) is a powerful architecture and quite useful in some contexts. It is very useful in cases where applications and systems transmit events among loosely coupled software components and services. Event-driven architecture can complement service-oriented architecture (SOA) because services can be activated by triggers fired on incoming events.

As an example, in an E-Commerce system, if a shopper places an order, an order confirmation email will be sent out. "Order" is an event produced by the Ordering system, and multiple processing engine can react to this event. One such processor can send out Order confirmation email to the buyer.

So as you can see, EDA puts events in the middle of the design. It is about recognizing business events and how to design them in terms of data modeling. A business event is something that happens (change of state) where your business has planned to react upon in a predefined way. A business event is represented by a message, but not all messages are representations of business events. Also, EDA-approach in an asynchronous communication style.

 The Java Message Service (JMS) API is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. ActiveMQ is one of the popular JMS providers.

The next section discusses utilizing JMS, ActiveMQ and Apache Camel for designing a simple event based notification mechanism. I assume that you have some basic understanding of JMS.

Scenario: Say for an E-Commerce business, when an out of stock product becomes available, it is a significant event. When such an event is received, the product should be available for sale on the website. We will design a simple notification system that generates a 'Inventory Received' event when inventory is received for an out of stock items.

Event producer: Warehouse management system, Event: Inventory Received , Event processor: NotificationService

Some observations here about this use case:
  • Event producer/Caller is not aware of Event consumer/callee
  • Many events can happen per second
  • Order of events is not important
  • No state management is required 
  • Communication is asynchronous
 ActiveMQ provides JMS implementation along with many advanced features like Virtual destinations, Total ordering, selectors etc.

Apache Camel is a rule-based routing and mediation engine which provides a Java object-based implementation of the Enterprise Integration Patterns using an API to configure routing and mediation rules. Apache Camel uses URIs so that it can easily work directly with any kind of Transport or messaging model such as HTTP, ActiveMQ, JMS, JBI, SCA, MINA or CXF Bus API together with working with pluggable Data Format options.

1. Configure ActiveMQ to enable Virtual destinations. Start ActiveMQ broker.
2. Event is a simple bean called InventoryUpdate.


 public class InventoryUpdate implements Serializable {

	private static final long serialVersionUID = 1L;

	private long itemId;
	private int quantity;
	private Date updateDate;

  ... 

}

3. Event producer


public class InventoryUpdateProducer {

    private static String url = "failover:(tcp://localhost:61616)?maxReconnectDelay=5000";

    // Name of the queue we will be sending messages to
    private static String subject = "InventoryUpdate";

    public static void main(String[] args) throws JMSException {

        // Getting JMS connection from the server and starting it
        ConnectionFactory connectionFactory =
            new ActiveMQConnectionFactory(url);
        Connection connection = connectionFactory.createConnection();
        connection.start();

        // JMS messages are sent and received using a Session. We will
        // create here a non-transactional session object. If you want
        // to use transactions you should set the first parameter to 'true'
        Session session = connection.createSession(false,
            Session.AUTO_ACKNOWLEDGE);

        // Destination represents here our topic 'InventoryUpdate' on the
        // JMS server. You don't have to do anything special on the
        // server to create it, it will be created automatically.
        Destination destination = session.createTopic(subject);

        // MessageProducer is used for sending messages (as opposed
        // to MessageConsumer which is used for receiving them)
        MessageProducer producer = session.createProducer(destination);
        producer.setDeliveryMode(DeliveryMode.PERSISTENT);

        // We will send a InventoryUpdate message.
        Random randomGenerator = new Random();
        InventoryUpdate iUpdate = new InventoryUpdate(randomGenerator.nextInt(10), 100, new Date());
        ObjectMessage objMessage = session.createObjectMessage(iUpdate);

        // Here we are sending the message!
        producer.send(objMessage);
        System.out.println("Sent message '" + objMessage + "'" + iUpdate);

        connection.close();
    }
}

4. Now let us look at the consumer side. A consumer can be a simple JMS client consuming from a Queue - "VirtualTopicConsumers.ConsumerB.InventoryUpdate" or we can use the power of Apache Camel to help us integrate by hiding the JMS details from the client. Remember, we are using Virtual Topic here.


public class InventoryUpdateConsumer {

    // URL of the JMS server
    private static String url = "failover:(tcp://localhost:61616)?maxReconnectDelay=5000";    // Name of the queue we will receive messages from
    private static String subject = "VirtualTopicConsumers.ConsumerB.InventoryUpdate";

    public static void main(String[] args) throws JMSException {
        
        // Getting JMS connection from the server
        ConnectionFactory connectionFactory
            = new ActiveMQConnectionFactory(url);
        Connection connection = connectionFactory.createConnection();
        connection.start();

        // Creating session for seding messages
        Session session = connection.createSession(false,
            Session.AUTO_ACKNOWLEDGE);

        // Getting the queue 'InventoryUpdate'
        Destination destination = session.createQueue(subject);

        // MessageConsumer is used for receiving (consuming) messages
        MessageConsumer consumer = session.createConsumer(destination);

        // Here we receive the message.
        // By default this call is blocking, which means it will wait
        // for a message to arrive on the queue.
        Message message = consumer.receive();

        // There are many types of Message and TextMessage
        // is just one of them. Producer sent us a TextMessage
        // so we must cast to it to get access to its .getText()
        // method.
        if (message instanceof ObjectMessage){
        	InventoryUpdate update = (InventoryUpdate) ((ObjectMessage) message).getObject();
        	System.out.println(update);
        }

        System.out.println("Done");
        connection.close();
    }
}

Ofcourse, we can also use camel template for publishing InventoryUpdate events to the topic instead of using JMS client directly as described in step 3 above.

Now, let us start by configuring Apache Camel to receive the message and process it.

i. Configure camelContext.xml


 <beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
	xmlns:broker="http://activemq.apache.org/schema/core"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd">

	<!-- If a bean is defined in Spring XML or scanned using the Spring 2.5
		component scanning mechanism and a <camelContext> is used or a CamelBeanPostProcessor
		then we process a number of Camel annotations to do various things such as
		injecting resources or producing, consuming or routing messages. -->
	<!-- lets configure the Camel ActiveMQ to use the ActiveMQ broker declared
		above -->
	<bean id="main-broker" class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="brokerURL" value="tcp://localhost:61616" />
	</bean>

	<bean id="jmsToFileRoute" class="com.JmsToEmailRoute" />

	<camel:camelContext id="camelContext">
		<camel:routeBuilder ref="jmsToFileRoute" />
	</camel:camelContext>
</beans>

ii. Define the route

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class JmsToEmailRoute extends RouteBuilder {

	@Override
	public void configure() throws Exception {

		ComboPooledDataSource dataSource = new ComboPooledDataSource();
		dataSource.setDriverClass("com.mysql.jdbc.Driver");
		dataSource.setJdbcUrl( "jdbc:mysql://localhost:3306/test" );
		dataSource.setUser("root");
		dataSource.setPassword("");

		from("activemq:queue:VirtualTopicConsumers.ConsumerA.InventoryUpdate")
				.idempotentConsumer(
						bean(MessageProcessor.class, "getId"),
						JdbcMessageIdRepository.jpaMessageIdRepository(
								dataSource, "notificationProcessor"))
				.bean(MessageProcessor.class,
						"process(InventoryUpdate)");
	}

}

iii. Define message processor.


import InventoryUpdate;

public class MessageProcessor {
	public void process(InventoryUpdate message){
		System.out.println("Got message: " + message);
	}

	public long getId(InventoryUpdate message){
		return message.getItemId();
	}
}


Explanation: If you look at  JmsToEmailRoute, it is defining a route from Queue "VirtualTopicConsumers.ConsumerA.InventoryUpdate" to the processor bean "MessageProcessor". As such, Camel will invoke "process(InventoryUpdate message)" method for every InventoryUpdate event published to the topic "InventoryUpdate".

One important consideration here is that of Idempotence i.e. how will your application react to duplicate messages? Duplicate messages can be delivered for reasons such as buggy producer, broker crashing just before the acknowledgement etc.

There are couple of ways to solve this problem. One way is to use JMS or JTA/XA transactions. This is relatively slow as 2 phase commits and multiple flush to disks are involved.

The other way is duplicate detection and caching of messages. Here is the pseudocode



[WebMethod]

ResponseMessage DoRequest(RequestMessage)
{
	Extract the request identifier from the request.

	Check if the request has already been processed by querying the persistent log.

	If (request processed) then 
		return response
	Else
	{
                ITransaction trans = CreateTransaction()

                ProcessMessage(RequestMessage, trans);
 
                //Store the request identifier the persistent log or database
                UpdateLog(request identifier, trans)

                trans.Commit();

                Return responsemessage;
	}
}


Camel provides support for Idempotent Consumer. Look at the route definition again:


//Use C3P0 connection pooling 
ComboPooledDataSource dataSource = new ComboPooledDataSource();
dataSource.setDriverClass("com.mysql.jdbc.Driver");
dataSource.setJdbcUrl( "jdbc:mysql://localhost:3306/test" );
dataSource.setUser("root");
dataSource.setPassword("");

from("activemq:queue:VirtualTopicConsumers.ConsumerA.InventoryUpdate")
	.idempotentConsumer(
			bean(MessageProcessor.class, "getId"),
			JdbcMessageIdRepository.jpaMessageIdRepository(
				dataSource, "notificationProcessor"))
				.bean(MessageProcessor.class,
					"process(InventoryUpdate)");


Here, the bean method  MessageProcessor.getId() is invoked to get the request identifier. ' JdbcMessageIdRepository.jpaMessageIdRepository ' checks this identifier against the database. If no existing identifier is found, it stores the identifier in the database and invokes  'process(InventoryUpdate)' method.

iv. Finally, start the consumer.
 
public class TestMessageProducer {

	public static void main(String[] args) {

		//Talks to InventoryUpdateProducer
		ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("camelContext.xml");
        }
}

Happy messaging!

Sunday, August 21, 2011

BBA Entrance Interview

My cousin recently appeared for her BBA interview. The interviewer asked her "Do you read the newspaper?". "Yes", my cousin replied. The interviewer asked an expected follow up question "Which sections of the newspaper do you read?" to which my cousin candidly replied "Actually my father once told me that if the Sensex reaches 20,000 points, he will buy me a laptop. So I check the business Sensex section daily!"

No prizes for guessing, she was selected!

You may also like: Thirst

Friday, August 19, 2011

Bangalore meri jaan!

Traffic humor @ Bangalore






You may also like: Humor: Software

SOA Technology @Amazon

Amazon and Service Oriented Architecture (SOA)

The excerpt below comes from the 2010 Shareholder Letter by Amazon CEO Jeff Bezos. You can read more about other technologies at Amazon here.

"Our technologies are almost exclusively implemented as services: bits of logic that encapsulate the data they operate on and provide hardened interfaces as the only way to access their functionality. This approach reduces side effects and allows services to evolve at their own pace without impacting the other components of the overall system. Service-oriented architecture -- or SOA -- is the fundamental building abstraction for Amazon technologies. Thanks to a thoughtful and far-sighted team of engineers and architects, this approach was applied at Amazon long before SOA became a buzzword in the industry. Our e-commerce platform is composed of a federation of hundreds of software services that work in concert to deliver functionality ranging from recommendations to order fulfillment to inventory tracking. For example, to construct a product detail page for a customer visiting Amazon.com, our software calls on between 200 and 300 services to present a highly personalized experience for that customer."


Continuing from the excerpt above, of course there are challenges with the SOA approach. If 200+ services are called to render a single page, dependencies and handling failures becomes a critical aspect. A critical service failure can directly impact customer experience and revenue loss. Hence the need for software to monitor hardware and software in real time and  generate alerts. Processes need to be set to respond to such events.

Another important aspect is meeting the SLA (service level agreements) for a page. The slowest service will definitely impact the overall load time of the web page. But it also depends on the overall rendering framework. To keep the overall latency low, the services have to be categories based on customer impact, availability and bunch of other factors. Each service will have to meet the SLA defined for it's band.

Meeting SLA for critical services requires sound engineering. Right from understand the use cases, to designing a clean API, designing caching mechanism, using the right hardware and software for the job, handling peak traffic (throttling), capacity planning and monitoring are some of the things to consider even before starting on code.

Another point to consider is the impact of service upgrades on clients. Changing the service interface is not trivial and often requires coordination among multiple teams. More than 1 version of the service needs to be deployed to avoid breaking current systems.

With many services around, service discoverability is difficult. A centralized service registry can help here. To access sensitive data, authentication and authorization needs to be in place. Most of it should be transparent to a service developer.

In short, SOA has some great benefits but it comes with it's own set of baggages. SOA needs an ecosystem of software and processes to reap benefits from it.

You may also be interested in this article: SOA learnings from Amazon

Friday, July 29, 2011

Social Commerce: Part 3 : The case for and against Facebook

This is the third article in the series 'The case for and against Facebook'

While the previous strategies can be labeled as "Direct Sales", using 'Indirect sales', a retailer can create more value. And all of it can be achieved right from your fans and the fan page.

i. Using Facebook, it is easy to extract trends, identify influencers, monitor competition and glean customer insights. Here is an example of a survey conducted by an e-retailer:








Simple questions like these can provide insights around what strikes a chord with your target audience.

ii. What more? If you boast of your website's fan base, build a detailed profile of your fans using their interests, posts and other information and feed it to your CRM system. Track customer's interaction history on fan page, learn from their kudos and complaints and they will love your customer service. The important point to understand here is to move away from boasting about the number of ‘fans’ and ‘likes’ and instead explore actual consumer behavior.

iii. Another important 'scorecard' that can be derived from Facebook (and social media in general) is customer satisfaction data. It is a fast and inexpensive way to measure customer satisfaction.

With technologies like sentiment analysis and NLP (Natural language processing), you can capture:
  • Buzz - How much people are talking about your brand?
  • Net Sentiment - How positively they perceive your brand?
  • Passion Intensity - How emotionally charged their feelings are?

Hope you enjoyed this series. Feel free to share your ideas.

Previous posts in this series: Part 1 Part 2


Wednesday, July 20, 2011

Metrics and more


In my quest for quality open source software, I came across a library for "Capturing JVM and application-level metrics. So you know what's going on."

Meet Metrics @ https://github.com/codahale/metrics

One great feature about this library is it can be easily integrated with Graphite. Graphite is a a highly scalable real-time graphing system.

A presentation about the library can be viewed here. I must say it is a great presentation. A memorable line from the presentation:

"Business value is anything which makes people more likely to give us money. We want to generate more business value." 

The library is actually very simple to use. Some code snippets to help you get started:



public class EServiceImpl implements EService {

//Measure the # of times the API is invoked
private final MeterMetric eMetric = Metrics.newMeter(
 getClass(), "Send API", "reqs", TimeUnit.SECONDS);

//Measure the rate of event i.e. req/ sec.
private final CounterMetric eCounter = Metrics.newCounter(getClass(),
 "ECounter");

ConsoleReporter.enable(10, TimeUnit.SECONDS) //Print metrics to STDERR every 10s

public void service1(){
        eCounter.inc();//Increase counter by 1
        .........
        eMetric.mark();//Mark the occurrence of an event.
}


Output on the console:

7/20/11 10:41:06 AM =============================================================
com.impl.EServiceImpl:

  ECounter:
    count = 10

  Send API:
             count = 10
         mean rate = 5.00 reqs/s
     1-minute rate = 2.50 reqs/s
     5-minute rate = 0.50 reqs/s
    15-minute rate = 0.16 reqs/s

If you're writing a Servlet-based web service, you can add MetricsServlet from the metrics-servlet subproject to an internally-accessible context. Add the following lines in web.xml.



<servlet>
 <servlet-name>CodahaleMetrics</servlet-name>
 <servlet-class>com.yammer.metrics.reporting.MetricsServlet</servlet-class>
 <init-param>
  <param-name>metrics-uri</param-name>
  <param-value>/metrics</param-value>
 </init-param>
 <init-param>
  <param-name>ping-uri</param-name>
  <param-value>/ping</param-value>
 </init-param>
 <init-param>
  <param-name>healthcheck-uri</param-name>
  <param-value>/health</param-value>
 </init-param>
 <init-param>
  <param-name>threads-uri</param-name>
  <param-value>/threads</param-value>
 </init-param>
</servlet>

....

<servlet-mapping>
 <servlet-name>CodahaleMetrics</servlet-name>
 <url-pattern>/CodahaleMetrics/*</url-pattern>
</servlet-mapping>

Navigate to: http://hostname:port/WebAppName/CodahaleMetrics

The output metrics is dumped in JSON format. You can parse it and pass it to your favorite graphing library.

Note: All metrics are reported via JMX, which you can view using VisualVM or JConsole.

Documentation needs some work but overall, I would rate the project as Very Good.

Friday, July 15, 2011

The New Sony Vaio Advertisement

Have you seen the new Sony Vaio advertisement featuring Kareena Kapoor in a myriad of colors? Indeed, the background setup and the costumes in the ad are bright and vibrant and the music pleasing. It goes well with the tag line "More colors, more style".

But what caught my attention was the concept of the commercial. The concept is simple - wear a matching dress to go with your laptop's exterior or the other way around. It's like the Kohler commercial that was on air few years back. The words struck me - "So.. what can I do for you?..... Design a house around this."

The Kohler advertisement was simply amazing but Sony Vaio commercial made me feel pity about it. In the competitive laptop market, each company is trying to beat it's competitor. With no real USP, companies are now competing on trivials. It seems as if these companies are saying - Take 1 GB more RAM, or the new 15.555" wide screen laptop, or take more covers for your laptop. As if the women of our times don't have burden of choosing the right dress for the occassion, they have one more to make now.

It is not difficult to vision what is coming next, for tomorrow, they may come up with washable laptop covers, and God forbid, tie up with a detergent selling companies and offer 1 kg pack free with every purchase of laptop!

My point is innovation is important and there is no substitute for it. Cheap marketing gimmicks and creativity shown at the wrong place will not lead to happy customers and not drive sales. There is no value creation in trifles.

The Sony Vaio Commercial:



The Kohler commercial:

Tuesday, July 5, 2011

Trance music is bliss!

Perhaps the most ambiguous genre of dance music, trance could be described as a melodic, more or less free-form style of music, partially derived from house. While there is no strict definition for trance, songs of this genre are usually characterized as being accessible and having anthemic and epic and rifting and psychedelic qualities.

It is my favorite genre. Be it vocal or purely digital, I am crazy about it.

So what is trance? How is it different from Techno music?

1. Techno focuses on rhythm and beat.
2. Trance focuses on melody.
3. Techno is more repetitive, and can be blended with other tracks.
4. Trance is less repetitive, and is a stand-alone piece
5. Techno is pure energy
6. Trance has a building up of energy, much like a story with a climax
7. Techno was developed in Detroit in the 1980’s
8. Trance was developed in Europe (Germany) in the 1990’s
9. Techno is inspired dance music
10. Trance is inspired music dedicated to the listening mind!

The most popular DJs in the world often play Trance music. Popular among them is Paul Oakenfold (1998–1999), Sasha (2000), John Digweed (2001), Tiësto (2002–2004), Paul van Dyk (2005–2006), and Armin van Buuren (2007–2011). Nadia Ali was recently made the queen of trance because of her amazing voice!

Armin van Buuren is one of the most terrific DJ of all times. In 2007, 2008, 2009 and 2010 he was voted number one in DJ Magazine's annual top 100 list of the most popular DJs. You can experience his music in the video below:





And "For an Angel":


Impressed?


Sunday, July 3, 2011

Hazelcast - A simple distributed caching library

Its been a while I explored open source projects in distributed systems area, and interestingly, I had two interesting finds in terms of projects worth exploring - Hazelcast and ElasticSearch. I have seen such projects being implemented in large software companies and I was happy to see feature rich open source projects. So I decided to explore both of them.

From their website: "Hazelcast is an open source clustering and highly scalable data distribution platform for Java, which is: "
  • Lightning-fast; thousands of operations/sec.
  • Fail-safe; no losing data after crashes.
  • Dynamically scales as new servers added.
  • Super-easy to use; include a single jar.
And yes, it keeps the promise. It is very simple to include it in your project and get started.

Some good things that I liked about Hazelcast:
  • Hazelcast is dead simple, it does what it says and performs really well without any configuration overhead. e.g. Nodes discover each over with no configuration.
  • It uses peer-to-peer communication as against client-server (Teracotta's Ehcache) setup.
  • It is a little more than a cache as it provides distributed implementation of map, multimap, queue, topic, lock and executor service.
  • Focus on strong consistency as against eventual consistency (Amazon SQS) i.e. GETs and PUTs are guaranteed to be consistent. I am not sure whether availability or partitioning takes a hit here.
  • Native Java, memcache, REST and C# clients.
  • No external dependencies. Hazelcast uses pure Java including NIO for all peer-to-peer communication.
There is more interesting stuff about HazelCast that I will cover in the next article.
    Getting started: Some sample code snippets are available here.

    Who is using Hazelcast and how?

    Take a look at this article. It talks in detail about caching and processing 2TB Mozilla Crash Reports in memory with Hazelcast. The project lives here.

    In short, Hazelcast is cool!

    Other alternatives worth looking at:
    • Ehcache
    • JBoss Cache
    • OSCache
    • Memcached
    In the coming articles, I will discuss ElasticSearch.

      Friday, July 1, 2011

      Gamification: The new mantra of acquiring and engaging customers

      Read this great article about 'Gamification'. We all have seen the concepts being applied in the online but virtual world. This article highlights it coming of age and it's impact on user experience on the internet.

      Former EA executive, KPCB sFund lead and all around inspiring person Bing Gordon led a talk today at the sFund Gamification Summit. In his talk Gordon broke down platitudes like “gamification is important” into key actionable takeaways on how succeed with gamification, takeaways that could be reformatted and applied to any company.

      When asked why he went through the trouble of putting his guide to how to successfully gamify together for entrepreneurs, Bing told me, “Every startup CEO should understand gamification, because the gaming is the new normal,” referring to the fact that every one who had a Nintendo at 16 also has a brain that works in a way that’s more receptive to game elements. “We are overdeveloping the visual cortex of our customers,” he said.

      [The cerebral cortex is the most highly developed part of the human brain and is responsible for thinking, perceiving, producing and understanding language. The visual cortex is that part of the cerebral cortex responsible for processing visual information.]

      The best way to acquire customers was to eliminate bounce, by creating a pleasant experience at first entry way, being said. “If you create cognitive dissonance in the first 5 seconds they bounce,” he said. Designers should aim for creating a “touchable box” or something that people want to touch. He then referred to the game’s interface as being an engine, saying that a great UX/UI guy could save a company from having to throw out thousands of lines of code and could replace five engineers.

      In terms of user engagement, Gordon advised CEOs that first impressions matter, “Your job is to create a “Wow” within the first session … The value of gamification is the mechanics second and the mind of gamers first.”

      Things like virtual goods, showing numbers and giving badges are ways to positively reinforce users for playing your game. Letting them own part of the game by generating and submitting their own content was another way to solidify this emotional bond between creator and user.

      Bing also emphasized the value of avatars in games, “Any kind of avatar that people buy into can dramatically change engagement.” It makes sense, people love things that give them a sense of identity. If a game, service or anything really can give them that, then they’re hooked.

      Constraints, pre-announcements, and engendering social obligations to play a game were other things Gordon touched on that can contribute to customer retention. He said that the number one question on a game designer’s mind regarding a user should be “Will she come back?” and then “When?”

      “We’re in an era where we can have billion dollar audiences,” he closed out the talk saying. There’s no harm in using a few tried and true devices to keep people coming back.

      Notes about gamification:

      Gamification is the use of game play mechanics for non-game applications (also known as "funware"), particularly consumer-oriented web and mobile sites, in order to encourage people to adopt the applications. It also strives to encourage users to engage in desired behaviors in connection with the applications. Gamification works by making technology more engaging, and by encouraging desired behaviors, taking advantage of humans' psychological predisposition to engage in gaming. The technique can encourage people to perform chores that they ordinarily consider boring, such as completing surveys, shopping, or reading web sites.

      Early examples of gamification are based on rewarding points to people who share experiences on location-based platforms such as Facebook's "Place" feature, Foursquare (social network), and Gowalla. Some of the techniques include:
      • achievement "badges"
      • achievement levels
      • a task a company is trying to encourage, such as completing a social networking
      • profile or earning a frequent shopper loyalty award.
      • virtual currency
      • systems for awarding, redeeming, trading, gifting, and otherwise exchanging points
      Gamification is used by marketers and website product managers as a tool for customer engagement, and encouraging desirable website usage behavior. Gamification is readily applicable to increasing engagement on sites built on social network services. One site, DevHub, increased the number of users who completed their online tasks from 10% to 80% after adding gamification elements.

      You may be interested in other E-Commerce article: Social validation and E-Commerce

      Sunday, June 5, 2011

      Social Commerce: Part 2 : The case for and against Facebook

      2. Continuing from the previous post, the second point of focus is little 'off' Facebook. Facebook provides set of developer APIs which in their words are ".. powerful APIs enable you to create social experiences to drive growth and engagement on your web site."

      Notable among them is the Graph API and Open Graph protocol. These APIs can be utilized to extract data like people, photos, events, and pages and the connections between them i.e. friendships, likes, and photo tags.

      Amazon started tapping into facebook since the middle of last year. If you go to your recommendations, using Facebook Connect, Amazon will now serve you social recommendations based on information in your Facebook profile.


      The things this 'connect' does is pretty much obvious. But the recommendations can be useful because of actual liking / dislike info it gets from facebook.

      It is very much like YouTube. YouTube recommends videos according to user's past record of viewing / liking / disliking different videos. Similarly, Amazon copies all information from user's Info page, friends and their Info page. It gets the user's likings of Movies, Music, Books, Activities, TV Shows etc from Info Page and then suggest related books , DVDs and other merchandise from their site to the shopper.
       
      Amazon 'connect' has another good feature. It captures user's friends and their information and then suggest gifts to your friends according to their likes and wishlist just before their birthday. Interestingly, Amazon has its own system where shoppers can tell if they own a particular product and get meaningful product recommendations! And this system existed well before Facebook published it's 'Like' widget.

      Similarly, there are other companies like Levis, Jansport and Wet Seal exploiting the power of social graph.

      What strategy should you apply? 

      It depends on the nature of your business. For an online business selling books, movies or dvds, I suggest a good strategy will be to utilize the API to glean relevant information about your customers and their network, both implicit and explicit data (likes, info etc) and utilize it to make smart recommendations.  The reason is that users are comfortable sharing their likings for such categories and the data is already available! And yes, you need a smart recommendations engine to benefit from this technique!

      For others, an indirect strategy is required. More on this in my future blogs.

      Let me warn you beforehand that there will be privacy issues if you adopt this strategy. My advice would be to inform your customers on how you plan to use their social network data and stick to this policy.

      The next part in this series will talk about a smarter way of tapping into the social network. Stay tuned!

      Tags: Social commerce, sell on facebook, Ecommerce facebook twitter,  utilize facebook, social media, promote business on facebook.

      Thursday, May 26, 2011

      Social Commerce: The Case for and Against Facebook Commerce: Part 1

      There is a lot of buzz around social commerce. Retailers are trying different strategies to get hold of shoppers. Till now, retailers in India see social commerce as a customer engagement and retention tool rather than customer acquisition. The numbers (Q2 2010 survey) below will explain you why:

       Metrics
      Average Facebook metrics
      Click through rate
      1%
      Conversion rate
      2%
      Average friends per account
      132
      Average impressions per post
      50


      In sum, the effective conversion rate is less than 0.02%.

      So how are retailers utilizing social websites like Facebook and Twitter? As I see it, there are 3 ideas that retailers are experimenting with:

      1. Ads, creating stores (yes, a full fledged mini store on facebook!), fan pages, running deals and promotions and peer to peer contacts within facebook. Some retailers are organizing trivia quiz, "do you know" stuff, "answer a question and win an all expense paid trip to the moon (no mention of return tickets here!)".

      Take a look at these promotions taken from facebook.








      And, if you are lucky to win a contest like this one -


      You will be a -


      But don't be too happy yet because you may end up asking a question -


      Ok, enough of fun and back to business.

      BigCommerce brings the products from your catalog right into your facebook page! If you want to sell on Facebook, check out this application: http://www.facebook.com/payvment

      In short, everybody wants to ride this big boat called social commerce. It seems they all have a strategy, but somehow, it feels a big chaos.  Let us see which way the wind blows.

      Have you  been bitten by the social commerce bug yet and want to go beyond? Are there more smarter ways  to engage your customers? More discussion on idea number 2 and 3 in the days to follow. You can get a notification when the next blog article is published by submitting the "Follow by email" form below.

      Tags: Social commerce, sell on facebook, Ecommerce facebook twitter,  utilize facebook, social media, promote business on facebook.

      Tuesday, May 24, 2011

      Framing vision statement - Guide with some examples

      This article spells out vision statement of some well known companies and details a step by step guide to form your own vision statement.

      For any company, be it a large corporation or a startup, the vision statement is of great importance. It is like the light house on a dark night, the north star in difficult times. It is the few words that you just don't speak to your customers, but live and serve by it.

      So, if you are starting a company and need help in framing a vision statement, here is a collection of visions statements from well known companies.

      At Alcoa, our vision is to be the best company in the world--in the eyes of our customers, shareholders, communities and people. We expect and demand the best we have to offer by always keeping Alcoa's values top of mind.

      Caterpillar - "Be the global leader in customer value."

      Amazon - "Our vision is to be earth's most customer centric company; to build a place where people can come to find and discover anything they might want to buy online."

      ICICI - "To be the preferred bank for total financial and banking solutions for both corporates and individuals."

      Hero Honda - "A mobile and an empowered India, powered by Hero Honda."

      Pfizer - "We will become the world's most valued company to patients, customers, colleagues, investors, business partners, and the communities where we work and live."

      Sears  -  "To be the preferred and most trusted resource for the products and services that enhance home and family life."

      So, when you are ready to craft a vision statement, start by:

      Step 0.   This is not part of the process but Always keep your customers in mind while forming the vision statement.
      Step 1. Getting a piece of paper and writing down few key words about your company's products and services. Ideally, 4-7 words are enough. Spend 15 - 20 minutes with your team on this.
      Step 2. Next, think about where your company would be 15 - 20 years from now.
      Step 3. How would your customers remember and think about your company?
      Step 4: Combine the words realized in step 1 and 2 with phrases formed  in Step 3.
      Step 5: Combine all the ingredients to create that perfect "Vision Statement".

      Let us work with an example. Let us say, you are starting an online retailing business "nameit.com" which deals in many product categories.

      Step 1: Pick the words - shopping, destination, customers/guests.
      Step 2: Think about the future - value, experience, innovation.
      Step 3:  "I like shopping from nameit.com", "Great value for money", "I am impressed with nameit.com 's customer service".
      Step 4:  "Preferred shopping destination", "Deliver outstanding value", "Great/Exceptional customer experience"

      And finally, combine these phrases to form a coherent vision statement. So here we end up with something like this - "To make 'nameit.com' he preferred shopping destination for our customers by delivering outstanding value and an exceptional customer experience by  consistently fulfilling our 'Delighting you always' promise."

      Hope this article helped you form a vision statement. Feel free to share your company's vision statements in the comments section below to help other budding entrepreneurs.

      Good luck!

      Tags: Visioin statement, creating vision statement, vision statement example, vision statement sample

      Sunday, May 22, 2011

      Opportunity: Help desk, customer support, support ticket system

      If the idea is to support and engage on line customers, and you run an e-commerce (B2C) business, are there any good open source software to help you out?

      A good solution will have these characteristics/features:
      • Customers can ask questions and the site owner can respond. 
      • A FAQ, report bug and "Thank you" section.
      • Business owner can make announcements. 
      • A Web 2.0 admin panel where business owner can administer the sections mentioned above.
      • Easily integrated with the main B2C website. 
      • Implementation/Integration with a ticketing system.
      • A dashboard
      • Hosted or downloaded software 
      There are a few hosted (SaaS) solutions available like Zendesk, but there are some problems with such a solution like:
      • Vendor lock in. 
      • Vendor can increase the pricing; the good old ‘bait and switch’. Zendesk did it recently.
      • What happens to your data if the provider decides to shut down? 
      There is an opportunity here to create a product that can fulfill these requirements and yet be reasonably priced.

      Such a software would be an alternative to Zendesk/GetSatisfation/Uservoice. And if it is available under open source, that would be simply great. I will surely dedicate a blog for it!

      Tags:  Open source, help desk, customer support, support ticket system

      Saturday, May 21, 2011

      Turn Traffic Jams Around

      I am an avid follower of "The speaking tree" on Times of India (TOI). The quality and content of this newspaper has considerably gone down, but this section in TOI gives me lot of hope. I am sure others find it the same way.

      Look at the graphs below. You must have seen them before. In two words, we can summarize them as "growth" and "decay". But of what? Decay of happiness and growth of negativity in our lives. For different people, the slope of the curve will be different, but the trend is common.


      And then I read an article by Shri Nimishananda which gave a precise answer to this life's perennial problem. Excerpts from his writing:

      "We are moving along with the current of our desires, our own goals, aims and agendas. We are constantly thinking of negative things, having a sense of fear unnecessarily and constantly expecting the worst to happen. Negativity and adversities are attracted by our negative state of being and they come and settle in us, making our mind a garbage bin.

      Many a time we feel that everybody is victimizing us for no fault of ours, making us feel very pathetic and ordinary. Instead, when we don't unnecessarily assume and presume the above, we value and feel that life is precious, auspicious, esteemed and extra ordinary. Meditation brings about this awareness to make our life extra ordinary.

      Even if you are caught in a traffic jam, relax and enjoy the respite from driving. Resolve that "I will now convert this traumatic situation into a blissful one". Then, evolve by chanting a mantra, singing a bhajan or praying for someone whom you think is suffering. Then, you convert an ordinary moment into an extra ordinary moment of presence of mind and wisdom.

      So, rejuvenate and refresh your soul. Don't worry about the traffic ahead or behind. Till the traffic moves, you can not move anyway! So, just relax and use this time to touch your inner core; accept the traffic jam as being inevitable."

      So,  what is important is to acknowledge and address it and finally invert the graphs above! Have a nice weekend!

      How to Teach Physics to Your Dog

      This is about the book "How to Teach Physics to Your Dog".

      A guy named Chad Orzel with an interesting blog about physics wrote a book about teaching physics to your dog. He was asked about his book. The following conversation followed:

      So, why do you talk to your dog about physics?
      Lots of reasons, but the main one is that I'm a physics professor. Talking about physics is what I do. Sooner or later I talk to everybody about physics.

      OK, but why the dog?
      Talking to the dog about physics is worthwhile because it can help me see how to explain physics to my human students. Humans all come at the subject with the same set of preconceptions about how the world works, and what "should" happen, and it can be very hard to shake those off. That's a big barrier to understanding something like quantum physics.

      Dogs look at the world in a very different way. To a dog, the world is a never ending source of wonder and amazement. You can walk your dog past the same rock every morning, and every morning, she'll sniff that rock like she's never sniffed it before. Dogs are surprised by things we take for granted, and they take in stride things that would leave us completely baffled.

      Can you give an example?
      Well, take the dog's bowl, for example. Every now and then, we put scraps from dinner in the bowl when she's not looking, and she's become convinced that her bowl is magic-- that tasty food just appears in it out of nowhere. She'll wander over a couple of times a day, and look just to see if anything good has turned up, even when we haven't been anywhere near the bowl in hours.

      This puts her in a better position to understand quantum electrodynamics than many humans.

      It does?
      Sure. One of the most surprising features of QED, in Feynman's formulation, is the idea of "virtual particles." You have an electron that's moving along, minding its own business, and every now and then, particle-antiparticle pairs just pop into existence for a very short time. They don't stick around very long, but they have a real and measurable influence on the way electrons interact with each other, and with other particles.

      You're making this up, right?
      No, not at all. One set of these interactions is described by a number called the "g-factor" of the electron, and this has been measured to something like fifteen decimal places, and the experimental measurement agrees perfectly with the theoretical prediction. If there weren't electrons and positrons popping out of nowhere, there's no way you could get that sort of agreement.

      So, what's this have to do with the dog?
      Well, like I said, the dog is perfectly comfortable with the idea of stuff popping into existence out of nowhere. If a great big steak were to suddenly appear on your dining room table, you'd probably be a little perturbed. The dog, on the other hand, would feel it was nothing more than her due.

      So she's perfectly ok with the idea of virtual particles, unlike most humans, who tend to say things like "You're making this up, right?" She was already convinced that there were bunnies made of cheese popping in and out of the backyard, and just regards QED as a solid theoretical justification for her beliefs.

      So that's why people should teach quantum physics to their dogs?
      Exactly. Also, it's just about the coolest thing ever.

      Hope you enjoyed the conversation!

      Thursday, May 19, 2011

      The 'New' Internet & Mobile Association of India website

      Internet & Mobile Association of India (IAMAI)

      I have been using this website for few years because they have good reports on Internet usage in India. Till few days back, I could download a report without any hassle.

      I was pleasantly surprised yesterday to see their revamped website but more so when the website asked me to login. Filling a long form, I registered, but then to my dismay, I saw this line on the "Reports" page -

      "All the reports which are more than 15 days old are available on nominal payment as mentioned against each report."

      With a small hiccup, I decided to click on the report "Digital Commerce: March 2011". The next page advised me - "To download file Pay Rs. 2206.00!!"

      Wow, I could not believe this. AFAIK, these reports are sponsored reports and have been available for free for the last few years. I absolutely hated this. I tried to download a 2010 report titled "Mafoi Survey" and even that report was priced at Rs 2206! A 2008 "I Cube report" was also available at the same price.

      I really don't understand this. First of all, is the new IAMAI website only for corporates who can pay this 'nominal' amount? Why was a nominal fee put in place? If I am a student doing a research in this space, how is this 'nominal price' going to help me? Why are all the reports available for this magic price of Rs 2206? Why is their no decay in price for old reports?

      My suggestion is that the reports should be priced for corporates. For individuals, it should be free.

      The website still has some errors on the homepage, some UI and some javascript errors, loads slow and looks a beta website. But I am willing to overlook, if I get access to the reports for free.

      Sunday, May 15, 2011

      Interesting Facts - Amazon’s Hidden Empire

      I came across this interesting article about Amazon. It is worth a view!

      Although, all the latest buzz on the web is mostly around Google, Facebook, Groupon and the new age apps that have gained quick popularity but one of the oldest players of the web, Amazon is a giant that not many would have noticed. Amazon’s businesses are spread across retailing, devices, content, analytics, hosting and many more. Here’s an interesting slide deck on Amazon’s Hidden Empire.