Breaking the trillion-rows-per-second barrier with MemSQL
blog.memsql.com
blog.memsql.com
EDIT: This comes on top of the fact that DBs can store queries results too. Moreover the post does not tell whether they have implemented clustered or filtered indexes on the considered columns. It does not explain how partition has been performed too. All this has a big impact on execution time.
We guarantee that the result is legit.
We partition data on stock symbol but this doesn’t make a difference for this query either. It would if we had filters.
Yes, shared mod 3 or other predicate would make it impossilbe to run this query in O(metadata). It would of course burn more instructions so we would have to have a bigger cluster to hit a trillion a second as well as have a complex explanation in the blog post why this matters.
More about rows/second it's about lowering minutes/operation.
It's generally a large company, large issue sort of problem. You can throw millions in hardware/software into a problem that saves you 100's of millions.
Edit: while these cpus don't have avx/avx2, they still give good results and don't cost $40,000 per server. The best value system with avx2 would be a dual e5-2650v3 such as this one: https://m.ebay.ca/itm/DELL-POWEREDGE-R430-SERVER-2-X-E5-2650...
"Start Using MemSQL Community Edition Now Unlimited scale and capacity. Free forever.".... Free forever right? Now it doesn't exist.
1. Isn't (3)vectorization and (4)SIMD the same thing ?
2. I don't see the data-size before-after compression ?
3. How much RAM has each server ?
4. How do all cores work for all queries ? Is the data sharded by core on each machine or each core can work on whatever data ?
5. What's a comparison open-source tool to this ? Only I can think about is snappydata.
SnappyData: https://www.snappydata.io, MemSQL: https://www.memsql.com/, Splice Machine: https://www.splicemachine.com/, SAP Hana: https://www.sap.com/products/hana.html, GridGain: https://www.gridgain.com/
are some of the technologies within it
Don't get me wrong, in some sense it is really impressive that we reached that level of processing power and that this database engine can optimize that query down to counting bytes and generating highly performant code to do so, but as an indicator that this database can process trillions of rows per second it is just a publicity stunt. Sure, it can do it with this setup and this query, but don't be to surprised if you don't get anywhere near that with other queries.
Sure, but writing a custom C# program for each query on data that has been pre-formatted in the most optimal manner for that program is not really comparable to writing a bog standard SQL query.
But they did exactly the same just that the query planer, optimizer, and compiler generated the code from the SQL query. They still picked a data set, a physical layout of that data set, and a query that would result in maximum throughput. That was not any random SQL query, it was a carefully picked one, chosen because it would be able to take advantage of all possible optimizations.
The last tests I saw for kdb was the 1.1 billion taxi ride.
http://tech.marksblogg.com/billion-nyc-taxi-kdb.html
Where it basically outperformed every other CPU based system with slightly more complex queries.
Any comparisons planned?
It's a great system, we used it for 2 years and it's one of the most polished databases out there with a simple MySQL interface. It's more general purpose than kdb, with a nice rowstore + columnstore architecture. I believe they're adding full-text search indexes in the latest version too.
If you need the query language, the advanced/asof joins, or the tightly integrated query/process environment, then there's no match to kdb though.
I don't think everybody agrees with this statement.
However, people may be primed for longer delays still seeming instant. e.g. Smartphones for many years had a built-in 300ms delay on any click event, and even without that event typically still have delays on many 'instant' actions.
So while the delay will be registered as being present, it may not be registered as "this site is slow" but "it's just a natural delay".
[0] https://psychology.stackexchange.com/questions/1664/what-is-...
https://www.youtube.com/watch?time_continue=52&v=vOvQCPLkPt4
Especially not to oddballs like me that has some kind of perceptive 'bug', it's like I lack a 'motion filter'. One effect being that movement in computer games doesn't feel completely fluid until the refresh rate is close to 200Hz.
Before internet and slow loading web pages might have lowered peoples expectations, I remember Human-computer interaction guidelines stating that < 0.1 was experienced as instantaneous in almost all cases. Above 1s without feedback started to cause measurable stress in test subjects.
Since this was before computers were ubiquitous, it's probably a good measure for how we react on a more basal, subconscious level. Anything measured today is likely to be include learned expectations, so a quarter of a second seems like reasonable learned expectation of the perception of instantaneous in that particular context.
Anything less than a second to run a query and return results is considered "instant" (also sometimes "interactive") for analysis.
Working with some datasets with 100s of billions of short rows, curious to give it a try.
If you can live with somewhat out-of-date and/or out-of-sync data, you can throw mass parallelism at big read-only queries to get speed. The trade-offs often are best tuned from a domain perspective such that it's not really a technology problem, although technology may make certain tunings/tradeoffs easier to manage.
[1] (Faster hardware may give us incremental improvements, but the speed of light probably prevents any tradeoff-free breakthroughs.)
So are many problems, and we still are at a point where we are creating languages and frameworks that allow us to work with the data at a higher level: e.g. theano, numpy or TensorFlow.
Speed of light is only an issue for latency-sensitive operations: e.g. if every sub-operation is non-commutative in a given transaction then it would be expected to be completed before any other sub-operation.
That was my point: if you don't care about data being "fresh" and consistent (per transaction coordination) you CAN throw mass parallelism at the problem. If you do care, then the speed of light is the bottleneck.
Serious question. I would like to know different real use cases from people on HN, given our backgrounds.
The hardware in this example is overkill and impractical for most use cases - to say the least. For our setup, Memsql does this for us on a single node with 256Gb of ram, 40 cores (1 aggregator and 4 leafs) and a modest enterprise nvme ssd. The machine cost $4,500 over a year ago. Adding more machines to mem is pretty trivial should we ever need to partition this across machines, despite this not being necessary.
There are some gotchas and it should not be consisted a drop-in replacement for MySQL.
Not necessarily trillions at a time, but even small ad tech firms deal with billions of new data points across many dimensions every day.
For users, you always want mediation/adjustment steps that (can) modify realtime data to provide timesliced totals. For developers/administrators, you want to be able to persist data. Running totals in memory are too fragile to be reliable. There is an assumption of errors, misconfigurations, and bad actors at all times in AdTech.
We used MemSQL for real-time data for 2 years. All data is fully persistent, but the rowstore tables are also fully held in memory compared to columnstores which are mainly on disk. There's nothing fragile about it. SQL Server's Hekaton, SAP's HANA, Oracle's Times Ten, and several other databases do the same.
Timesliced totals is just a SQL query, and mediation or some other buffer from live numbers for customers is up to every business to decide, not some default proclamation for an entire industry.