Data lake vs data warehouse

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
I work at a startup and our data is very messy at the moment, as you might imagine. We have a few product level transactional databases, but no central database to store it all in a useful way for analytical/reporting purposes.

There's been this effort underway for the past ~2 years to build a data lake, but it appears to have somewhat stranded, and there doesn't seem to be anyone really owning it and driving it forward at the moment. But not having a central data store of some sort is really hampering the company's ability to generate good insights and have reliable reporting (there are now multiple sources of the truth, so no one is really sure which truth is the right one).

I've been thinking about launching an initiative to scrap the whole data lake and just build a good data warehouse (of course, easier said than done). My brother is a long-time BI consultant and he always tells me that most companies that think they need a data lake don't really need one, they just need a good data warehouse. Most companies don't have a good usecase for a data lake, it's just the "trendy" thing to do at the moment. He said he's seen a few companies he consults with backtrack on data lakes they've built, in some cases scrapping it altogether.

What are people's thoughts and experiences here on data lakes vs data warehouses?
 

fitten

Ars Legatus Legionis
55,639
Subscriptor++
A data lake isn't the same as a data warehouse and vice versa. The easy thing to do, IMO, is to evaluate whether what you want to do is one or the other and then proceeding from there. Just looking at the basic definitions for each should help narrow it down. For example, if what you want to do is to store data from all kinds of sources in raw formats (images, video, sound recordings, tabular data, etc.) and aggregate all of these data sources into some number of warehouses for reporting, then you want a lake. If what you want to do is to store sales data that has been cleaned (addresses, for example) and processed (normalized, etc.) for reporting sales data by day/week/month/quarter/year, then you want a warehouse.

IME, sometimes a data lake is chosen to kick the can further down the timeline as to what it will be used for (and to say "hey, we have a data lake, which is the trend!"). The idea is that they'll throw everything, including the kitchen sink, into the lake with the idea that they will eventually figure out what to do with all of it (A Few Months Down The Road™) and it'll all be magical. Usually, there is some idea about some kind of reporting that needs to be done but the reporting hasn't been designed/finalized yet, or maybe there are a few reports they want but they want to be "future proof" so that's a way to say "we'll be ready when we get there" (they won't be). Frequently, what they need is some number of already defined reports (frequently, reports they're already using, it's just a lot of work to make them because they have to pull from multiple sources, etc. and probably do with Excel) which would really be one or more warehouses.

That's not to say that there aren't legit cases for data lakes. I just think they are typically overkill and/or "future proofing" and/or stalling, particularly when a group doesn't have a specific set of defined reasons to use one.
 

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
A data lake isn't the same as a data warehouse and vice versa. The easy thing to do, IMO, is to evaluate whether what you want to do is one or the other and then proceeding from there. Just looking at the basic definitions for each should help narrow it down. For example, if what you want to do is to store data from all kinds of sources in raw formats (images, video, sound recordings, tabular data, etc.) and aggregate all of these data sources into some number of warehouses for reporting, then you want a lake. If what you want to do is to store sales data that has been cleaned (addresses, for example) and processed (normalized, etc.) for reporting sales data by day/week/month/quarter/year, then you want a warehouse.

IME, sometimes a data lake is chosen to kick the can further down the timeline as to what it will be used for (and to say "hey, we have a data lake, which is the trend!"). The idea is that they'll throw everything, including the kitchen sink, into the lake with the idea that they will eventually figure out what to do with all of it (A Few Months Down The Road™) and it'll all be magical. Usually, there is some idea about some kind of reporting that needs to be done but the reporting hasn't been designed/finalized yet, or maybe there are a few reports they want but they want to be "future proof" so that's a way to say "we'll be ready when we get there" (they won't be). Frequently, what they need is some number of already defined reports (frequently, reports they're already using, it's just a lot of work to make them because they have to pull from multiple sources, etc. and probably do with Excel) which would really be one or more warehouses.

That's not to say that there aren't legit cases for data lakes. I just think they are typically overkill and/or "future proofing" and/or stalling, particularly when a group doesn't have a specific set of defined reasons to use one.
It's pretty clear to me after talking to a few people that our data lake is of the "let's kick the can down the road variety, but show that we're doing something". There's no strategy in place to clean the data and put it into a well governed data warehouse where the data is cleaned and organized.

The goal is to have all our data copied into the data lake by end of Q2 (but they've been saying that for 2 years now - the previous guy leading that effort was kicked out end of last year).

Alright, I'll continue working out my data warehouse initiative, as the data lake doesn't really solve any of the problems we have. We lack good organized data. We have no way of uniquely identifying our customers across systems (Salesforce has one set of customers and identifiers, our transactional databases each have their own set of identifiers. Matching data is a nightmare here). And every Tableau dashboard that's been built by various teams shows different results for the same customer. It's really bad.

Before I joined this startup I ran a small BI team at a Fortune 500 company. I've seen what a good data warehouse looks like, and I want to create that here.
 

Ardax

Ars Legatus Legionis
19,795
Subscriptor
We have no way of uniquely identifying our customers across systems (Salesforce has one set of customers and identifiers, our transactional databases each have their own set of identifiers. Matching data is a nightmare here).
Oh. This sounds familiar. Add in multiple 3rd parties that also each have subsets of customers with different identifiers and now it's started to sound like where I work.
 

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
Oh. This sounds familiar. Add in multiple 3rd parties that also each have subsets of customers with different identifiers and now it's started to sound like where I work.
Yeah, I'm gonna try to convince the CTO to do something about it. And happy to do it myself if they'll give me the resources.
 
  • Like
Reactions: Ardax

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
You might have to make a surrogate key. Being able to identify (what is) the same identity record among the multiple sources in order to attach them to the surrogate may be tricky, of course.
I think the best solution will be to assign a customer ID of some sort during the onboarding process, so before data enters the system. Of course this will require a bunch of process changes and buy-in from Product. It'll be an uphill battle, and it'll also cost money.

The other approach is closer to what you're suggesting, but essentially just ETL everything into a data warehouse and there assign a unique ID. But it'll require some manual data scrubbing each time a batch job is run to make sure we're not duplicating customers. And that would sort of defeat the purpose of automating things. You can create some logic around it, but it'll never be 100% perfect, so you just end up creating another manual process somewhere else.
 

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
We're a B2B company and we sometimes onboard clients (we call them Partners) who onboard their own clients directly into our system. So we have a mix of data where we will have a whole bunch of clients that belong to one of our B2B partners, and others who don't onboard their own clients and just do business directly with us.

But I'm envisioning something like this (very very rough draft):

1681942191866.png
 
Last edited:

fitten

Ars Legatus Legionis
55,639
Subscriptor++
Yeah, what I was thinking is that the surrogate key exists in your warehouse(s). When you ETL from the source system, a part of that would be matching the incoming data to the warehouse data and either retrieving the surrogate key on a match or creating a new one if not matched. One way I was thinking would be a bridge type table that has one column your surrogate key (say a new GUID) and the other columns would be the equivalent key in each other source (like what you picture there). Then for reporting or whatever, you'd ultimately join stuff through this bridge table to connect data in the various sources. But you're right... it can be done automatically but you'd have to also put checks in to alert you for anything that doesn't look right... you'll want to know when anything other than "match definitely found" happens so you can check it out (manually or something... if you have lots of customers and lots of new customers each ETL, that may not be feasible to do manually). You'd definitely have to clean data before you inserted so you have the best chance of matching on lookup. And then, you need to also make sure you have in mind an easy way to consolidate records... if you find two records are really the same customer, you need to consolidate them easily/quickly... like a deduping technique or something.
 

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
Yeah, what I was thinking is that the surrogate key exists in your warehouse(s). When you ETL from the source system, a part of that would be matching the incoming data to the warehouse data and either retrieving the surrogate key on a match or creating a new one if not matched. One way I was thinking would be a bridge type table that has one column your surrogate key (say a new GUID) and the other columns would be the equivalent key in each other source (like what you picture there). Then for reporting or whatever, you'd ultimately join stuff through this bridge table to connect data in the various sources. But you're right... it can be done automatically but you'd have to also put checks in to alert you for anything that doesn't look right... you'll want to know when anything other than "match definitely found" happens so you can check it out (manually or something... if you have lots of customers and lots of new customers each ETL, that may not be feasible to do manually). You'd definitely have to clean data before you inserted so you have the best chance of matching on lookup. And then, you need to also make sure you have in mind an easy way to consolidate records... if you find two records are really the same customer, you need to consolidate them easily/quickly... like a deduping technique or something.
Yeah, agreed. I first want to see if I can get senior leadership onboard with this plan before I start thinking about it too much. But for now I'm spending enough time thinking on it so I can have strong arguments and some high-level ideas when I get questions about it. I'm really in Finance/FP&A, but I also did BI at my previous job so I have strong opinions on what I want here. But the most likely outcome is that they'll tell me to buzz off and to focus on my numbers :) And I really really want to build this, or have it built, just to make my own life easier :)

All I know is that none of this is on any roadmap right now. They're just attempting to dump everything into a data lake right now (Amazon S3, if I'm not mistaken). And it should be on a roadmap and prioritized. This company also wants to IPO in the next few years, so getting our data in order should be a priority. We struggle to answer basic questions from investors right now as our data is so bad, and every analyst will give a different answer.

When they come to me with questions, my first question in return is always "when do you need this?". If they say today, I'll often say, "sorry, no can do, I need more time to scrub the data before I can use it - I can provide out this other stuff I've done previously that sorta half answers your question?". In my previous job, it was usually, "sure, let me run a quick query and validate the results, and I'll send it over". And that should be the ideal end state.
 

Lt_Storm

Ars Tribunus Angusticlavius
21,364
Subscriptor++
We're a B2B company and we sometimes onboard clients (we call them Partners) who onboard their own clients directly into our system. So we have a mix of data where we will have a whole bunch of clients that belong to one of our B2B partners, and others who don't onboard their own clients and just do business directly with us.

But I'm envisioning something like this (very very rough draft):

View attachment 54726
One potential issue with all this: if you have clients onboarding clients, is there some kind of security concern related to that? I mean, it wouldn't surprise me if someone who is onboarding their clients expects / requires confidentiality on who their clients are. And, if you have agreed to offer this, then the whole "data lake with our data and client's data" thing could be a real problem.
 

sakete

Ars Scholae Palatinae
1,198
Subscriptor++
One potential issue with all this: if you have clients onboarding clients, is there some kind of security concern related to that? I mean, it wouldn't surprise me if someone who is onboarding their clients expects / requires confidentiality on who their clients are. And, if you have agreed to offer this, then the whole "data lake with our data and client's data" thing could be a real problem.
I over simplified when I said that. Our partners don't have direct access to our systems. It's just in some cases their clients will appear in our system as well depending on the type of agreement we have with the partner. But we are technically doing the onboarding still.

We're a fintech company so have all kinds of compliance stuff we need to, ehh, comply with :)
 
  • Like
Reactions: AndrewZ

AndrewZ

Ars Legatus Legionis
11,860
I worked in the large data group of a large company for several years. Data from the production DBs were ETL'd with Informatica into one of several different data warehouses. We did Oracle but the cost for that is brutal. I'm pretty sure there are cheap cloud options for this now. We had a large team of data stewards who documented and curated the data going into warehouses. We had to be sure that important data was correctly calculated, and not duplicated. Data coming out through reports had to be approved through a ticketed change process. Production data has legal privacy concerns and can't be handed out willy nilly, but is vital for executive decision making.

TL;DR - streamline your data in, streamline your data out, involve your data architects, build a viable end to end process.
 

grommit!

Ars Legatus Legionis
21,096
Subscriptor
I think both are needed. A data lake as a central store and a data warehouse with high quality data for reporting and analytics. But if you only had to pick one, probably a data warehouse.
FYI, you are quoting a spammer. They post something innocuous, then edit in a link a few days later - as you can see from their post history.
 
  • Like
Reactions: sakete