Projects tigase _server server-core Issues #1227
Modernize UserRepository schema (#1227)
wojciech.kapcia@tigase.net opened 4 years ago

Current UserRepository implementation should be improved:

  • drop tig_nodes and add 'node' column in tig_pairs
    • we could also add parent_node column in tig_pairs to maintain tree-like structure
    • I'm not sure that we want to normalise those columns (in theory yes - but our past experience shows that this doesn't usually lead to improved performance; on the other hand - having it stored directly would simplify things)
  • add lastModified column to tig_pairs to help track changes made to entries (and maybe "value hash"? in a vain similar to current UserRepoRepository detection if value was modified)
  • possibly add soft delete column - so we would know that the value was removed (when querying for items "older than")
  • deprecate "subnode" methods in 8.x releases

Subsequently, UserRepoRepository should be adjusted and store items individually.

Motivation:

  • we already have other tasks that suffers from current implementation (#issue #1119 and #issue #729)
  • in the future we are pondering moving configuration to the repository, and having this change would greatly help.
wojciech.kapcia@tigase.net commented 4 years ago

@andrzej.wojcik feel free to comment if anything is missing.

Andrzej Wójcik (Tigase) commented 4 years ago

I do see a need for a storing value for user_id, node, key but I do not see a point in having anything deeper. Accessing those "deep" values is not fast and I do not see how it would be better than storing just XML or other type of a structure as a value.

wojciech.kapcia@tigase.net commented 4 years ago

What do you mean "deep" values? i.e. parent-child or something else?

Andrzej Wójcik (Tigase) commented 4 years ago

exactly. With user_id, node, key we have a simple table without tree like dependencies. If we would introduce alternative to nodes table we would end up with a tree and possibility to end up with deep relations. That would reduce number of joins and improve performance of the database queries.

wojciech.kapcia@tigase.net batch edited 7 months ago
Name Previous Value Current Value
Iterations
empty
Candidate for next major release
wojciech.kapcia@tigase.net added "Related" #1365 4 months ago
wojciech.kapcia@tigase.net added "Related" helpdesk/helpdesk-priv#1167 4 months ago
Please wait...
Page is in error, reload to recover