-
Notifications
You must be signed in to change notification settings - Fork 31
General architecture & patterns for status react #31
Comments
User Stories1. Re-frame database shape is reflecting the the app access patterns (writing for handlers, reading for subscriptions) by correctly indexing for fast lookups and normalised storage for fast, consistent updatesWhen designing the data-structure of re-frame app-db, always have in mind how the data will be accessed and how it will impact performance and consistency. Current situationSome derived data are stored in db and recalculated explicitly (tags for discovery statuses). But the most problematic thing is proliferation of data indexed by message-id ( 2. Subscriptions form efficient signal graph, with minimal amount of Level-1 subscriptions and highest possible re-use of all subscriptionsThere is not much to elaborate on this, whenever some subscriptions needs input, always check if the input is not already provided by another subscription, so you won't be creating another Level-1 subscription when absolutely not necessary. Current situationSome subscriptions are essentially duplicated, and there are cases where subscription function takes whole app-db as argument, even when not necessary - https://github.com/status-im/status-react/blob/develop/src/status_im/chat/subs.cljs#L109-#L114 3. All the events in application are related to outside inputs and there are no artificial intermediate events anymoreThis is maybe the most ambitious task of the whole idea. The vision is to only have such events, which naturally maps to asynchronous input from "outer world" into our application. Good examples are user actions (typing, swiping), network callbacks, callbacks from phone modules (camera, permissions, etc.).
Possible problems are that when you try to combine data from multiple coeffects consuming and effects producing functions, it will get non-trivial, for example sometimes you have to check for Current situationThere are some namespaces where the approach above was already started (for example 4. Co-effects and effects are isolating the side-effects everywhere and we re-use them to highest possible degreeCo-effects but most importantly effects only capture the essence of the side-effect operation (realm op, network call, etc) and nothing else, they are not highly specific and don't contain much logic. Current situationAlthough we moved to |
I can pledge some of my time that I spend in idea 9 since the two seems closely related |
Closing this as it hasn't been touched in ~3 months. Feel free to re-open if this is something that we are going to tackle soon |
Preamble
Summary
Define and adhere to architecture vision for status react. Have all the best practises clearly defined in one place.
Vision
Our architecture (shape and organisation of data + code) is not optimal, what's worse it's nowhere clearly defined and discussed about. The purpose of this Idea is to improve it by identifying all the problematic parts of our current architecture, capture them as user stories, fix them and properly document it for future reference.
Swarm Participants
Requirements
Goals & Implementation Plan
Minimum Viable Product
Goal Date: 2017-12-08
Description:
Iteration 1..N
Goal Date: 2017-12-08
Description: Requirement 1 should be done
Goal Date: 2017-12-24
Description: Requirement 2 should be done
Goal Date: 2018-01-14
Description: Requirement 3 should be done
Goal Date: 2018-02-07
Description: Requirement 4 should be done
Supporting Role Communication
Post-Mortem
Copyright
Copyright and related rights waived via CC0.
The text was updated successfully, but these errors were encountered: