Ask HN: BigQuery vs. Redshift vs. Athena vs. Snowflake
I'm investigating potential hosted SQL data warehouses for ad-hoc analytical queries. I've read quite a bit about all 4 of these technologies and their high-level tradeoffs, but I'd love to get people's first-person accounts of the pros and cons of each.
Dimensions I care about: query performance, load performance, cost, stability, maintainability, features (e.g. views, UDF), limitations (e.g. concurrent queries, schema restrictions), and all of these at scale.
If you've used any of these and have thoughts, would appreciate hearing them, thanks!
23 comments
[ 2.7 ms ] story [ 54.7 ms ] thread1) RedShift is PostgreSQL 8 with some additional features, and while can significantly improve some query runtimes, comes with usual DBA burdens as an on-premise database.
2) BiqQuery is a true cloud implementation. Its SQL syntax is evolving and may not have some features older platforms do, but the concepts of the physical implementation is completely removed from the user's concern.
Were I going to start a new project without existing dependence on AWS, BigQuery would have an advantage.
Redshift: Pros: Has the most adoption, so most integrations from SaaS services etc. are built with Redshift as their sink. Relatively fast and battle-tested.
Cons: In an awkward middle ground where you're responsible for a lot of operations (e.g. capacity planning, setting up indexes), but don't have a lot of visibility. Some weirdness as a result of taking PostgreSQL and making it distributed.
BigQuery: Pros: Rich feature set. Pay-per-TB pricing. Recently released standard-ish SQL dialect. Very fast.
Cons: JDBC driver is recent and doesn't have support for e.g. CREATE TABLE AS SELECT (as of a couple of months ago) so harder to integrate with existing systems. There are ways to run out of resources (e.g. large ORDER BY results) without a good path to throw more money at the problem.
Athena: Pros: Built off of the open-source Presto database so can use the documentation there. Pay-per-TB pricing.
Cons: Slower than the other options listed here. Very early product so lacking some in documentation and some cryptic errors. Not a lot of extensibility, but you could theoretically move to just using open-source Presto.
Haven't had a chance to evaluate Snowflake.
RedShift is not a real managed service. You have to handle all the maintenance/scaling/indexing/provisioning, it's a hassle.
I could probably write a book on my experiences but I'll keep this short.
BigQuery requires the least amount of work to keep performant but this comes at a cost (this cost matches Athena).
Redshift seems to have support for just about every BI tool out there including Periscope which I've found to be popular with my customers. The downside is that you've really got to think about how you layout your data, how you write your queries and there is something of a weekly task of bringing up the console and hunting down the worst-offending queries for optimisation.
Keep in mind if you're already on Google Cloud or AWS you could incur bandwidth charges moving data to the other provider.
One of our customers I thought made a great observation. "I see a lot of people using Redshift. But I don't see anybody using it happily". Because of all the issues that people point out in this thread. lots of operations. little visibility ("black box"). All very true. It's the problem our product solves, and let me talk about how we see companies successfully using Redshift at scale. (and that customer is now a happy Redshift user, btw).
Here's the architecture that we're seeing companies on AWS moving to:
- all your data in S3 (I hate the term, but call it a "data lake")
- a subset of your data in Redshift, for ongoing analysis
- daily batch jobs to move data in and out of Redshift from / to S3
- Athena to query data that's in S3 and not in Redshift
The subset of the data sitting in Redshift is determined by your needs / use cases. For example, let's say you have 3 years of data, but your users only query data that's less than 6 months old. Then moving data older than 6 months to S3 makes a lot of sense. Much cheaper. For the edge cases where a users does want to query data older than 6 months, you use Athena to query data sitting in S3.
Why not use Athena for everything? Two reasons. For one, Athena is less mature. And then you still need a place to run your transformations, and Redshift is the better choice for that.
Three uses cases for Redshift:
1) classic BI / reporting ("the past")
2) log analysis ("here and now")
3) predictive apps ("the future")
Your use case will determine how you have to think about your data architecture. For some it's ok if a daily report takes a few minutes to run. I'll go get a coffee. It also means my batch jobs are running on daily or hourly cycles. But if I'm running a scoring model, e.g. for fraud prevention, I want that score to be as fresh / real-time as possible. And make sure that the transformations leading up to that score have executed in their proper order.
For Redshift to work at scale, there are really only three key points you need to check the box on:
- setting up your WLM queues so that your important workloads are isolated from each other
- allocating enough concurrency and memory to each queue to enable high throughput
- monitoring your stack for real-time changes that can affect those WLM settings
That's it. And then Redshift has a rich ecosystem and rich feature set to enable all uses cases (etl vendors, dashboard tools, etc.). Those users who have addressed the performance challenges that do come at scale for Redshift - they're happy users and never looked back.
On the pay-per-TB pricing for BigQuery and Snowflake. I think that's more of a marketing spin. Most companies we work with are compute-bound. So per-TB pricing helps them very little. They want to crunch their data as fast as possible. More CPUs give them more I/O. If you feel you're storage-bound - take a hard look at the data that really needs to be available in Redshift for analysis, and move everything else to S3.
For inspiration, watch the AWS Reinvent videos on S3 / Redshift / Athena from Netflix and NASDAQ. Like this one:
https://www.youtube.com/watch?v=o52vMQ4Ey9I&t=256s
If you're entire data is already within AWS, I think Redshift is the way to go. But then again I'm biased :)
Do you mind elaborating on what you mean by that? I've worked a whole lot on BigQuery pricing, and am a little confused by your comment. Do you mean that separation of storage compute is an overrated concept?
(work on Google Cloud)
(disclaimer: I work at Snowflake)
BigQuery's on-demand model charges just for the resources consumed during the job execution (via a per-TB proxy), rather than resources provisioned. This is the highest order of cloud-native pricing models, and good on Athena for doing the same!
If one were to equate this to VM pricing, you're getting:
- The ability to scale from 0 to thousands of cores in roughly 1 second (what it takes for Dremel to put together the execution plan)
- Pipelined execution (meaning, each processing stage ONLY uses the resources required for that stage, rather than net resources. think of this as per-second autoscaling from query stage to query stage. This is part of the reason why BigQuery does very well in concurrency tests)
- Equivalent of per-second billing
This in practice equates to 100% resource efficiency - never pay for resources you just deploy and not use.
I've written on this topic at [0] and at [1] and happy to chat further!
(And BigQuery did introduce a Flat Rate pricing model last Fall for the more enterprisey crowd)
[0] https://cloud.google.com/blog/big-data/2016/02/understanding...
[1] https://cloud.google.com/blog/big-data/2016/02/visualizing-t...
Pros:
Cons: Some (non-obvious) limitations: If you decide f...- The concurrency limits mentioned above are soft limits that can be raised on customer request (those defaults are there so that runaway applications can be detected easily). Snowflake can handle very high concurrency--we have customers running hundreds of concurrent queries.
- We’ve recently released a new Spark connector with a bunch of optimizations, including additional push-down capabilities that speed up performance significantly.
- The clustering capability is currently in "preview", we're definitely taking input and have been working on incorporating feedback we've received so far into it.
- One important thing to note when it comes to full table scans is that Snowflake allows you to choose how much horsepower you apply to the job, so you can easily adjust the horsepower to get faster scans.
I'll offer some resources:
- A session from last Google NEXT, where Yahoo, NY Times, and Blue Apron detail their experience with migrating to BigQuery [0]
- A session from previous Google NEXT, where Kabam Games detailed their experience with migrating to BigQuery (and running the rest of their workload on AWS) [1]
- A blog "15 things you probably didn't know about BigQuery" [2]
- A blog detailing what BigQuery means by "fully managed" [3]
- A blog offering some details on most recent iteration of Dremel "In-memory query execution in Google BigQuery" [4]
- A blog describing Capacitor, the opinionated storage format that replaced ColumnIO (on which Parquet is based) [5]
- "BigQuery Under The Hood" [6]
- Since you specifically asked about Load Performance, [9]
( A wholly redundant disclosure that I work at Google Cloud)
[0] https://www.youtube.com/watch?v=TLpfGaYWshw
[1] https://www.youtube.com/watch?v=6Nv18xmJirs
[2] https://medium.com/google-cloud/15-awesome-things-you-probab...
[3] https://cloud.google.com/blog/big-data/2016/08/google-bigque...
[4] https://cloud.google.com/blog/big-data/2016/08/in-memory-que...
[5] https://cloud.google.com/blog/big-data/2016/04/inside-capaci...
[6] https://cloud.google.com/blog/big-data/2016/01/bigquery-unde...
[7] https://cloud.google.com/customers/sharethis/
[8] https://storify.com/felipehoffa/dow-jones-on-bigquery
[9] https://medium.com/google-cloud/paying-it-forward-how-bigque...
These two issues particularly worry me:
- No non-date partitioning, which means you'll often end up (in my particular use case) scanning 10-100x as much data as you actually want to.
- Pricing is based on uncompressed data size, which is at least several times more expensive than the alternative (e.g. Athena).
Any thoughts on these? We'll have several hundreds of TB of data, so cost matters.
On partitioning - sounds like a great candidate for sharding. BigQuery standard SQL makes it very easy to run unions on shards (ex. Select * from tables_*)
On pricing - BigQuery is a very different product functionally, and I encourage you to compare it via a poc. That said, definitely reach out to me on price.