Hello,
I work with the KDB console so as soon as I close the console the data I saved are lost.
I would like to save data over several days.
How can I store them to HDB?
How can I access them from my q-console the next day?
Thank you.
Hello,
I work with the KDB console so as soon as I close the console the data I saved are lost.
I would like to save data over several days.
How can I store them to HDB?
How can I access them from my q-console the next day?
Thank you.
Hi Lili
The data is only in-memory in the console. You have to save it to disk either as a flat or splayed/partitioned table.
For example, to save as a flat table (a single binary file which must be loaded fully into memory to be accessed) you can do this:
// create table, save to disk
Jonny-MBP-2:jonny$ q
KDB+ 3.2
q)t:(a:1 2 3)
q)save `:t
`:t
q)\
// load table back in in a new session
Jonny-MBP-2:jonny$ q
KDB+ 3.2
q)t
't
q)load`:t
`t
q)t
a
1
2
3
q)
The best place to start is here:
http://code.kx.com/wiki/Tutorials
Thanks
Jonny
Hi Lili,
A typical stack consists of having a feed handler, ticker plant, real-time db and historical db. The feed handler will capture the data and send it to ticker plant which will then send it to an RDB. The RDB is a process that captures data in real time (in memory). At the end of the day, it will save the data in an HDB and flush the data from memory. Next day, you can connect to the HDB process that will get you the data saved on disk.
Kx provides a stack setup called kdb+ tick (http://code.kx.com/wiki/Startingkdbplus/tick) or you can use a third party framework like Enterprise Component by DevNet.