Cloud Platform
Data Storage
Introduction
The ObjectStore is an organization-specific key-value storage location to save and retrieve data in QuantConnect's cache. Similar to a dictionary or hash table, a key-value store is a storage system that saves and retrieves objects by using keys. A key is a unique string that is associated with a single record in the key-value store and a value is an object being stored. Some common use cases of the ObjectStore include the following:
- Transporting data between the backtesting environment and the research environment.
- Training machine learning models in the research environment before deploying them to live trading.
The ObjectStore is shared across the entire organization. Using the same key, you can access data across all projects in an organization.
Supported Types
The ObjectStore has helper methods to store strings, JSON objects, XML objects, and bytes.
The ObjectStore has helper methods to store strings and bytes.
ObjectStore.Save(stringKey, stringValue); ObjectStore.SaveJson<T>(jsonKey, jsonValue); ObjectStore.SaveXml<T>(xmlKey, xmlValue); ObjectStore.SaveBytes(bytesKey, bytesValue);
self.ObjectStore.Save(string_key, string_value) self.ObjectStore.SaveBytes(bytes_key, bytes_value)
To store an object that is in a different format, you need to encode it to one of the supported data types. For instance, if you train a machine learning model and it is in binary format, encode it into base 64 before saving it.
The ObjectStore also has helper methods to retrieve the stored objects.
var stringValue = ObjectStore.Read(stringKey); var jsonValue = ObjectStore.SaveJson<T>(jsonKey); var xmlValue = ObjectStore.SaveXml<T>(xmlKey); var bytesValue = ObjectStore.SaveBytes(bytesKey);
string_value = self.ObjectStore.Read(string_key) bytes_value = self.ObjectStore.ReadBytes(bytes_key)
For complete examples of using the ObjectStore, see Object Store.
Research to Live Considerations
When you deploy a live algorithm, you can access the data within minutes of modifying the ObjectStore. Ensure your algorithm is able to handle a changing dataset.
The live environment's access to the ObjectStore is much slower than in research and backtesting. Limit the individual objects to less than 50 MB to prevent live trading access issues.
Edit Storage Plan
You need storage billing permissions and a paid organization to edit the size of the organization's ObjectStore.
Follow these steps to edit the amount of storage available in your organization's ObjectStore:
- Log in to the Algorithm Lab.
- In the left navigation bar, click .
- On the Resources page, scroll down to the Storage Resources and then click .
- On the Pricing page, select a storage plan.
- Click .
