Devlog 7 - There is always a Solution
Focus V/S Feature Dilemma
- I thought it would be a cool feature addition to display the current resource consumption
(CPU/RAM)and some other system details of the computer right on the mobile app. - but my concern was that these features are basically
"extras"and I really didn’t want toslowdown my core functionality. - I was about to drop the idea entirely, but at the last minute I decided to ask
Geminiabout it and guess what? There isalways a solutionI mean, what did I expect? Its engineering after all
Smart Subscription Architecture - the solution
- well, my main concern was the wastage of resources and WebSocket bandwidth, which might bottleneck my main selling point: ultra low latency under 5ms control command communication
- But this architecture perfectly solves that.
- so basically, the server will only blast data at me if I am explicitly subscribed to it. Otherwise, it sleeps.
- and since this project uses WebSockets on a local network, there is generally only one user. So, if I unsubscribe from the service (like closing the telemetry component), that particular data broadcast will completely pause, saving precious resources on both the mobile client and the computer server
- forgot to mention : the server updates this system data every second if user is subscribed, else sleepyy
The Scalability FOMO
I am well aware my app won’t probably be used by more than 10 people for 10 minutes, but my Senior Software Engineer came shouting -
“Your current method to render different views, that too without using
react-router, it will become scalability issue as application grow”
-
in my initial
HL system designi was going to use a single page and conditional rendering for different layouts on same page to avoide a package i decided not to use thereact-routerfor my client web page -
but now i have like 5 pages and as i am building i keep getting more and more ideas…
-
I fixed this issue by
- creating a standard state for different viewModes and changing props/types to support it (nothing just some painful refactoring)
- implementing a
component mapping(view registry) for all the views. Now I can just plug in any number of views without writing spaghetti if/else statements.
The important thing is as i am not using the react-router, i will to keep an eye on memory and
component lifecycleto free up the space inmemoryfrom components which are not in view.
I should have used react-router from beginning 😭
I am thinking to add a button to force kill a process from the phone, but again i am standing at a point where these features are kind of feelign like extras and note my core application
- attached image of the QR code that i use to pair the mobile with the computer, will add some security in future
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.