Sunday, April 7, 2013

The 3 Pillars of Data Democracy

In order to promote the use of data within the enterprise, we need to provide a collaborative environment which gives people the freedom and incentive to try new things.  This gives everyone the chance to prove great ideas, or at worst to fail quickly.  We may all understand the benefits of democratizing data, yet without an environment to foster that exploration it will remain just a great idea.  It is much like a unicorn.  We all know what it looks like, but no one has actually seen one.
Therefore I propose 3 pillars that are essential to encouraging this environment:
Searchable Metadata
We can provide a powerful framework for mining all sorts of data, but if users cannot inspect data elements easily from a trusted source, we will be perceived as unintuitive and difficult to use.
“Simplicity is the ultimate sophistication.” ? Leonardo da Vinci
Gallery
The gallery showcases works that others have done and springboards innovation by providing rapid provisioning of data.  Infographics and supporting worksheets can be linked into the gallery and tagged so that others may search for it.  Did someone already perform margin rate analysis?  Let’s go to the gallery first to find out.
If a person finds a relevant workbook, they can easily provisioning that insight for their own use.  This is a powerful feature that allows others to build upon and extend new insights without reinventing the wheel.
Gamification
We are wired to appreciate feedback loops.  We post on Facebook and Twitter not because we like to type, but we enjoy the recognition in the form of comments and followers.   As of 2011, the global video game market is valued at $65 billion.  People spend hours in front of a screen because it leverages their natural desire for competition, accomplishment, and status.  Adopting this mindset in our analytic platform not only encourages participation, but it gives us yet another set of metrics for self-assesment.  Which infographics are most accessed?  How many times is a worksheet copied for further analysis?  The ‘Like’ and ‘Friend’ button allows Facebook to catalog over a billion active user profiles – all to sell you stuff.

Friday, March 22, 2013

Thought of the day. Storing Confio detailed data in Hadoop?

If you manage a lot of Oracle, M$SQL, or DB2 - you need to check out Confio. Its an agent-less performance trending tool that will make you're life much easier.  It tracks every SQL run by user/client machine/sql statement/etc and trends those over time.
So I was listening to an IT security architect give an informative presentation on security and the topic came up about SQL injection and RDBMS security in general.  It got me to thinking: If an enterprise really wanted to keep tabs on all of the goings-on in their databases for forensic purposes, why not leverage Confio that is already pulling that data?
Confio typically aggregates that data up after 30 days - so there is plenty of time to snag it all and store it in HDFS.
You could even pull Teradata's dbc.qrylog while your at it.
Imagine knowing what SQL statements you ran 3+ years ago.  Cool.

Friday, February 8, 2013

HCatalog - Embrace the independence

Codd's Rule 9: Logical data independence:
Changes to the logical level (tables, columns, rows, and so on) must not require a change to an application based on the structure. Logical data independence is more difficult to achieve than physical data independence. (wiki)
This was a novel idea in 1970 and caused a lot of controversy.  Back in the day, your COBOL program was usually fired from some flavor of JCL.  So we had to point the DD (stdin/stdout) to a specfic location and dataset name 'manually' along with UNIT and VOL parms.
//TRGD12 JOB FOO,PLUMARIA
//STEP01 EXEC PGM=MYPROGRAM
//INDD DD DSN=TRGD56.DEMO.INPUT,DISP=SHR,UNIT=SYSDA
//OUTDD DD DSN=TRGD56.DEMO.OUTPUT,DISP=(NEW,CATLG),
// UNIT=AFF=INDD
Sorry for posting JCL on a Hadoop blog, don't judge my age.  And to the TSO brethren, I know: Cataloged datasets helped with this later on...
As we evolved our metastores we began to organize data logically by schemas and abstracted the physical location via TABLESPACES and FileGroups.  After awhile, we took this for granted while we pounded out our wonderful SQL.
But as the great philosophers, MATCHBOX 20 pondered:
Let's see how far we've come
Let's see how far we've come
Lets take a typical pig latin script that would do some ETL work:
A = load '/data/MDM/ds=20130101/bu=pd/property=cust' using PigStorage()
as (custid:chararray, name:chararray, addr:chararray, timestamp:long);
Ouch!  This way of working could become a maintenance nightmare with any of the following situations:
1. Compacting multiple files via HAR
2. Change in compression method
3. Schema changes from data producer
4. Moving data location
If the variety of your schemas is limited, this probably is easy to manage.  However, most enterprise environments will be anything but limited.  This is also compounded by users with different data tools accessing Hadoop and sharing the same data.  Soon your cluster becomes very brittle.  Whats a data alchemist to do?
HCatalog to the rescue!  This Apache subproject comes primarily from Yahoo and appears to be a big part of Hortonworks bag of tricks for organizing data.  Basically HCatalog extends the Hive metastore and, based on the contributors, has been a collaborative effort between members from the Apache Pig, Hive, and Hadoop projects
Per the wiki:
Apache HCatalog is a table and storage management service for data created using Apache Hadoop.
This includes:
Providing a shared schema and data type mechanism.
Providing a table abstraction so that users need not be concerned with where or how their data is stored.
Providing interoperability across data processing tools such as Pig, Map Reduce, and Hive.
The pig example above would now look like:
A = load 'MDM' using HCatLoader();
B = filter A by ds='20130101' and bu='pd' and property='cust';
...

Much better.  If we relocate the files that store MDM, or switch to a better storage format, the Pig Latin script does not change at all.  This is the same for MR and Hive.  Also notice that the shema is not specified, HCatLoader automagically tells that to Pig and converts the shema to the appropriate pig datatypes.
HCatalog also leverages Hive's DML so we can create and drop tables, specify table parameters, etc.  This will give us a great way to manage our metadata.  I'm also curious how we can extend HCatalog from an audit standpoint to keep track of who,what,where,when datasets are touched.
This is another dot connected for me.  I ranted about this a bit in a prior post: Confessions of a data architect where I argued the limited capabilities of HDFS from a data organization stanpdoint.  In a way, this also answers another looming question:  where should we store metadata?  This solution depends on Postgres... interesting.
Check out this video from Hortonworks on Hcat,

Saturday, January 26, 2013

Why Enterprise Hadoop is different than Web Hadoop.

Bringing the power of Hadoop to the enterprise is a tricky matter.  While we all know the wonderful virtues of distributed storage and compute and how it's solving Big Data problems in the web world, it is entirely a different matter when dealing with the challenges of a large enterprise.

I’m actually somewhat envious of some company’s laser-beam approach to Big Data.  Most of these environments are challenged with volume & velocity.  Our focus leans more towards variety.  Our ETL team currently has over 5,000 unique workflows.  Many of these products are redundant, useless, and pathetic attempts of moving data by myopic projects over time.  Ineffective MDM and data modeling practices have also fed this beast over the years.  I’m not suggesting that we move all of these over to Hadoop day one, but the writing is on the wall that at some point we will run into the same mess if we’re not careful.
How does one manage this variety of unique data sources?  We’re looking at various options of Talend and custom code to allow us to manage this.  This will evolve over time, but we’re trying to look ahead.
So what do you use to manage your data ingest & emit?

Monday, December 10, 2012

My name is Jeff Graham and I'm a data modeler.  It's been 6 weeks since my last star-schema.
Lets face it.  Codd, Imhoff, Inmon, and Kimball paved the way for almost every data analyst and app-dev professional since the relational model worked its way into corporate data centers.  We cried, learned, and laughed as crazy ideas like data warehousing and dimensional modeling became part of our lexicon.  My kids are well fed and have the latest shoes thanks to these data architects (actually I owe more to the foolish and lazy who didn't employ quality in their database design; thx for the consulting $s!).
As a 14 year veteran of RDBMS performance tuning, I was a staunch defender of the relational model.  A few years ago, I found myself running into hurdles as the 3 V's (Volume, Velocity, Variety) started to shake my belief system.  At first the problem would manifest itself in small ways and we found ways to overcome by partitioning, faster hardware, etc.  I would start to question my skills as ever-growing informational pressure caused designs to fail.  Based on historical results, the problems I faced were a direct result of a poor data model.  It took a look of honest questioning and the death of many sacred cows to accept a new way of thinking.  Any data architect worth their salt should step aside from the past and look forward.
But we can't forget ALL of the lessons learned.  While the way we store and manipulate data may change, the ability to control and regulate it in a multitenant datastore will be just as important.  These concepts must persist if Hadoop is to be accepted just like the relational databases of the past.  Therefore I propose the following qualities that must continue in our brave new world .
Organization
Organization is highly subjective and use case specific.  In Hadoop, we can use directory structures to organize data by business unit, by stage in lifecycle (new vs. old, hot versus cold, raw versus derived), or other concerns.  I’ll have to be honest, it took me a little while to absorb this because somehow it seems completely natural to experienced Hadoop developers (aka app-dev people), but it leaves a big hole in the heart of a DBA.  A good DBA hearts metadata – that’s how they carve up access and do stuff.  An old DBA hearts metadata about metadata – and perhaps a few backups of the metadata.
Now all I have is HDFS, which is really just a filesystem with basic unix security.  So directories ARE my metadata.  Hmmm.  I see a metastore in our future that will allow us to map a directory structure to more metadata.  DBA_TABLES anyones?
Space Quotas
Storage control, especially in multitenant environments will be a huge concern.  Just like organization, having data bucketed by directory is also what gives you control over quotas (note: create another post about the small-filesize quota snafu).
Partitioning
Finally, tools like Hive understand partition pruning during query execution. Each partition is simply a directory with a special naming convention that indicates the range of the table to which the contained data belongs.  Tools other than Hive can similar partition pruning by simply only including the directories that are known to contain data of interest.
Partitioning will also facilitate data removal.  Although the mantra of Hadoop is to store everything forever because there might be value later, there is the occasional contractual or legal requirement to do so.

OK.  So what does this all wind up looking like?  Here is a straw dog (just for you Jeff B) :
/data : Contains raw data sets ingested from other systems. Read only to users.
/user/<username> : Home directories / scratch pads for users.
/Dbay : Contains ETL process queue directories
/tmp : Sticky-bit set scratch for tools and users (no guarantee on longevity).

/data and /DBay are the interesting ones.

/data/<dataset name>/<optional partitions>
Where <dataset name> is the equivalent of a table name in an RDBMS. Data sets may be partitioned by N columns, but that's optional and use case dependent.
Ex: Partitioned clickstream data by day.
/data/clickstream/date=20120101/{x.dat,y.dat,z.dat}
/data/clickstream/date=20120102/{x.dat,y.dat,z.dat}

/Dbay/<group>/<application>/<process>/{incoming,working,complete,failed}
Where <group> is the line of business / group (research, search quality, fraud analysis), <application> is the name of the application the process supports, and <process> is for applications that have multiple processing stages. Each process "queue" has four state directories:
incoming: newly arriving files drop off here. A process atomically renames them into a temp directory under working to indicate they're in progress (and so overlapping processes don't steal them).
working: Contains a timestamped directory for each attempt at processing the files. Files in these directories older than X require human intervention. Monitor for this.
complete: After a Dbay process finish processing a file in working, this is where it lands.
failed: If a Dbay process decides to permanently reject a file (and ask for a human to look at it), it moves it here. If the directory contains > 0 files, it requires human intervention.
This is a complex issue that often gets overlooked and creates a bit of angst for a recovering DBA who is used to a mature datastore . It's effectively the shared filesystem version of data modeling.
I was using HMC 1.0 to install and configure a hadoop test cluster.  I wanted to make some changes to /usr/lib/hadoop/conf because the property that I needed to change is not exposed via Manage Services Map Reduce in HMC.  I tried to make a manual change to mapred-site.xml and then push the file to all the servers.  However, when I restarted Hadoop cluster via HMC, the changes that I made to mapred-site.xml were overridden.
What gives?
HMC manages node configuration by using Puppet in the background, so any changes done outside of HMC revert back to the HMC known configuration.  So the moral of the story is if you want to change any /conf properties on your own, don't use HMC to cycle mapred.
On the jobtracker node:
$ bin/stop-mapred.sh
$ bin/start-mapred.sh