Wednesday, October 1, 2014

Day 5: Accessing elasticsearch using PHP

26.092014

I was given access to MySQL database on the trial server. I created a database and some tables on that server and tried to import the data on MySQL server into elasticsearch. I ran off track a couple of times. But by the end of the day I managed to import the MySQL table data into elasticsearch.

MySQL database is like an index in elasticsearch and a MySQL table is like a type in elasticsearch. A record in a row is stored as an object and is referred using an id in elasticsearch. I took the MySQL row data into a PHP array and encoded it into a json object and passed it into elasticsearch.

Another way to add data to elasticsearch is using a PHP client. However here I used a cURL, accessing using command line in PHP to insert the data into elasticsearch.

Day 4: Presentation

25.09.2014

Throughout first half of the day I prepared for the presentation on big data, NoSQL and elasticsearch. My supervisor and few of the team were present for the presentation I did. They asked questions to clarify some points on the presentation.


In the afternoon I started to get familiar with the elasticsearch. I was given access to an account in their trial server. I used their server to install elasticsearch. Then I referred to the documentation on elasticsearch and learnt how to insert data into elasticsearch and how to perform search, delete and update functions.

Day 3: Big data, NoSQL and Elasticsearch

24.09.2014

Today I was assigned with the task to create a presentation under the topics Big Data, NoSQL and ElasticSearch. I was a newbie to all these concepts and they were extremely interesting fields to study on. If I give a brief introduction here,

Big Data
The amount of data being generated worldwide is rapidly increasing. Above 900 million active users are generating data on Facebook right now. More than 304 million tweets are being sent on twitter each day. Unlike in previous years the information generated are moving from structured to a semi-structured patterns. For an example the click streams, blogs, tweets, video, etc. Handling such a large amount data including semi structured data is turning into a challenge.
NoSQL
NoSQL is a database structure which moves away from the relational database model. They are more suitable for handling the problem that arise with Big Data. They do not operate on a tight schema or care much about consistency. They give priority to availability and partition tolerance. It is based on the BASE model. BA-basically available, S- Soft state, E- eventually consistent.

Elasticsearch

Elasticsearch is a search engine created on apache lucine. It can be categorized as a NoSQL (Not only SQL) database. It is much faster and efficient in handling big data than relational database model.

Day 2: Introduction to Vocanic

23.09.2014

This was a special day, I was introduced to the CTO of Vocanic. He gave a basic introduction to the company with a presentation on Skype.
Vocanic is a part of GroupM. GroupM is the world’s largest advertising media company in terms of billings. It is headquartered in New York City with over 21,000 employees and 400 global offices in 81 countries. Vocanic handles the social media marketing campaigns for the groupM clients.
Vocanic, founded in 2005, is Asia’s leading business focused on Social Media. Headquartered in Singapore, with offices in Bangkok, Kuala Lumpur, and Jakarta we can roll out regional programs with on the ground support for each major market. Vocanic in Sri Lanka was initiated recently and is under expansion of facilities and workforce. It is already carrying out tasks for the headquarters.
Read more about Vocanic:


Today I finished the work with the token extender for Facebook.

Day 1: Token Extender

22.09.2014

This was my first day of training at Vocanic, Singapore. I was introduced to the team. They were a friendly staff some having years of experience working with well reputed firms.
Then I had to get familiar with the company. Vocanic is a part of the groupM which is one of the leading marketing firms in the world. Vocanic handles the social media marketing strategies for the clients of groupM. Social media marketing campaigns are done through social networks such as Facebook, twitter, instagram, tumblr, etc.

I had never tried to develop a Facebook application before and this was a whole new experience for me. To be honest I was excited and willing to start ASAP. The Facebook apps have a lot going on behind the scene at the back end. I was told that they develop their apps using PHP mostly with an object oriented approach.

First day I was given the task to create an access token extender for a Facebook application.
Find more about access tokens here:

I created a form with three inputs where you can enter app id, app secret and access token. When a user submit this form it is sent via a php cURL and the extended token will be displayed back on the page.

First I had to understand the use of a cURL and displaying the result back using Ajax. This assignment moved on to the next day.