Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate indexes (or at least 2nd order data calls) #26

Closed
dcousens opened this issue Nov 1, 2017 · 7 comments
Closed

Isolate indexes (or at least 2nd order data calls) #26

dcousens opened this issue Nov 1, 2017 · 7 comments
Assignees
Labels

Comments

@dcousens
Copy link
Contributor

dcousens commented Nov 1, 2017

From #11

We should instead maintain two indexd chains, one for 1st order data, and the other chain, for the 2nd order data...

This would allow us to independently roll-back the chains in the event of failure.

This would also mean we can run a direct import using fast-dat-parser and allow the fee-data to catch up.

@dcousens dcousens self-assigned this Nov 1, 2017
@dcousens dcousens changed the title Isolate 2nd order chain data Isolate 2nd order chain data for fast import Nov 1, 2017
@dcousens
Copy link
Contributor Author

dcousens commented Nov 1, 2017

This would mean we have two independent resync-like operations required for a typical indexd node.

@dcousens
Copy link
Contributor Author

dcousens commented Nov 1, 2017

It would additionally mean a native offline/non-rpc fast import can get you 99% of the functionality required within minutes, and any 2nd order functionality (fee data! for now) would be sychronized as soon as possible.

@KanoczTomas
Copy link

this sounds really cool, i am indexing for a week now on an older node, and still 80k blocks to index ... this would be very welcomed, as we could use the *.dat files present on the node already!

@dcousens dcousens changed the title Isolate 2nd order chain data for fast import Isolate 2nd order chain data Nov 2, 2017
@dcousens
Copy link
Contributor Author

dcousens commented Nov 2, 2017

Perhaps it will be generic/easiest/simplest to maintain a tip for each index.

@dcousens
Copy link
Contributor Author

dcousens commented Nov 2, 2017

In that way, we can add new indexes and have them "catch up" without having to re-sync every index in the database.

@dcousens dcousens changed the title Isolate 2nd order chain data Isolate indexes (or at least 2nd order data calls) Nov 4, 2017
@dcousens
Copy link
Contributor Author

dcousens commented Nov 5, 2017

Started work on this in https://github.com/bitcoinjs/indexd/tree/isoindex

To prevent performance loss, the db atomic can be shared between connect calls across indexes! 😃

Adding support for #27 is easy enough.

I think in terms of indexes updating themselves independently, it will be best to determine which chains have matched tips, then update them together.

Then, for 2nd order indexes that are really slow like the fee index, we could have a configuration parameter that allows you to continuously isolate it so that it doesn't slow down the other indexes (as much).

Yes, that may mean that it could take many hours more to index [for the fee index,] but the result is that the indexes that do not need to self-reference the database can insert insanely fast, 100's/1000's of blocks at a time.

Overall, I think it will be highly beneficial.

@dcousens
Copy link
Contributor Author

Closing for PR, #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants