Last active
July 24, 2017 16:46
-
-
Save janherich/c0cddd44e0e679b3414b3e0ea1a3abd2 to your computer and use it in GitHub Desktop.
Database denormalisation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Subset of current db structure | |
{:chat-animations | |
{"console" | |
{:parameter-box | |
{:height 300 | |
:changes-counter 17}}} | |
:chat-loaded-callbacks | |
{"console" nil | |
"wallet" nil | |
"mailman" nil | |
"browse" nil | |
"demo-bot" nil} | |
:chat-ui-props | |
{"console" | |
{:prev-command "password" | |
:show-suggestions? false}} | |
:chats | |
{"console" | |
{:updated-at "timestamp" | |
:messages [{:message-status "seen" | |
:message-id "someid1"} | |
{:message-status "seen" | |
:message-id "someid2"}]}} | |
:message-data | |
{:short-preview | |
{"someid1" nil | |
"someid2" nil} | |
:preview | |
{"someid1" nil | |
"someid2" | |
{:markup [:text {:style "!important"} "msg2"]}}}} | |
;; Subset of proposed new db structure | |
{:message-by-id | |
{"someid1" | |
{:message-status "seen" | |
:message-id "someid1"} | |
"someid1" | |
{:message-status "seen" | |
:message-id "someid2" | |
:preview | |
{:markup [:text {:style "!important"} "msg2"]}}} | |
:chat-by-id | |
{"console" | |
{:chat-animations | |
{:parameter-box | |
{:height 300 | |
:changes-counter 17}} | |
:chat-loaded-callbacks | |
{} | |
:chat-ui-props | |
{:prev-command "password" | |
:show-suggestions? false} | |
:updated-at "timestamp" | |
:messages [[:message-by-id "someid1"] | |
[:message-by-id "someid2"]]}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@janherich Looks great! Definitively the right direction. Not so sure about the
-by-id
suffix.