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

Best way to store references to a link #1

Open
andreyvital opened this issue Jun 1, 2016 · 2 comments
Open

Best way to store references to a link #1

andreyvital opened this issue Jun 1, 2016 · 2 comments
Assignees
Milestone

Comments

@andreyvital
Copy link
Contributor

As the search function is entirely based on hashtags we need to store them in a wise way that accommodates both performance and reuse.

As the first candidate implementation of index.Index is using BoltDB, I thought in two buckets:

  • kb:links
  • kb:tags2link

kb:links

Where all links will be stored. As a link always have an UUID the key will be this identifier and the value is a JSON snapshot of link.Link.

Something like that:

Key Value
0178b3b5-97ed-48a5-87ec-b5fba6d2d469 {...}
e4843306-b686-4f06-b63b-36810de580ec {...}
88b72ea8-a15f-49bc-9473-b948a5ac2e7d {...}

kb:tags2link

Where all tags will be stored: the tag itself as the key and value will be all link identifiers that did reference to this tag. You can imagine:

Key Value
#google ["0178b3b5-97ed-48a5-87ec-b5fba6d2d469"]
#search ["0178b3b5-97ed-48a5-87ec-b5fba6d2d469"]
#front-page-of-the-internet ["0178b3b5-97ed-48a5-87ec-b5fba6d2d469", "(...)", "(...)"]

Thoughts?

@txgruppi
Copy link
Member

txgruppi commented Jun 1, 2016

I was thinking we should use Redis. It can be used by several apps, not just kb. Other apps can access the kb data, etc.

In Redis there are the Set commands which would work for this project.

We would store the data in the same way you described with bolt and we would use SINTER to get links which have all the same categories.

@andreyvital
Copy link
Contributor Author

👍

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

3 participants