It could be over something such as a serial connection or an ethernet connection as well that might not be as stable as well as just being slow.
Next is resource limited. So if you've ever worked with these sorts of edge devices and teams that are working more closely with the hardware side, you'll know that there are a lot of resource restrictions on these devices. And so if you try to build a traditional web application or React application, let's say it's maybe like 500 kilobytes large or 300 kilobytes large, they'll come to you and say like, oh, you know, we don't have the space physically on the device to store your application, let alone the server that serves your application to the client side. So there are a lot of resource restrictions that come with deploying applications to these edge devices.
Then there's unnecessary storage of application assets that goes in hand with the resource restrictions. So if you want to have images or videos or docs or PDFs or whatever, any sort of static asset, you run into the issue with that just the storage resource restriction on the device. Then there's heavy network traffic for first paint. So if you're structuring it like a traditional web application in combination with the slow or unstable network connection, if you have multiple network requests going back and forth through to retrieve multiple resources, your application could either lag or could just, you know, potentially break if the connection becomes really, really unstable. So that's another issue.
And lastly is if again, if you've worked with this sort of platform or deploying applications to these sorts of embedded platforms, you'll know that any sort of upgrade, whether it's to the UI or to the firmware, requires a firmware upgrade because the web application is stored and hosted and served from the embedded device. And I don't know about you, but I don't know when the last time was that I upgraded the firmware on my Wi-Fi router, for example, or even my motherboard on my PC. And, you know, that causes a lot of issues, you know, in the current situation where there's a lot of CVEs coming out like we've seen in the past year, addressing those or fixing those can require a really large lift from your user. And that's just an issue that comes with hosting the application on the embedded device.
So how do we address all these issues, all these problems I just stated? Well, we can leverage PWAs or progressive web apps. So in theory, it's pretty simple. All you really do is you deploy your web application to a cloud service like you traditionally would. You provide some instructions to your user on how to save the application as a progressive web app onto their respective device, and then it becomes cached on that device. And then they go ahead and they start a connection to your firmware, your edge device, and through the PWA, just establishes a connection and starts to populate the UI or the interface with the data from your edge device. And it's just as simple as that. At the end of the day, by doing this, the edge device becomes really simple because it's just a thin API that serves data as opposed to a full web server that serves a web application. It improves the SCP, the first Contentful Paint, for the application because it's cached on your client's device. There's no resource restrictions because everything's on your client device that has more RAM and more storage. It's easier to update the application UI because you just make your change and you deploy it to your cloud service. And the PWA, you'll set up a Service Worker that will look for updates from that cloud service, that cloud server, and it will pull those latest changes once a regular network connection is established. And lastly, it frees up resources on the edge device, which is amazing because your firmware team will really love it because it'll give them more space for logs or just other critical applications on the firmware, the edge device. So that's PWAs. And I won't go into the details of developing PWA because it really varies depending on the framework that you're using. But I would say most of the, if not all of the large frameworks or popular frameworks that are out there support PWAs with some really simple configuration. Even Vite does, for example, and that's just like a Vite plugin that you then configure.
Comments