{"id":111307,"date":"2016-07-19T13:48:07","date_gmt":"2016-07-19T13:48:07","guid":{"rendered":"http:\/\/www.timestored.com\/b\/?p=111307"},"modified":"2016-07-19T13:48:07","modified_gmt":"2016-07-19T13:48:07","slug":"open-source-alternative-to-kdb","status":"publish","type":"post","link":"https:\/\/www.timestored.com\/b\/open-source-alternative-to-kdb\/","title":{"rendered":"Open Source Alternative to kdb?"},"content":{"rendered":"<p>I often get asked what open source alternatives are there to kdb+. The answer depends on what you are trying to do. IF there was a product XYZ that provided some similar features, whether it can replace kdb depends on a few issues:<\/p>\n<p>>>&#8221;What will XYZ bring us that kdb doesn&#8217;t?&#8221;<br \/>\nKdb has been tried and tested over many computer\/man-years. The KX team have fixed 1000&#8217;s of edge cases, optimization issues and OS specific bugs. Any similar system would have to replicate a lot of that work. Possible but it would take time and teams actually using it. It would also require a corporate entity to provide support and bug fixes together with long term guarantees of availability (not a few part-time committers on github). Ontop of that it would need to deliver more value to make it worth switching.<\/p>\n<p>Kdb is both a database and a programming language and it&#8217;s that combination which I believe gives kdb it&#8217;s unique power:<br \/>\n&#8211; There is no open source database that provides the speed kdb provides for the particular queries suited to finance.<br \/>\n&#8211; Combining kdb and basing queries on q-sql\/ordered lists (rather than set theory for standard sql) means queries require fewer lines of code. I believe this expressiveness combined with longer term use of kdb\/q changes how you think and allows easily forming queries which many people couldn&#8217;t begin to write in standard sql.<br \/>\n&#8211; However as much as I think q is a selling point of kdb, I know many others would disagree. It takes a reasonable period of time to convince someone non-standard SQL is beneficial.<\/p>\n<p>What is your use case? e.g. Example Queries to Consider: <\/p>\n<p>1. Select top N by category<br \/>\nhttp:\/\/stackoverflow.com\/questions\/176964\/select-top-10-records-for-each-category<br \/>\n<code>select n#price by sym from trade<\/code><\/p>\n<p>2. Joining Records on nearest date time:<br \/>\nhttp:\/\/www.bigresource.com\/MS_SQL-joining-records-by-nearest-datetime-XsKMeH3t.html<br \/>\n<code>aj[`sym`time;select .. from trade where ..;select .. from quote] <\/code><\/p>\n<p>3. Queries dependent on order. (eg price change, subtract row from previous)<br \/>\nhttp:\/\/stackoverflow.com\/questions\/919136\/subtracting-one-row-of-data-from-another-in-sql<br \/>\n<code>select price-prev price from trade.... <\/code><\/p>\n<p>XYZ would need to support these queries well. Why would I chose XYZ instead of Python\/R\/J\/A+?<br \/>\nExisting (some similar languages) that offer a larger existing user base, more libraries and a proven\/stable platform. Unless a way is found to leverage existing languages\/libraries XYZ will be competiting for attention against kdb and also python\/numpy\/julia etc.<\/p>\n<p>>>&#8221;bring in the cost factor and should XYZ be considered as a big future player?&#8221;<br \/>\nFor the target market of kdb the cost is often not the most significant factor in the decision. If kdb can answer questions that other platforms  can&#8217;t or in a much shorter time, it often adds enough value to make the cost irrelevant. In fact many large firms are happy paying a pricey support agreement for free open source software so that they have someone to (blame) call to resolve an issue quickly.   <\/p>\n<p>>>&#8221;but could XYZ catch up and begin to be trusted by bigger institutions?&#8221;<br \/>\nIf XYZ started to be able to answer the three example queries shown above at a reasonable speed multiple perhaps but I consider it unlikely. Kdb is entrenched and for its target use case it is currently unbeatable. Some people may have use cases that don&#8217;t need the full power of database and language combined or have other important factors (cost,existing expertise). I think those use cases have viable open source solutions.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I often get asked what open source alternatives are there to kdb+. The answer depends on what you are trying to do. IF there was a product XYZ that provided some similar features, whether it can replace kdb depends on a few issues: >>&#8221;What will XYZ bring us that kdb doesn&#8217;t?&#8221; Kdb has been tried [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts\/111307"}],"collection":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/comments?post=111307"}],"version-history":[{"count":1,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts\/111307\/revisions"}],"predecessor-version":[{"id":111308,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts\/111307\/revisions\/111308"}],"wp:attachment":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/media?parent=111307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/categories?post=111307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/tags?post=111307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}