598 points · by tosh · 9y ago · 352 comments
I think my favorite example, was a team that spent six months trying to build a system to take in files, parse them, and store them. Files came through a little less than one per second, which translated to about 100kb. This translated to about 2.5Gb a day of data. The data only needed to be stored for a year, and could easily be compressed.
They felt the need to setup a cluster, with 1Tb of RAM to handle processing the documents, they had a 25 Kafka instances, etc. It was just insane.
I just pulled out a python script, and combine that with Postgres and within an afternoon I had completed the project (albeit not production ready). This is so typical within companies it makes me gag. They were easily spending $100k a month just on infrastructure, my solution cost ~$400 ($1200 with replication).
The sad part, is that convincing management to use my solution was the hardest part. Basically, I had to explain how my system was more robust, faster, cheaper, etc. Even side-by-side comparisons didn't seem to convince them, they just felt the other solution was better some how... Eventually, I convinced them, after about a month of debates, and an endless stream of proof.
You were saving the company money but hurting their resumes.
I recently wrote about this. The TLDR is that 20% time is a great investment and can ultimately save the company a ton of time and money. It gives the engineers some playtime in order to build their CV's and "get their wiggles out". Ultimately, if done right it can protect your production systems from a lot of madness. https://hvops.com/articles/how-to-keep-passion-from-hugging-...
The message could be that the goal is about the destination not the journey.
Basically, they are looking for web developers but it seems like they have to filter out all the frontend ninja rockstars.
Not everything should build their resume, but some of it has to. It's one of my arguments for buy over build.
To take it a step further, Management has to own up to their original failure and try to explain to their bosses how they could spend so much time and money unnecessarily.
Another psychological problem here is the perception by people who do not understand the technology that the higher priced solution is better because it costs more.
- Monty Python, Meaning of Life
Plus people jump on fads, big data is trendy right now and when you read and hear about something a lot your mind tends to go to it first.
Suppose management in a firm uncritically contracted the big data revolution meme. Then they believe they are in the position of a city mayor trying to build a bridge and some wiseacre comes along and says they can do it in an afternoon with two pieces of string and a stick of gum. The problem is that the analogy doesn't hold, but they don't know that.
Dick move but so is rejecting an objectively better solution to save one's own middle management ass.
The grandparent is correct. This is 100% a political problem. We have a bad habit of discounting such problems in tech. We shouldn't do that anymore. Life is much better when you cooperate, instead of fighting an uphill battle.
Compact, reasonable solutions are the domain of startups. Bloating the engineering layer beyond any reasonable limit is an inherent cost of growing the company, and we shouldn't try to counteract that. We must operate within the framework we're given.
The political concerns extend beyond the company's own internals. They must appear enterprisey if they expect to be treated enterprisey. Today, enterprises have "data science" departments and blow $100k/mo on useless crap. If they're not doing that, it's a liability for the whole company, not just from the petty territorial perspective of one individual. It doesn't matter that it's possible to accomplish the same thing with one one-hundredth of the monthly expense. The enterprise signaling is worth the cost.
Welcome to the land of engineering, where we will fine-tune an algorithm to save milliseconds, yet waste man-years of engineering time to look like the big kids.
So many engineering choices are based on fashion rather than need.
Gotta get that hot new bag from Prada to show off to your engineering friends! :D
If companies were serious about providing realistic advancement opportunities (in salary, in tech, in responsibility) there wouldn't be as much of an impulse to work on "cool" (i.e., marketable) projects.
Many dev jobs can be accomplished by pretty tried and true technology. For a startup and even most mid sized companies, MySQL and a web framework will get you pretty much everything you need. But any kid a year out of school can do that. So those positions are not really well paid, certainly not enough for a family in the Bay Area.
To become a mid-level engineer and make more money, you've got to implement some kind of complicated distributed system. Incorrectly. And then you can "fix" it (or someone else's) to get the next promotion!
This is stylized and not 100% true to reality, but I think it gets at a core truth.
They were 6 months in and made no progress other than building 30 servers. I wrote an awk script to process the CSVs and did the rest in Excel in about 30 minutes. I had an intern automate the process with a perl script, which took 3-4 days! :)
The program management was very upset, mostly because they looked like a pack of clowns.
I work with a start up which currently doesn't have "big data", but perhaps "medium data". And, I can perhaps manage without a big data stack in production. But, if I look at the company/sales targets then in the next 6-12 months we will be working with clients that assures "big data".
Now, here are my choices - 1. Stick to python scripts and/or large aws instances because it works for now. If the sales team closes deals in the next few months after working tirelessly for months, then though the sales team sold the client a great solution, but in reality we can't scale and we fail. 2. Plan for your start up to succeed, plan according to the company targets. Try and strike a balance for your production stack that isn't an huge overkill now but isn't under planned/worked either.
It's easy to say we shouldn't use big data stack till we have big data, but its too late (specially for a startup) to start building a big data stack after you have big data.
Why? Because your problem is not technical, it is business related. You have no idea why your startup will fail or why you will need to pivot. Because if you did, it wouldn't be a startup. Or you would have had that client already.
You might need to throw away your solution because it is not solving the right problem. Actually, it is almost certain that it is solving a problem nobody is prepared to pay for. So stick to Python until people start throwing money at you - because you don't have a product-market fit yet. And your fancy Big Data solution will be worth nothing, because it will be so damn impossible to adapt it to new requirements.
I wish I could send this comment back in time to myself... :-/ But since I can't, how about at least you learn from my mistakes and not yours?
EDIT: good luck!
With tools like message queues and Docker making it so easy to scale horizontally you don't even have to go vertically.
We just won an industry award at work for a multi billion data point spatial analysis project that was all done with Python scripts + Docker on EC2 and PostgreSQL/PostGIS on RDS. A consultant was working in parallel with Hadoop etc and we kept up just fine. Use what works not what is "best".
Edit: A dumbed down version of the Python/Docker piece for anyone interested (https://medium.com/@mbaker/horizontally-scaling-gis-python-a...). It's really easy to scale horizontally with Docker...
But yes, scaling up is far easier than scaling out. A box with 72 cores and 1.5TB of DRAM can be had for around $50k these days. I think it would take a startup a while to outgrow that.
IMO the answer is almost always "good enough". This has been expressed in countless tropes/principles from many wise people, like KISS (Keep It Simple Stupid), YAGNI (You Ain't Gonna Need It), "pre-optimization is the root of all evil", etc.
If you go the YAGNI route, and when your lack of scale comes back to bite you (a happy problem to have), you'll have hard data about what exactly needs to be scaled, and you'll build a much better system. Otherwise, you'll dig deeper into the pre-optimization rabbit-hole of hypotheticals, and in that case, it's turtles all the way down (to use another trope).
Be mindful of people looking to introduce big data without justification. They are playing a game of some sort (maybe just personal resume value, or maybe a larger vie for power), and you are positioning yourself as their opponent when you try to stop the proposal they're pushing. Do not go into this naively.
Successful people have BMWs. If I buy a BMW that means I'm successful.
No, son, it doesn't.
For that particular task I used Spark in standalone mode on a single node with 40 cores, so I don't consider it Big Data. But I think it does illustrate that you don't have to have a massive dataset to benefit from some of these tools -- and you don't even need to have a cluster.
I think Spark is a bit unique in the "big data" toolset, though, in that it's far more flexible than most big data tools, far more performant, solves a fairly wide variety of problems (including streaming and ML), and the overhead of setting it up on a single node is very low and yet it can still be useful due to the amount of parallelism it offers. It's also a beast at working with Apache Parquet format.
Hadoop and Cassandra lend themselves to distributed nodes, but you can also use them without that. Or you can use solutions that work well with "big data" that aren't as opinionated about it, such as HDF5.
I guess the point is this: if I have 20TB of timeseries data on a single machine, and I have 20GB incoming each day, do I get to say I'm working with "big data" yet?
EDIT: My other complaint with this definition (perspective, really) is that it predisposes you to choose distributed solutions when you really do have "big data", which is not ideal for all workflows.
Small data: fits in memory Medium data: fits on disk Big data: fits on multiple disks
I've yet to come up with a rule of thumb for throughput though, and this can never replace the expertise of an experienced, domain knowledgeable engineering team. As always, there are lots of things to balance, including cost, time to implement and the now Vs the near future. Rules of thumb over simplify, but also give you a way to discuss different solutions without coming over as one size fits all.
1. What's your tech stack?
2. Why?
This blatantly disqualifies ~90% of startups which are doing crazy things like using Hadoop for 10gb of data. OTOH, I get really impressed when someone describes effectively using "old" technologies for large amounts of data, or can pinpoint precisely why they use something with reasons other than data size. One good example: "We use Kafka because having a centralized difference log is the best way we've found for several different data stores to read from one source of truth, and we started doing this years ago. If we were starting today, we might use Kinesis on AWS, but the benefits are small compared to the amount of specific infrastructure we've built at this point."
Consider your programmer that goes to a 'big data' class and is taught how to use the stack. They are taught this generally on a 'toy' application because it would take to long to set up a real application. They are there to learn the stack, so they either ignore or get only lip service to the 'when would this be appropriate' slide. Now they come back to work and they know the recipe for using this big data stack.
The boss gives them their task, they apply their recipe, and voila, they have a solution. All win right?
If it is any consolation the type of engineering situation you are experiencing does (in my experience at least) eventually correct with the manager being moved out.
>> That doesn't necessarily mean people don't use Kafka for the wrong reason.
Exactly what I meant.
Nevertheless, the case from above is a very extreme case of over engineering and premature optimization. To the limit where would qualify it as reckless.
See here for details: https://www.confluent.io/blog/turning-the-database-inside-ou...
The big-data/"cognitive computing" unit of the company would have suggested using Hadoop, Kafka, IBM Watson , AI , neural networks and lots of billable man-hours to match my solution. They even looked interested in making and aquisition for a company with an event processing engine that did basically the same: pipe stuff trough processes.
I recommend reading Event Processing in Action and then just building the same with your favourite pub/sub toolchain.
But then you come across the 1% case and Kafka is the only thing that you can throw at the problem that works.
Not sure of exact numbers, but I think we're doing 4-5m writes per second across one Kafka cluster, and around 1m writes per second against another.
Most people don't have big data, but some people do.
I'm not saying that's the case with your system, but my immediate thought when I see those numbers is: how much of the value from those 4m/s writes could you get with a system that did something like 100 w/s? Either through sampling/statistical methods, reduce "write amplification" or simply looking hard at what is written and how often :-)
Many databases that I regularly touch would shrink an order of magnitude or more if someone went through, redid the layout, and scripted a process to perform the migration.
https://www.confluent.io/blog/turning-the-database-inside-ou...
https://www.confluent.io/blog/apache-kafka-samza-and-the-uni...
Some very interesting architectural ideas in there. In particular, the observation that if you turn off history pruning in Kafka, you have a consistent distributed log, which can then be piped off into whatever services need to consume it. That's appealing for cases where you want an audit trail, for example.
Do most systems require that sort of thing? Absolutely not. RabbitMQ is boring tech, in the good sense; it is well understood and does its job, so IMO it's a better default option where it fits.
My (biased, as I work for them) opinion is that something like Pachyderm (http://pachyderm.io/) will ease some of these struggles. The philosophy of those who work on this open source project is that data people should be able to use the tooling and frameworks they like/need and be able to push there analyses to production pipelines without re-writing, lots of frictions, or worrying about things like data sharding and parallelism.
For example, in Pachyderm you can create a nice, simple Python/R script that is single threaded and runs nicely on your laptop. You can then put the exact same script into pachyderm and run it in a distributed way across many workers on a cluster. Thus, keeping your code simple and approachable, while still allowing people to push things into infrastructure and create value.
A full on hadoop stack is rarely warranted, but I can understand the reasoning behind wanting a flexible enough processing capacity to accommodate any anticipated load regardless of frequency.
So there is still a good argument to be made for developing the Minimum Viable Product in whatever technologies are most productive for your developers, and figure out how to scale as you grow.
It's a difficult balancing act.
There are an awful lot of problems that can be solved with a simple Postgres instance running on RDS.
When the BizTalk implementation broke down and I first needed to look into how it worked and what it did, I found that it just moved a small XML file to an SFTP server and wrote a log entry. So I replaced the entire setup with 50 lines of C#. Luckily my boss was onboard, arguing that we didn't really have the qualifications to do BizTalk.
The idea had originally been that the customer, a harbour, would in the long run need to do a ton of data exchanges with the government organisations and shipping companies. The thing is that they where planing for a future that never really happened.
I was almost too stunned to answer. Their solution, was not to just use something more efficient, or even to just rent a single, more powerful EC2 instance or something, but to go to the effort of setting up and running a cluster. The dataset wasn't even that big: a few gb on disk.
And Spark is usually much more efficient than R or Python (and gives you a nicer language to work with IMO, though that's very subjective). It's entirely possible a 1-node cluster would have outperformed your non-cluster approach, and while a 1-node cluster seems stupid it's useful if you know you're eventually going to have to scale, because it ensures that you test your scalability assumptions and don't embed any non-distributable steps into your logic.
I cant use a static HTML plugin called head, because port 9200 was already taken and site plugins were disabled.
Wanna use head plugin? Install 300 megabytes docker image and setup CORS.
There are two problems here - one is that people prototype their architecture using massively over-engineered systems and the second is that a rough prototype makes it way into production.
So, as a Hadoop perf engineer, I deal with both issues - "We have a Kafka stream hooked up to a Storm pipeline and it is always breaking and we can't debug ... what is this shit?" or "Postgres is stuck on BYTEA vaccuum loops and you can fix it with Hadoop, right?".
There are significant advantages in prototyping with an easy to debug architecture, until all the business requirements stabilize.
Sometimes the right answer is to use Postgres better (specifically, table inheritance for deletion of old data + indexes instead of delete from with <=), sometimes the right answer is a big data system designed for cold data storage & deep scans.
This all comes back to the "We made a plan, now it is a death march" problem - the iterative failure process of building a prototype and having it actually fail is very important, but most people feel like they'll get fired if their work fails in the real world.
Over-engineering is usually career insulation and somewhat defense against an architecture council.
Never got an email back.
I just flat out told him I didn't want anything to do with that kind of project and asked to be shown the exit.
I have run a SQL database on a USB disk with the same data without problems but some people are just attached to the idea of "big data" so Hadoop it.
Also compressing doesn't go well with ad hoc analysis.
Sounds like maybe a Hadoop setup is not the worst idea to be ready for the future.
The industry standard is ~100-200 debugged lines of code a day. (If your team tracks hours, look this up on a big project; taking into account all the hours one spends, not just coding.)
So your claim, being generous, is this team spent 6 months to not produce the equivalent of 100 lines of code? Even if completely true, this comes off as a humblebrag.
At the beginning of my current project, I had a job that involved 35T of input, but the vast majority of records would be ignored, and then for each successful one, only a few hundred bytes of output would be generated. Rather than Hadoop, I setup a simple system where a number of worker processes would query Postgres for the next available shard, mark it as in-progress, and then stream it from S3 and process it. When they finished, they'd write a CSV file back to S3. The reduce phase was just 'cat'.
The resulting system took a few hours to build (few days, including the actual algorithms run), and it was much more debuggable than Hadoop would be. You could inspect exactly where the job was, what shards had errored out, and which were currently running on machines, and download & view intermediate results before the whole computation finished. You could run the workers locally on a MBP if you needed to debug a shard, with no setup needed.
When I was at Google, we had a saying that "The only interesting part of MapReduce is the phase that's not in the name: the Shuffle". [That's the phase where the outputs of the Map are sorted, written to the filesystem and eventually network, and delivered to the appropriate Reduce shard.] If you don't need a shuffle phase - either because you have no reducer, your reduce input is small enough to fit on one machine, or your reduce input comes infrequently enough that a single microservice can keep up with all the map tasks - then you don't need a MapReduce-like framework.
To the extent that's true it's an indictment of Hadoop's implementation. Doing all those things in Hadoop ought to be trivial; maybe there are a few tools you'd have to make a one-time effort to learn, but reusing them ought to save you effort over making a custom system every time.
There's a particular bias I come across where people who genuinely have big data want to set it up in ways that is not necessarily performant because Hadoop is basically the most recognizable tool. If the data processing I'm doing generated a lot of output data I might consider a different flow, but there just isn't much of a reason: most of the data is inert for long periods of time, the output insights are fairly small and the actual processing has to occur very quickly and with low latency.
Column stores are crazy fast, but there isn't much simple tooling built around things like parquet or ORC files. It's all gigantic java projects. Having some tools like grep,cut,sort,uniq,jq etc that worked against parquet files would go a long way to bridge the gap.
Something like pyspark may be the answer, I think it may be possible to wrap it and build the tools that I want.. like
find logs/ | xargs -P 16 json2parquet --out parquet_logs/
parquet-sql-query parquet_logs/ 'select src,count(*) from conn group by src...'
I've been testing https://clickhouse.yandex/. I threw it on a single VM with 4G of ram and imported billions of flow records into it. queries rip through data at tens of millions of records a second.Edit: another example... I have a few months of ssh honeypot logs in a compressed json log file. Reporting on top user/password combos by unique source address took tens of minutes with a jq pipeline. The same thing imported into clickhouse took a few seconds to run something like
select user,password,uniq(src) as sources from ssh group by user,password order by sources desc limit 100The community around dask is quite active and there's solid documentation to help learn the library. I cannot recommend dask enough for medium data projects for people who want to use python.
They have a great run down of dask vs pyspark [1] to help you understand why'd you use it.
You example above would actually work perfectly. You can literally use grep in a distributed fashion in our system. One of our example pipelines is using grep and awk to do log filtering/aggregation or word count.
[1] Technically, 6 2-core guests on a single hypervisor; using guests to test deployment and scaling more easily.
so you start looking at stuff like sharding or vertical scaling and you keep on doing things more or less the way you have been but with steadily degrading performance on every new insert.
clickhouse turns my annoying data back into something that I can query in 30 seconds.
I just ran a random query to find what day had the most connections:
select day,count() as c from conn group by day order by c desc limit 1
And that took all of: 1 rows in set. Elapsed: 16.412 sec. Processed 1.43 billion rows, 2.87 GB (87.33 million rows/s., 174.65 MB/s.)[1] https://thinkfaster.co/2017/05/big-data-with-golang-instead-...
1.4 billion of our connection logs (24 fields) takes up 89G on my clickhouse VM. 5 billion records would take ~320G.
Based on http://tech.marksblogg.com/benchmarks.html a 6-node ds2.8xlarge redshift cluster is about as fast as clickhouse on a single i5.
Edit: Oh, or you could use something like BigQuery which should be significantly easier than Hadoop (Never had the need myself though)
sqlite is a sql database.
Of course, it depends on the precise nature of your workload.
select day,count() as c from conn group by day order by c desc limit 1
and that resulted in 1 rows in set. Elapsed: 16.412 sec. Processed 1.43 billion rows, 2.87 GB (87.33 million rows/s., 174.65 MB/s.)
Can ElasticSearch do that?yes. the required infrastructure will look different though, and obviously elasticsearch doesn't speak sql (not without some crazy 3rd party plugin anyway)
1. When the devs' agenda is about learning new tech rather than solving business problems. The ways to solve this are to incentivize devs at the business problem level (hard) or find devs who care more about solving business problems instead of learning hot new tech (easier).
2. When the product management function is weak within an org. Product defines the requirements, and makes trade-offs around the solution. A strong PM will recognize when a bazooka is being used to kill a fly, and will push dev to make smarter trade-offs that result in a cheaper, faster, more maintainable solution. This is especially challenging when the dev team cares more about shiny tech than solving business problems.
Developers have also been telling other developers that switching jobs is the best way to maximize their paycheck.
It's debatable whether developers should study this new tech on their own time or not, but there's clearly developers who would prefer to do it on the company's time.
Naturally, some developers will learn new tech while solving a company's problem so they can get paid to learn new tech.
Combining all of these things, it's rather obvious why developers are building solutions to simple problems with new tech.
If you want developers to act differently, you have to change the narrative (or incentives) around new tech, jobs, and salaries.
You can't blame us for doing the things we've been told to do by our peers for at least the last 5 years.
Half- or nontechnical managers often follow tech hypes as well and may push for the project to use "Big Data technology" simply because it makes them feel more important to lead a project that is part of the hyped topic.
FWIW I think most devs could learn how to push back on poor decisions like this made by non-technical managers as it really shouldn't be the manager's responsibility to dictate technology choices for a solution. It should be their responsibility to push the dev team to make tradeoffs in order to achieve a business result.
Devs who are good at understanding the business objectives and pushing the non-technical team to make better decisions are both wonderful to work with and command higher salaries / fees.
Scout the technology ahead of business needs. If you want to look at new tech, you should be doing a proof-of-concept that the business is not depending on. If you are doing business work, then you can either use things you know, or use a completed proof-of-concept to move in a new direction. But you should not mix business needs with that initial proof-of-concept.
What does this mean? What is "the business problem level?"
Spark is orders of magnitude faster than Hadoop, too.
There's also Facebook's presto, which is so much faster than hive it will make your head spin!
Presto is nice, but you can't use it for an ETL job. It is great for analysis.
https://prestodb.io/docs/current/connector/hive.html#example...
Plus you can mix and match R, Scala and SQL all together.
Contrast that with a system of map-filter-reduce pipelines over an append-only data set, like a classic CouchDB. A reasonable pipeline can be composed by a junior dev, just by repeatedly asking "What do I want this report to summarize? What information do I need to collect or reject, for that summary? How can I transform the shape of the information that is currently in front of me, into the input that I wanted when I planned the high-level end result?" And, if they need help with that last part, then at least they are asking for help with a small subset of the problem, instead of "Something is wrong in this forest of queries, can you take a look at it with me?" Or, "I need to add a column, may I ALTER TABLE?" They can even prototype the whole thing on an array in Javascript, if they are more comfortable there.
SQL can be a beautiful language that feels very natural, once you have had a few years to build up fluency in it. It might make for an excellent shell language. But, having spent time prototyping systems in CouchDB (which were admired for their elegance, but rejected due to the relative obscurity of Couch, grrr!), I have to say, that my previous bias for querying over transforming, was ultimately holding me back, bogging me down in leaky abstractions. We should have started with MR, and then learned SQL only when presented with something that doesn't fit the MR paradigm, or even the graph processing paradigm, which IMO is also simpler than SQL.
As for the original subject, yes, Hadoop is a pig, ideally suited to enterprisey make-work projects. All the way through the book, I kept thinking, "there has got to be a simpler way to set this up."
Hive and other SQL-on-Hadoop systems tend to do better in that department.
https://hortonworks.com/blog/llap-enables-sub-second-sql-had...
Not sure the performance difference would be as significant now.
And as someone else mentioned Spark != MR and most people using Spark are writing code.
I do agree in principle that you're better off using simpler tools like Postgres and Python if you can. But if you're in the middle band of "inconveniently sized" data, the small overhead of running Spark in standalone mode on a workstation might be less than the extra work you do to get the needed parallelism with simpler tools.
And it's very simple to manage operationally if you know anything about JVM apps.
A comparison between Spark & Hadoop doesn't make much sense though.
Spark is a data-processing engine.
Hadoop these days is a data storage & resource management solution (plus MapReduce v2). Spark often runs on top of Hadoop: Hosted by YARN accessing data from HDFS.
As you said: Marketing :)
Disclaimer: I built CSV Explorer.
Finally if you are truly looking for speed while maintaining portability, these days I would recommend using Docker containers with external volumes created on tmpfs thus providing both speed of an in-memory implementation while being agnostic to both OS and FS.
Then you don't need a new OS/Platform/Ecosystem with FS (hdfs)/ Scheduler / Applications to maintain, host and secure to compute thing that could be done with local scripts, or even java / cython programs. or distribute on a few servers what can (often) be distributed easily.
that still covers most of the use cases.
You don't need a new OS/Platform/Ecosystem to run Hadoop/Spark. It is literally just half a dozen Java apps that you run on typical hardware on your regular Linux OS. That is specifically what it was designed for. So rather than write your own Java apps and distribute it yourself why not use a platform that is proven, performant and with Spark will allow you to do things that you could never write yourself.
To be clearer, I don't think you need such things when you just need one or maybe a few servers talking together when you remove the cost of parallelism (see article about COST) and all the hadoop machinery. I have an OS, platform and ecosystem, it's called unix and works for 95% of my needs.
Frankly I've seen my current project be implemented partly on single node (to be replicated for later scalability) and partly multiprocess python. The python is maybe 10x speedier and has 10% the code and run complexity. We tried to run it on a shared cluster of hundred nodes for giggles, the python finished running before the other one started launching. Not taking into account the setup / maintenance.
The COST model is a good one indeed.
So I'm roughly paraphrasing the article (which I point anyone talking about needing big data to, just before asking how big their data exactly is.)
I mean if that was the case then ELK stacks would not be running in cluster mode. There many 3-Node ELKs handling less than 4 TB of data efficiently where one could not. By efficiently I mean, not having time for Coffee while waiting for Kibana to load the graphs...
Your point is simply not true. Many users of big data platforms e.g. Spark aren't doing so because of the volumes of data. It's because they want to do machine/deep learning on a proven and popular platform. With technologies like Caffe, Sparkling Water, Tensorflow all available on the one platform.
7 hours later, 4 email chains and around 12 people involved, and still no answer, and they've all gone home...
I've been working in a project for an insurance conglomerate for the past 6 months (total project has been running close to a year) that has very recently hit the rocks.
The client has gotten fed up of our inability to deliver, so canned the long term plans of the project in favour of a stop gap solution in order to fulfil some short-term business goal.
We've acquired a relatively ludicrous amount of hardware (i'm talking $100,000+) for what is essentially the equivalent of SELECT COUNT(*) FROM ALL TABLES, which is then filtered into some slow, unusable BI tool that costs $999+ per user / per year.
The real tragedy is they already have geo-diverse SQLServer instances running that would have allowed them to do this in 1 evening. 1 year and $1m+ in billable's and we somehow are going to fail to deliver even that.
Right now the records are stored in JSON documents, and we're working on ways to process those documents for reporting and analysis. There were some previous attempts to store the records "normalized" in SQL, but it quickly became difficult to modify and maintain.
Besides that, a column store might be what you are looking for if you are more interested in aggregate data on specific columns?
I'm generally for people not over complicating their stack with tools beyond their actual needs - but a lot of this stuff is quite some distance from where it was in 2013 when this article is written, in ease-of-use, ops, tooling and maturity. Its simply becoming cheaper and easier to throw even modest amounts of data through a "big data" engine like spark in many cases, than it is to use more traditional tools which might be able to do the job, but require more advanced tuning, ops, and possibly infrastructure.
And there are lots of compelling managed solutions out there these days. Amazon's EMR (elastic map reduce) is a popular option, gives you lots of tools to choose from, including Spark. Google Data Proc is similar I believe.
But if you really have some crazy single record with thousands of attributes, look at CouchDB. If you know your way around Javascript and don't mind writing map/reduce functions, it should be the easiest way for you to do reporting/analytics.
Or if you just want to avoid a database altogether and know some Python, take a look at Pandas.
If the data is wide as you say, but you end up performing a large number of aggregate queries on columns, like SUMming a bunch of values, then it might be worth looking at a columar store which structures your data on disk by column rather than by row.
https://en.wikipedia.org/wiki/Column-oriented_DBMS examples include AWS Redshift or even just Postgres with some bells and whistles that end up doing the same thing.
Again though, I go back to my first point and try and get a good characterization of how the data is typically access, a million rows per year isn't much and you might just get a lot further with some indexing strategies in your regular RDBMS.
I've done this in the past with OLAP cubes (SSAS) with much larger numbers of small records. The difference here is there are so many more fields and we have 20-30 new or modified fields each year. It doesn't seem like this should be a unique problem, but I'm having a hard time finding tools that might make it easier and less time-consuming. Maybe I'm just not asking the right questions.
1. Bash. Can you get the answer you need with awk, sed, sort, etc.? Linux commands behave nicely with CPU and RAM, and "Command-line Tools can be 235x Faster than your Hadoop Cluster" (https://aadrake.com/command-line-tools-can-be-235x-faster-th...).
2. SQLite. The maximum database size is 140 terabytes, and SQLite can join different database files together. First I would recommend using bash to cull your data down before import, if possible (https://www.sqlite.org/limits.html).
3. PostgreSQL. Again, I would recommend using bash to cull your data down before import, if possible (https://www.postgresql.org/about/).
Maximum Database Size Unlimited
Maximum Table Size 32 TB
Maximum Row Size 1.6 TB
Maximum Field Size 1 GB
Maximum Rows per Table Unlimited
Maximum Columns per Table 250 - 1600 depending on column types
Maximum Indexes per Table Unlimited
More: "Bane's Law (Going Deep)" (https://news.ycombinator.com/item?id=8902739)If the architecture diagram looks complex, it makes for an easier sale, i.e. "well clearly that would take us forever to build/integrate/whatever, so buying seems easier" whereas if it's just a database and a app server, it's can be a much harder sale.
obviously all the usual caveats apply, but in general, demonstrating "technical complexity" to the customer is something a lot of sales and CEOs will push for.
Google BigQuery has a 10GB free storage tier and a 1TB per month query tier.
If your data is small enough, you get a fully managed "serverless" analytics database for very little, potentially free.
(work at G)
Interestingly, we (Cloud Dataproc team) have been trying to work in the opposite direction. A few months ago we launched single-node clusters so people can use Spark on one VM instead of creating crazy-huge clusters just for lightweight data processing. No sense in using a a fleet of cores for simple stuff. :)
Disclaimer - work for Google Cloud (and think we need better tools for simple data processing)
YARN is also allowing interesting stuff.
Even terabytes of data isn't "big" anymore.
Built a Python crawler to pull data from the Internet using EC2 spot instances, as they are dirty cheap. After just a few days happy coding, I eventually got to a place where I can reliably (spot instances are not that reliable) pull the data, compress them and download them to our own data centre for processing (policy rather than design decision) for under $50 with the majority spent on transferring the final compressed output.
Big data? 100 million small files a run is a typical small data project, big data means trillions of files a day, or something like exabytes scale data volume.
I prefer to define big data as "an amount of data that cannot fit on any one computer." Once you start using distributed systems, either with sharding, NoSQL, or similar tech, you're in big data territory. Going from one computer to two you greatly increase the complexity of the system.
I recall one of the classes was named SimpleJobDescriptor. At the near end it was 500+ lines long. Not so simple after all.
Some of us though, from time to time, have these side company projects. Then ,after a round of consultants and meetings (and nobody asking us for input) we had this 500MB database, and an architect who was pushing for all the big data keyword to be on his resume, even though all math and business numbers said we'd double that in twenty years.
We are talking zookeepers and 20 servers per geo separate datacenter, spark, ml, Casandra, hadoop, MR, java everywhere, logstash, etc etc etc. Presentations in hundreds or PowerPoint slides and endless meetings about direction and future.
So the article, and MySQL, have it's places. Especially when one can finish the job in two weeks.
Our data isn't enormous, by any means - 160G in one particular instance that's being used for proof of concept, it'll add up to 5-20T should it reach production. The catch is that it's 160G in MySQL; it's only 5G or so once it's been boiled down to Parquet files in HDFS. Columnar stores can be a really big win, depending on the shape of your data.
We use Impala for our queries. It's quite good tech; it's much faster at table scans than everything that doesn't describe itself as an in-memory database. That means writing SQL much like you would with Hive, only it runs faster.
I tried out both Citus and Greenplum to give PostgreSQL a fair shot. First problem: PostgreSQL is limited to 1600 columns in a table, and the column limit for a select clause isn't much bigger. We have several times this number of columns in our largest analytic tables. Not the end of the world, you can cobble things together from joins and more special-purpose tables.
Second problem: CitusDB doesn't come OOTB with a column store, and it's far too slow when using a row store. I didn't bother trying to compile the column store extension to use with Citus; the pain ruled itself out. I continued ahead with Greenplum, focusing on columnar storage - row storage is consistently poor.
Third problem: Greenplum is cobbled together from a pile of duct tape, an assembly of scripts and ssh keys to keep the cluster in sync. It does not inspire the same kind of confidence for operational management as HDFS, whether rebalancing the cluster, expanding the cluster, or decommissioning nodes (not supported with Greenplum, AFAICT).
Fourth problem: Impala simply runs faster than the Postgres derivatives, and its lead increases the more data you have. Impala seems to do table scans over twice as fast on identical deployment environments.
Indexes only help when the operation being performed can use the index. As it happens, most analytic queries do full scans, or have predicates that are either not very selective (randomly skipping rows here and there) or are really selective (date bucketing, which maps well to typical Hadoop partitioning strategies). I had some hope that indexes would help for joins; but Greenplum didn't elect to use my indexes, and when I forced their use, it ran slower. The ancient version of Postgres that Greenplum is forked from doesn't help much either, since it can't e.g. use covering indexes to avoid looking back to the table.
If it was my startup, I'd take a risk on something like MonetDB, or look harder at MemSQL, given what I've seen about how data has shrunk with column stores. But from what I've seen and measured, Postgres doesn't really cut it for analytic queries.
Is that typical for this kind of work?
Anyway, the diversity in customer schema leaks out into the Hadoop schema, where we'd much prefer to give customers data using column names they're familiar with, and we also want to give them rows from all their different schemas in a single table (because many schemas have overlap by design). The superset of all schema columns is large, however. The problem can be overcome with more tooling - defining friendly views with explicit column choice - but having the option to implement that (and go to market sooner), vs a requirement to implement that, adds up to a distinct advantage for tech that can support the extra columns.
I understand though that sometimes customers give you a rotting dumpster of data and ask for critical insight into their operations.
That's why I always find it hilarious when HN goes on about just using PostgreSQL or some other SQL database for everything when they don't understand the use case. They simply doesn't work in these scenarios.
Why so many columns? I would expect there would be some way to break the data down or transpose it somehow to make it more manageable. At that point are you even really dealing with a database as most people use the term?
The reason I don't load it into memory and operate on it directly is because it's analytics as a service; I don't particularly want to write a SQL parser and execution engine.
We have looked at things like Zeppelin for more interactive data manipulation, using Spark to keep stuff in memory. But building a UI around that is an open-ended rabbit hole.
I have done maybe a hundred to two consulting hundred projects based on Hadoop (as you can imagine it's mostly short-term and troubleshooting stuff) and am a ASF committer myself. So take this with a grain of salt.
I've seen the kinds of projects the article and lots of people in here refer to and I agree with lots of what's been said.
I also agree that Hadoop (the whole ecosystem) probably not has a single "best of category" tool that ticks all the checkboxes but IMO that's totally missing the point.
What it gives you is: - (Mostly) Open source stack (compare that to your Informatica/Talend/IBM stack that big companies have and not to your Python jobs they don't), lots of the code is crap (see my Apache JIRA history) but it's there and you can attach a debugger to your running cluster, that's fantastic and very hard to do with e.g. Python (at least I'm not able to find good ways of doing it)
- Proven technology, it works most of the times and if not there's tons of SO answers, mailing lists, books.
- All the boring enterprise stuff: Encryption at rest and on disk, strong authentication, strong authorization, auditing, high availability, failover etc.
- Integration into Monitoring & alerting tools, distributions figure out the important stats and thresholds for you
- Mostly easy to operate these days even at large scale thanks to Cloudera Manager et al. - no need to manually run/install stuff
- "Coolness factor"
- Costs way less than established tools with e.g. external storage filers or similar specialized hardware
- It's not trivial but also not super hard to find people with Hadoop/Spark experience
- Existing purchasing agreements with Hardware vendors or Cloud providers
- Business/C-level gets and supports it
Edit: Three more I thought of:
- You can buy licenses and support for the tools. Both of which have been discussed multiple times here on HN, a donation doesn't work that well for companies
- You can buy indemnification from license problems from at least Cloudera but I think Hortonworks as well
- If the same stack has been used elsewhere in the company already chances are there are processes in place, someone has already vetted it, done the open source checks etc.
See what I don't mention are things like performance or absolute money amounts or even the amount of data (as the whole ecosystem is much more than "big data" now) etc. as we see surprisingly little projects that care about specific SLAs or features. It's all relative.
That said: At least 50% of the projects would still be better served by a simpler solution but that still leaves a whole big chunk of projects where Hadoop makes sense for other than technical or monetary reasons.
But I very much disagree with this part of the post: > The only benefit to using Hadoop is scaling.
Then again, Spark doesn't really need Hadoop, I see more and more people using it with Kafka and Elasticsearch for all sorts of fun stuff.
And as other commenters pointed out, you get read-only SQL (very powerful SQL) for free. The other day I joined an elasticsearch result with a CSV file in SQL.
I.e. If it's ok for the crunching to take 6 hours to produce intermediary aggregates which can then be crunched in less time , you can avoid spark and Hadoop for much longer.
Buzzwords are hell of a drug
Hadoop is basically HDFS + YARN. Spark is a replacement for MapReduce only.
It is also worth noting that many people use Spark against a database like Cassandra and not HDFS. So it isn't even universal for local installs.
I was a Hadoop evangelist, but its time has passed. It is a foundation, not the tool you use to get work done.
Did we really have to weaken the title's statement? Bending to the common denominator will always lead to milquetoast titles.
This. Should be sold as posters with pre-printed "Happy birthday mr manager".
How about base64decode? it is possible in SQL but not pretty. There are other examples as well. I do agree that Hadoop is probably an overkill for 90%+ of uses but there are certain set of problems which are helped by having a general execution environment.
SELECT convert_from(decode(encode('Hello world','base64'),'base64'),'LATIN1');
Our team just acquired a product manager for the first time. And for the most part I absolutely adore her. She's really great at pacing things out to a timeline that works for us and pulling us out of our idea that a hacked up solution that you do in a couple of days isn't really a product. And she's very much pushing against putting those into production, all of which I agree with.
But she doesn't understand technology or needs. She's constantly having meetings where she pitches our manager on product ideas that don't even make sense compared to the client needs. Many of these are buzzword-based. But it makes me seem like an asshole where every team meeting, I have to be like, "No. That's not what the client asked for. The client asked for a solution to this problem x. The client (doesn't matter if it's internal or external) often doesn't know what the right solution is. Good product people and managers know that to get to a good place, the key is to get the client to describe the problem instead of the solution.
I'm not a product person. I don't know jack dick about products except for how to make them. But the level of miscommunication I see even in our small organization is astounding.
You get one manager, one product manager, and two stakeholders, and one engineer in a meeting together. It's absolutely unbelievable to me what management and product take away from those meetings.
It's so far from the reality of the problem to be solved that it sometimes makes me nuts. Like it has today.
I think that our whole way of doing things and our hierarchy is completely broken and backwards. You want to get something done? Put a software engineer in a room with an operations person who is on the ground. Talk about the problem. Propose a solution.
Take it to the management and let them sort out priorities among themselves. This bullshit about management being the first point of contact virtually guarantees that buzzword-based development is going to happen.
I know that we are supposed to be the sacred cows, and that we need to be protected. Fuck that, I say. Let me interact with the people on the ground whose problems I'm trying to solve. Don't put a non-technical product person who doesn't get any of the details right between me and the end-user. I'll take the time out of my day two days per week to go to the office and have meetings, and I do the rest at home where I can be productive and write code.
Sorry for the rant, but fuck all of this. We have a very broken system, in most cases.
> But my data is more than 5TB! Your life now sucks - you are stuck with Hadoop. You don't have many other choices (big servers with many hard drives might still be in play), and most of your other choices are considerably more expensive.