For my app goodMatches I have been working on DTOs… hard. Well you may ask what they are, Data Transfer Object is just a form of data rendered easier to move between client and server. The more I work on them, the more unimpressed I become on the state of our ‘modern technology’. Rather, as a non-hardware man, I keep realising how physical the world is.
There are too many hyped but nebulous concepts like ‘cloud’ (well sorry for the pun) and honestly, AI, that mask the physical reality. Cloud computing is not really about the cloud but much is done in the subterranean cables and data centres in California. Building AI models requires lots of GPUs, largish processing units, and hence, lots of real spaces somewhere I’m sure, and hence, ‘rare earth’ which may even cause a war.
OK I get digressed. The point is this. We have a small device. We have a large server somewhere pretty specific, say Silicon Valley. To move stuff between them isn’t easy. Simply because of the mundane physical constraints. To get stuff through the tube. At this time and age.
This reality becomes more pressing for communication between devices. Well, this isn’t really ‘between’ them. You type a word on a device and press send. The word appears in your friend’s device who may be just beside you. More or less instantly. That gives you the illusion it’s some direct transfer. But no, it first travels to some server, itself a long and winding journey, and then gets sent to your friend’s device. A likely long haul overseas trip. You may also want to send it to other people, meaning more trips. It goes through tubes many times. Thus, the ‘leanness’ of the data is paramount. Hence DTOs.
When I fancifully decided that my app’s next feature would be ‘live sync’ between devices, I totally underestimated this transfer aspect. I just tried to send the data ‘as is’, when I hit the truth. Just a set of matchups, yes, but the app contains a ‘queue’ of forthcoming candidate matchups. It also has results and ratings which need updating. Trips multiply, making the time issue so severe. I soon downgraded the next task to ‘simply’ saving the data on server so that you can recover when the app crashes (which I find can happen under memory pressure). Even this wasn’t easy. It required reducing duplication. Improving efficiency. Designing and re-designing DTOs many times over. Making the data itself smaller. Batching the processes. I ended up reconstructing a very large chunk of the app. It took me a month.
I can proudly announce therefore this remarkable feature of… saving. You can restore your current matchups in an unfortunate event of a crash. If not a giant leap but it’s a small step to a shiny feature, live sync. Watch this space.
