Latest Entries »

Monday, November 08, 2010

Mondrian, Apache Tomcat and MySQL – Installation and Configuration on Linux

In this post, I am going to walk you through a manual installation and configuration of Mondrian with Apache Tomcat 6. I have always believed to have a clean install from source and thus I am going to follow the same here as well. The following procedure is what I have used in our production and is thoroughly tested in Ubuntu, CentOS and RHEL. Please post your comments/suggestions if you find any flaws in this.

Step – 1: Installing Sun-JDK
There have been many a times that I have faced unknown and hard to debug problems with the default installations of Sun-JDK which comes with Ubuntu/RHEL and other Operating Systems. Specially in production systems, I feel much more comfortable compiling things myself and thus if you are planning to make deployments in production system, it is better that you know what you are installing and where.

Sunday, October 24, 2010

PasswordLess Login with Open-SSH Linux

OpenSSH allows you to login to remote systems and run commands. This is not a new concept for most of linux developers but for who require to perform remote commands without being prompted for a password, this quick tutorial gives just a way. Password less login to remote systems is useful in a lot of ways like copying backups across systems, monitoring multiple systems, trigger various commands, sync repositories etc.

So following is what you would need to do to achieve this. There are plenty of tutorials already for this over the internet since it is not a new concept. I am just documenting it for my personal use and for those who stumble upon my blog.

Step-1 : If you dont have a keypair already, then generate one.
## Leave the options blank and press Enter. 
## It automatically selects the defaults which are good enough

deploy$ ssh-keygen -t rsa

## Output
Generating public/private rsa key pair.
Enter file in which to save the key (/home/deploy/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/deploy/.ssh/id_rsa.
Your public key has been saved in /home/deploy/.ssh/id_rsa.pub.


Step-2 : If you wish to login to a machine called remotehost from localhost then we need to copy this key file to the remotehost.

## The following command will prompt you for the password once
## and copy the key file for you
ssh-copy-id -i ~/.ssh/id_rsa.pub user@remotehost

Great!! You are ready to go and login to the remote host from now onwards without entering your password again. You would need to repeat this password if you are logging from any other machine to remote host. This method is only local to login in from your system. Try doing the following now:-

ssh user@remotehost

Advance users can follow the Debian Guide for further information.

Thursday, October 07, 2010

Findings on using FlexMonster with Mondrian

Occasionally, you tend to stumble upon a tool which impresses you in the first glance itself. But mostly, these first impressions do not go that far. Recently, for a reporting module, I was looking at a lot of RIA libraries and came across FlexMonster.

FlexMonster is essentially a data visualization solution for any reporting and BI. It's main advantage is having out of the box support for Mondrian(ROLAP) and a Pivot component. Though Mondrian is essentially open source and comes without any cost, FlexMonster solutions costs you about $999 licence. This according to me is a very high price one would pay as compared to the open source alternatives available but some more work into this tool can justify the cost.

One can easily get jazzed by the online demo for FlexMonster but I seriously feel that they have couple of design flaws they need to think through. No doubt, it has a lot of potential to become one of the best OLAP viewers till date, but I am unsure about their development cycle and planned releases if any.

Pros:-

Have tried to lay down some of the things that were strikingly amazing in FlexMonster and made me to like it a lot.

1. Out of the box support for XMLA - This is a serious advantage which many of the other OLAP viewers do not have like JPivot.
2. Exposed as JS library - This makes it really really simple to be embedded into any web application (Python, PhP etc.).
3. UI design is very intuitive - Keeping into mind that most of the OLAP users love simplicity of the UI, it does a fairly good job.
4. Since based on flex, there are no cross browser issues.
5. General Pivot components like sorting/filtering etc. are all out of box.

Cons:-

Here comes the ugly picture that makes FlexMonster unusable for a lot of potential customers.

1. Flexmonster is essentially a Flex version of JPivot but does not do a complete job at it. It wins the race in Rich UI, but lacks a lot of features that JPivot has to offer out of the box for "Free".

2. Lacks MDX support - A lot of business users would want many features that can be taken out only via MDX. Though they claim on the main page of their website - "XMLA and MDX support for multidimensional data visualization".

3. Customization using parameters looks incomplete. For example:- setting the parameter to expand-all as on, it would expand by default on both rows and columns. I would certainly want either my rows or columns to be fully expanded and not the other one.

4. Drill down in charts is only available for CSV and not for OLAP.

5. Stores reports configurations in XML files. This makes embedding the flexmonster as a solution highly unusable in Large Scale data intensive business environments because clients might log in and try to save out their reports. For many businesses, the clients can vary from 100 to millions of customers. This essentially means million or more config files in worst case. Sounds like a bad design to me.

6. Since FlexMonster is reading the config from XML and creating MDX on the fly, their constructs of Rows and Columns should be much more extensive for Developers to user MDX constructs like Hierarchize and Lag etc.

Summing up, FlexMonster gave me a good feel at the first instance, but going ahead its limitations started overgrowing its benefits specially for a production data intensive system. I would love to use this tool again when it matures a bit.

Sunday, June 27, 2010

Changing Columns to Proper Case in MySQL - Using InitCap() function

MySQL String functions have lots of capabilities to manipulate the columns the way you wish to display. But apparently MySQL does not have any inbuilt function to convert the string to Proper Case. Some people understand this term as Sentence Case or Capitalized. However, on MySQL Dev site I found this amazing function which is worth quoting since it does exactly that.

DELIMITER $$
DROP FUNCTION IF EXISTS `initcap` $$
CREATE FUNCTION `initcap`(x char(30)) RETURNS char(30) CHARSET utf8
BEGIN
SET @str='';
SET @l_str='';
WHILE x REGEXP ' ' DO
    SELECT SUBSTRING_INDEX(x, ' ', 1) INTO @l_str;
    SELECT SUBSTRING(x, LOCATE(' ', x)+1) INTO x;
    SELECT CONCAT(@str, ' ', CONCAT(UPPER(SUBSTRING(@l_str,1,1)),LOWER(SUBSTRING(@l_str,2)))) INTO @str;
END WHILE;
RETURN LTRIM(CONCAT(@str, ' ', CONCAT(UPPER(SUBSTRING(x,1,1)),LOWER(SUBSTRING(x,2)))));
END $$
DELIMITER ;

Usage of this function would be as follows:-
- SELECT initcap('new delhi') returns "New Delhi"

Saving the article for my reference and for a lot of other people who might be looking for something similar.

Sunday, June 06, 2010

What this Blog is About!!!

Friends, welcome to my blog!! It has been really long time since I did any blogging. My last blog was way back in 2007 on one of my websites which I had shut down due to lack of time. But since very long I have felt a need to document a lot of things that interest me and put forward to the world my everyday learnings. As I keep on venturing more and more into various technologies, I keep stumbling across lots of challenges which are worth documenting for like minded people to come across and get the benefit.

People coming across this blog would mostly find the articles about Operating Systems (mostly Linux), HowTo's on various topics, Databases in general and Data Warehouse, Performance and Scalability of various Web Applications etc and lot of Design patterns revolving around various technologies. Hope you find the blog extremely useful!!!