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
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?
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.Indexis using BoltDB, I thought in two buckets:kb:linkskb:tags2linkkb:linksWhere 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:
{...}{...}{...}kb:tags2linkWhere 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:
["0178b3b5-97ed-48a5-87ec-b5fba6d2d469"]["0178b3b5-97ed-48a5-87ec-b5fba6d2d469"]["0178b3b5-97ed-48a5-87ec-b5fba6d2d469", "(...)", "(...)"]Thoughts?