Are there offchain storage options in substrate? Like a regular mongodb- or mysql database, I don't want to use something else and just stick with something supported with substrate stack.

The only thing that I found is LocalStorage but it requires a Database and the only thing that implements that trait is in-memory database which means its not persistent storage

1 Answer 1


You can use use sp_io::offchain_index; it is a persistent storage.

Check the example here:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.