The loophole:
Business Intelligence developers should sign an agreement of non disclosure.
I have written some posts about design and build your own BI infrastructure . Now when I’m getting a new assignment, we (my bosses :-) decided I had to replace my hardware with more professional irons.
The new Data Warehouse
I chose two servers from Dell, o ne PowerEdge R720 and one R720XD , both equipped with one Xeon ES-2609, 32GB 1600MHz RAM and 12TB RAID 6 SATA/Nearline SAS disk space ( I like oceans of space ).
I will use the R720 as a physical MySQL database server , and the R720XD will contain all other (virtual) servers. Going virtual is an architectural change I planned to do for a long time, but I never found the time. I rather would have used my custom build hardware, but the guys who decide decided otherwise. ‘Since you jump ship, we do not dare to use your old computers . We want proper servers.’ I do not know how the new infrastructure will perform but I got a hunch it will perform better than my now old irons. I will also go from 100MB network connections to gigabit, this will definitely speed up communications.
I just read Simon Mudd’s excellent post MYSQL 5.6 is out, so what is next? Simon put forth his wish list for MySQL 5.7. Well if Simon can wish so can I. First I think Simons wish list is a good one so I only want to add one wish. Parallel select processing of table partitions . Since my use of MySQL is Business Intelligence applications, I have some large (partitioned) tables that is read many times, so what I really want is faster select processing on large partitioned tables . Another option that could help speed up select on partitioned tables is global partitioned indexes i.e. the index is not partitioned. The MySQL 5.6 key cache support is something I will test out first thing when I have migrated to MySQL 5.6. What is holding me back from migrating is our somewhat odd MySQL setup. I have a MySQL replica in Japan, which I Rsync with our Master database. First I have to upgrade the Japanese replica and then upgrade the master. The problem is I do not know how to upgrade the Japanese MySQL server. It is an Ubuntu 12.04 LTS standard install, MySQL is the normal Ubuntu package and how to upgrade that from MySQL 5.5 to 5.6? I found this post , but I do not try this on a machine on the other side of the globe on a Linux I only installed once. I do not know Ubuntu procedures but I hope they issue a MySQL 5.6 package for 12.04 LTS. The master MYSQL is run on a Mandriva Linux server where I install MySQL RPM packages myself.
This morning I had this request from a user.
- I need a list of all materials in our plant with purchase prices. Can you fix that?
- Sure
select matnr, purch_price, currcd for materials
I sent the Excel by mail.
-But I need this for all products with quantity?
- You want a BOM exploded list?
- Yes
- Oki
select
a.product,a.component, a.qty, c.purch_price, c.currcd.
from bom_tree a inner join materials c
on a.component = c.matnr
order by a.product,a.component
I sent the Excel by mail.
-Hello again, I also need lotsize, can you add that
select
a.product,a.component, a.qty, c.lotsize, c.purch_price, c.currcd.
from bom_tree a inner join materials c
on a.component = c.matnr
order by a.product,a.component
I sent the Excel by mail.
- This is a nice report, but where is the price in swedish crowns?
- There is no price in swedish crowns.
- I also need the purchase price in swedish crowns using company year currency rate, can you add this?
- Shure
select
a.product,a.component, a.qty, c.lotsize, c.purch_price, c.currcd
,round(coalesce(c.purch_price * d.factor,0),2) as 'PRICE_IN_SEK'
from bom_tree a
inner join materials c on a.component = c.matnr
left join cur_rate d on d.f_currcd = c.currcd and d.t_currcd = 'SEK' and d.year = '2013' and d.ratetype = 'ACAB'
order by a.product,a.component
I sent the Excel by mail.
-Hello again, I like the report but I also need unit price. Can you add that?
-Yes
select
a.product,a.component, a.qty, c.lotsize, c.purch_price, c.currcd
,round(coalesce(c.purch_price * d.factor,0),2) as 'PRICE_IN_SEK'
,round(coalesce(c.purch_price * d.factor / c.lotsize,0),2) as 'UNIT_IN_SEK'
from bom_tree a
inner join materials c on a.component = c.matnr
left join cur_rate d on d.f_currcd = c.currcd and d.t_currcd = 'SEK' and d.year = '2013' and d.ratetype = 'ACAB'
order by a.product,a.component
I sent the Excel by mail.
- Hello, I really like the report, but I also need the description of the component. Can you add?
-Yes.
select
a.product,a.component, c.descr, a.qty, c.lotsize, c.purch_price, c.currcd
,round(coalesce(c.purch_price * d.factor,0),2) as 'PRICE_IN_SEK'
,round(coalesce(c.purch_price * d.factor / c.lotsize,0),2) as 'UNIT_IN_SEK'
from bom_tree a
inner join materials c on a.component = c.matnr
left join cur_rate d on d.f_currcd = c.currcd and d.t_currcd = 'SEK' and d.year = '2013' and d.ratetype = 'ACAB'
order by a.product,a.component
I sent the Excel by mail.
-Hello, now I only need the material overhead for the component?
-???
- If you look into transaction CK11 you find the overhead in there . Can you add it?
This is what I call BI ping pong , and it is not that bad. I’m playing this match now. We paused for the night, and the SQL in here is not the actual SQL but a slight transcription for clarity . It is iterative development by interaction and it’s fast. When the user contacted me we were not sure what he wanted, but now at least I have a pretty good idea. And we have not spent many minutes on the development. When I have figured out what the material overhead is, this user will come back and say - ‘I want to compare this report with the figures from last year’. And then we already have a very good, tested and working prototype for the OLAP app the user wanted without anyone of us knowing it from the beginning, (the user actually does not know this yet, but I will suggest a Qlikview app tomorrow).
The conventional (and boring) approach; start a project with lots of eventual users creating demand specifications etc. etc. will take longer time, cost more money and deliver a less satisfactory result.
Hardware is often neglected in applications design. In best cases you divide components of an application into separate servers, move the data to a separate SAN and add some extra RAM for performance and that’s it. The server infrastructure of applications is often well suited for transactional systems. Transactional systems do lot of random read/write of small chunks of data and very little processing on those small chunks.Business Intelligence systems on the other hand does not write very much, but reads a lot. Both reads and writes are mostly done in large chunks.
Since the middle of the nineties I have been interested in BI applications hardware infrastructure. My interest for hardware started with the spintronic revolution, I realized that hard disks (HDD) and memory RAM was going to be larger, faster and cheaper in future. HDD was the first in the spintronic wave. HDD had been too small, too slow and too expensive to allow for modern BI; with the SATA HDD we had cheap, fast and large HDD. The seek time (find the data to read or write) on these cheap SATA HDD is not impressive, so if you need to do lots of small random read/write it is not a wise choice. So the traditional servers still use expensive and small HDD with good seek time. These HDD are not very good for BI. BI are more interested in low transfer time (from disc into memory) than low seek time, and the SATA protocol can deliver more data than the discs can spin. More important SATA disks today are large, you can get 3 TB SATA disks for about 200€ and size matters for BI operations. SATA HDD are better suited for BI than more expensive and smaller HDD found in servers. Of course we will use Solid State Disks in a few years’ time, but still these disks are too expensive and too small for my liking .
Lots of RAM more than compensate for the slower SATA disks (compared with SAS and SSD), today you get 24GB SSD3 for about 300€. It is important to have enough of RAM to keep the active data set in memory to keep physical I/O low. Our BI database server needs 16GB to perform well. First day of the month I have noticed increased response times and some ‘peculiar’ MySQL behavior. I will install more memory and see if that helps. If not I have to find the root cause for the increased response times which most likely is missing or not good enough indexes. I still see recommendation about being careful with adding indexes. For BI systems this is wrong, wrong, wrong. You should sprinkle your database with indexes. All frequent queries should have optimized indexes. For the experienced DBA I recommend Relational Database Index Design and the Optimizers’ by Tapio Lahdenmaki and Mike Leach . This is serious, heavy and good reading about indexes. But I first try to mend performance problems with hardware, it is simpler to add RAM, than to analyze bottlenecks.
Processors today are so powerful any modern multicore processor will do just fine. I use high quality workstation motherboards. For my last database server I used an ASUS P9X79 DELUXE X79 S-2011 ATX motherboard for about 300€. It performs beautifully for our Business Intelligence system.
With such components it is an easy task to build high performance BI servers. I build the servers as simple as possible, this means I deliberately build them as single-point-of-failure. Simple server means few things that can crash and my servers are remarkably stable. The only things that have crashed so far are HDD raids and raid controllers (two times in eight years). Today disks are so big so we do not need to raid them anymore. Hardware development goes very fast; last year’s top notch hardware is ready for the scrap heap the next year. Using inexpensive servers give me the luxury to replace them more often. The normal lifetime for a server is three years and the life time cycle is test-production-backup-scrap heap. The database server I try to replace more often.
I’m aware of most experts do not approve of my ideas. But I created a working system after these ideas and it performs beautifully. I have put lots of efforts into my system; thinking, testing, measuring. More important than hardware is the database design. I have completely removed the traditional snowflake or whatever it is called design. The traditional BI database design patterns were conceived when hardware were expensive and disks were small. With today’s cheap hardware the old design patterns are a millstone around the BI system’s neck, we will see new simpler databases with more redundancies as in-memory computing becomes a reality. I should probably post about this, since I am an humble pioneer in this field.
This is how my ‘tin cans’ look 2012-12-23.