🥇KDB+ Database: From Finance to Formula 1 | ProHoster<br>Skip to content
support@prohoster.info Login
ProHoster > Blog > Administration > KDB+ Database: From Finance to Formula 1<br>KDB+ Database: From Finance to Formula 1
Categories<br>Hosting<br>Domains<br>Site builder<br>Virtual servers<br>Dedicated servers<br>Administration<br>Miscellanea<br>internet news
Latest news<br>Fixing a critical vulnerability in JCE, a CMS add-on Joomla<br>Canonical unveiled Myna, a local speech-to-text system for Ubuntu Desktop<br>QtCreator 20<br>Changes to the rules for generating official edition releases Ubuntu<br>Mozilla unveiled its Firefox roadmap<br>Valve has released a distribution for SteamOS 3.8 gaming consoles<br>The HTTP QUERY method, combining the capabilities of GET and POST, has been standardized.<br>Nginx 1.31.2 update addresses vulnerabilities exploited via HTTP/3, HTTP2, and gRPC<br>openSUSE Agama 22<br>First Steam Machine performance benchmarks under SteamOS
Our services<br>Unlimited website hosting<br>DDoS protection<br>Site builder<br>Control Panel<br>Domain registration<br>SSL certificates<br>VPN<br>VPS, VPS<br>Windows VPS
KDB+, a product of the company KX is a widely known in narrow circles, exceptionally fast, columnar database designed for storing time series and analytical calculations based on them. Initially, it was (and is) very popular in the financial industry - it is used by all the top 10 investment banks and many well-known hedge funds, exchanges and other organizations. Recently, KX decided to expand its customer base and now offer solutions in other areas where there is a large amount of data, ordered by time or otherwise - telecom, bioinformatics, manufacturing, etc. Among other things, they became a partner of the Aston Martin Red Bull Racing team in Formula 1, where they help collect and process data from car sensors and analyze wind tunnel tests. In this article, I want to talk about what features of KDB+ make it super-performing, why companies are willing to spend big money on it, and finally, why it's not really a database.
In this article, I will try to tell you in general what KDB+ is, what features and limitations it has, what is its use for companies that want to process large amounts of data. I won't go into the details of KDB+'s implementation and the details of its Q programming language. Both of these topics are very broad and merit separate articles. A lot of information on these topics can be found at code.kx.com, including the Q book - Q For Mortals (see link below).<br>Some terms
In-memory database. A database that stores data in RAM for faster access. The advantages of such a database are clear, and the disadvantages are the possibility of data loss, the need to have a lot of memory on the server.<br>Column database. A database where data is stored column by column rather than record by record. The main advantage of such a database is that data from one column is stored together on disk and in memory, which greatly speeds up access to them. There is no need to load columns that are not used in the query. The main disadvantage is that it is difficult to modify and delete records.<br>Time series. Data with a date or time column. As a rule, ordering in time is important for such data, so that it is easy to determine which record precedes or follows the current one, or to apply functions whose result depends on the order of records. Classical databases are built on a completely different principle - the representation of a collection of records as a set, where the order of the records is in principle not defined.<br>Vector. In the context of KDB+, this is a list of elements of the same atomic type, such as numbers. In other words, an array of elements. Arrays, unlike lists, can be stored compactly and processed using processor vector instructions.
Historical information<br>KX was founded in 1993 by Arthur Whitney, who previously worked at Morgan Stanley on the A+ language, the successor to APL, a very original and once popular language in the financial world. Of course, in KX, Arthur continued in the same spirit and created a vector-functional language K, guided by the ideas of radical minimalism. K programs look like a jumble of punctuation marks and special characters, the meaning of signs and functions depends on the context, and each operation carries a lot more meaning than it happens in conventional programming languages. Due to this, the K program takes up a minimum of space - a few lines can replace pages of text in a verbose language like Java - and is a super-concentrated implementation of the algorithm.
A function on K that implements most of the LL1 parser generator according to a given grammar:<br>1. pp:{q:{(x;p3(),y)};r:$[-11=@x;$x;11=@x;q[`N;$*x];10=abs@@x;q[`N;x]<br>2. ($)~*x;(`P;p3 x 1);(1=#x)&11=@*x;pp[{(1#x;$[2=#x;;,:]1_x)}@*x]<br>3. (?)~*x;(`Q;pp[x 1]);(*)~*x;(`M;pp[x 1]);(+)~*x;(`MP;pp[x 1]);(!)~*x;(`Y;p3 x 1)<br>4. (2=#x)&(@x 1)in 100 101 107 7 -7h;($[(@x 1)in 100 101 107h;`Ff;`Fi];p3 x 1;pp[*x])<br>5....