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

How to make sure open the same DB on different threadsd node? #492

Open
bitcard opened this issue Mar 2, 2021 · 0 comments
Open

How to make sure open the same DB on different threadsd node? #492

bitcard opened this issue Mar 2, 2021 · 0 comments

Comments

@bitcard
Copy link

bitcard commented Mar 2, 2021

These is sample code to create a same DB from different client. but If ran many threadsd node on different server machine.
1, how to make sure they open the same DB? the below step is ok?
A, client C1 connect threadsd N1 on server machine S1:
db1, err := client.NewClient("/ip4/127.0.0.1/tcp/6006", grpc.WithInsecure())
threadID := thread.NewIDV1(thread.Raw, 32)
err := db1.NewDB(context.Background(), threadID)
dbInfo1, err := db1.GetDBInfo(context.Background(), threadID) // copy dbInfo1 to server S2

B, client C2 connect threadsd N2 on server machine S2:
db2, err := client.NewClient("/ip4/127.0.0.1/tcp/6006", grpc.WithInsecure())
err := db2.NewDBFromAddr(context.Background(), dbInfo1.Addrs[0], dbInfo1.Key) // dbInfo1 is copy from server S1

2, If db2 can open the same DB from db1, db1 can sync all history record to db2, or db2 pull all history from db1?

3, If insert new record to db1 and db2, then can sync new record each other in real time?

4, is there a benchmark to test how many nodes to join the same DB?

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

No branches or pull requests

1 participant