Skip to content
ImagineWorld

Designing Your Own Edge Computing System

node_idnode-book_edge-computing-systems-with-kubernetes_chapter-15-designing-your-own-edge-computing-system
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num15
chapter_titleDesigning Your Own Edge Computing System
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 15 — Designing Your Own Edge Computing System

Section titled “Chapter 15 — Designing Your Own Edge Computing System”

Sometimes, the success of a project is not the technology – it is the way that you design and execute it. Edge computing systems can start as a small startup idea, so you can use it to reference the lean canvas business plan template to do the first draft of the idea that you have to create the system. But what if we have some similar template adapted to edge computing? This is where the Edge Computing System Design Canvas can help you. The idea of this diagram is to give you a tool to create the first draft of all the things you need to create an edge computing system, and you can consider the chapters of this book as building blocks to create your own. In this chapter, we are going to explore cloud providers that you can use to host your services, some best practices to take into consideration, software that you can explore to build your edge computing system, and other use cases that you can explore to create a system if it’s not covered in this book.

In this chapter, we’re going to cover the following main topics:

  • Using the edge computing system design canvas
  • Using managed services from cloud providers
  • Existing hardware for your projects
  • Exploring complementary software for your system
  • Recommendations to build your edge computing system
  • Exploring additional edge computing use cases

For more details, check out this resource on GitHub: https://github.com/PacktPublishing/Edge-Computing-Systems-with-Kubernetes/tree/main/ch15

Using the edge computing system design canvas

Section titled “Using the edge computing system design canvas”

The edge computing system design canvas is based on the lean canvas business plan template, with the idea to have a tool to help people create and organize their edge computing systems by filling in a sheet of paper with what they need to start building their systems. Let’s take a look at the different areas that our canvas template covers:

Figure 15.1 – Edge computing system design canvas

Our template covers 14 areas that you can consider while designing the systems. First, you have to define the purpose of the system and the features to implement. Then, while filling this template, you can annotate in parallel the challenges, people, and costs to build the system. After that, you can define whether you are going to use automation in your system. In this category, we can talk about CI/CD pipelines and versioning. Later, you have to define how to manage your data, in which format, and then what security practices you are going to implement. The last two sections include what you are going to run at the edge and what type of devices and sensors you will use. Finally, you have to define which parts of the system are going to run in the cloud, how to communicate between the edge and the cloud, the metrics to collect from the edge, and which metrics are going to persist at the edge or in the cloud.

Now, let’s explore some questions that you can use to fill in this sheet of paper. The idea is that you must fill it in no more than 10 minutes, similar to how the lean canvas works.

As you know, you have to define why you want to build this system – that is, the main reason for this system to exist. You can discuss the following questions with your team:

  • What is the purpose of the system?
  • What is it going to do?
  • What problem will it resolve?

Here, you can list the top five features of your system. You can describe them in terms of the functionality of system attributes such as availability, reliability, and so on. Some questions that you can ask are as follows:

  • What are the main features of your system?
  • What functionalities do these features bring to the clients?
  • What are the unique features of this system?

Here, you have to detect the happy paths and potential blockers to build your system. Some questions that you can ask are as follows:

  • What are the challenges of running software at the edge or in the cloud?
  • What challenges will be faced when edge devices communicate with the cloud in the system?

You can complement these questions with other ones that evaluate the level of complexity of other technical areas to build the system.

Here, you have to evaluate people that are working in the system and define basic skills for future hiring. You can ask questions such as the following:

  • What are the necessary skills to build the systems?
  • How many people are necessary to build the system?
  • How will the project be managed? Will this be in quarters, semesters, 2-week sprints, or in another way?

Here, you have to calculate possible costs to buy hardware, run third-party services, and more. You can ask questions such as the following:

  • What is the cost of my devices?
  • What is the cost of my sensors?
  • What is the cost of my cloud provider?
  • Who are my hardware providers?
  • What additional costs do I have to consider?

Here, you have to evaluate the automation processes and code versioning. This is where you can fill in all the things related to CI/CD pipelines, data pipelines, GitOps, testing, and more. You can ask questions such as the following:

  • What process is going to be automated?
  • How will code versioning be implemented?
  • Do you need CI/CD or GitOps?
  • How will software testing be implemented?

Here, you have to define how to manage data. This includes the format, databases, data ingestion, storage, and more. You can ask the following questions to define how to manage data in your system:

  • Does the system use NoSQL databases?
  • Does the system use SQL databases?
  • What type of data (JSON, CSV, and so on) the system is going to use?
  • What characteristics does my database need? This includes high availability, persistence, concurrency, partition tolerance, and others. You can use the CAP theorem to choose the best database to fit your needs.

Here, you can evaluate the security of data and the services. This book doesn’t cover this topic in particular, but you can ask the following questions to evaluate some minimal aspects of security within your system:

  • Which security strategies are going to be implemented in your system?
  • Where does data encryption need to be used in the system?
  • How does system authentication work in the system?

In this section, you have to list and decide which devices are going to run at the edge. Here, you can find ARM devices and edge clusters. You have to decide which technologies you are going to use to run on your edge devices. You can ask the following questions to evaluate this:

  • What is going to run at the edge?
  • Which software is going to run on your devices?
  • Does the system need a single or multi-node cluster running at the edge?
  • Does the software run using virtual machines, containers, binaries, or something else?

This section is related to listing the possible devices to use in your systems and the additional hardware that you can use with them. You can ask the following questions to gather an initial list of possible devices that you can use:

  • What type of processor will your devices use? ARM or x86_64?
  • What additional hardware does my device need to use?
  • How will the devices be powered? Using batteries or DC?
  • How will the devices manage local time?
  • What amount of memory for your firmware and data storage will be available for your device?

The goal of this section is to list possible sensors and how to get data from them. Then, you must transform this information into metrics or variables to measure the environment. You can use the following questions to analyze the things related to sensors:

  • Which sensors are you going to use?
  • What are the sensors going to measure?
  • Do the sensors need a source of power? What type of power do they need?
  • How will the sensors be calibrated?

This section is designed to evaluate which parts of the system have to run in the cloud, what managed services you are going to use if necessary, and if there are third-party services that could be used to reduce and simplify the time implementation of your system. To evaluate this, you can ask the following questions:

  • What cloud provider fits your system needs the most?
  • What managed services does the system need?
  • Are there any third-party services that could be critical to use in the system?

This section is the result of communicating with the edge and the cloud layer. This is where you will define how the layers will communicate with each other, which protocols you are going to use, whether the communication is in real time or not, and whether your devices will use special protocols to communicate with each other. To fill in this section, you can ask the following questions:

  • How will the edge devices transfer data to the cloud?
  • What type of communication is going to be used to communicate with the edge devices and the cloud? This could be sockets, the REST API, gRPC, and so on.
  • Does the system use Lora, Wi-Fi, Bluetooth, Sigfox, or other protocols to communicate to your devices at the edge or on the cloud?
  • Will the communication be synchronous or asynchronous to store data?

Your sensors at the edge generate data that will be transformed into metrics to be shown in a dashboard. However, these metrics to be defined. The goal of this section is to define the metrics to use and visualize them. These metrics are created using the edge recollected data. To define these metrics, you can ask the following questions:

  • What type of metrics is the system going to collect? Golden metrics, weather metrics, or something else?
  • Which metrics will be generated and used in the system? This can include latency, temperature, speed, and so on.
  • How is the system going to visualize the collected data?
  • Is the system going to use dashboard software to visualize data, such as Grafana or similar?

Please use the different chapters of this book as building blocks to create your system. You can use the templates at https://github.com/PacktPublishing/Edge-Computing-Systems-with-Kubernetes/blob/main/ch15/docs/EdgeComputingSystemDesignCanvas.pdf that are ready to print and design your edge computing system. Now, it’s time to look at the relevant managed services from the top three cloud providers.

Using managed services from cloud providers

Section titled “Using managed services from cloud providers”

It is important to choose the right cloud provider. Several cloud providers are available, but the top three are Amazon Web Services (AWS), Google Cloud, and Azure. Let’s look at the different managed services that you can use with these cloud providers:

  • AWS: You can use virtual machines with EC2 and Graviton 2 ARM instances to test software that you will run at the edge. Fargate is a service that you can use to deploy applications in containers. It provides several options. For instance, you can scale the service automatically, something similar to what Kubernetes does. Elastic Kubernetes Service (EKS) is the managed service of AWS for Kubernetes. It’s a very strong solution for EKS, but compared to other services, you have to do more manual steps for certain tasks, such as scaling the solution. Talking about databases, you can use Aurora as a MySQL or Postgres instance. You can use other managed services based on Redis or Elastic Cache. For file storage, you can use S3 services. Finally, for complete serverless solutions, you can deploy Lambda functions, which run small portions of code on demand. AWS also has an IoT platform to connect devices running at the edge. AWS offers some certified devices to work with its platform. The official website is https://aws.amazon.com.
  • Google Cloud: This cloud provider includes virtual machines, which are the same as AWS EC2 instances. This service is part of the Compute Engine services called VM instances. Google Cloud also offers ARM instances via the Tau instance type. It provides the Cloud Run service, which runs containers, and Google Kubernetes Engine (GKE), which is a Kubernetes-managed service that is simpler to manage than EKS, and it’s a much more stable solution. For databases, you can use Memory Store, a self-managed Redis service, and Cloud SQL, which is similar to AWS Aurora. However, in terms of databases, Google has less prebuild options than AWS, though it works pretty similarly. It can run as MySQL, Postgres, and SQL server. It has its own way to manage storage using cloud storage and works similar to S3 by using buckets to store information. Finally, it also has a serverless capability with Cloud Functions, which are similar to AWS Lambda. One of the main differences in Google Cloud is that its service definitions are compatible with open source projects. For example, Flask is compatible with Cloud Functions, and Cloud Run is compatible in some way with Knative. One of the major advantages of using Google Cloud is its compatibility with open source projects. Google Cloud also has its own IoT solution, similar to AWS, but it also works with some open source hardware and devices, such as Coral USB Accelerators or the Coral Dev Board. The official website can be found at https://cloud.google.com.
  • Azure: This feels like a combination of AWS and Google Cloud and provides similar tools. It has virtual machines services, and it also supports ARM processors with the Dpsv5 and Epsv5 instances. It also has Azure Kubernetes Service (AKS), which is the managed Kubernetes service for Azure. AKS has some disabled features that are a little bit complicated to configure, even with the correct configuration, so it feels less mature compared to AWS and Google Cloud. It is also a little bit more expensive, but it depends on the quantity and size of cluster nodes that your system needs. AKS is less mature than AWS and Google Kubernetes managed services. Azure also has Azure Container Instances, which are used to run containers such as AWS Fargate and Google Cloud Run. For databases, it offers Azure Cosmos DB, which provides a database-managed service such as AWS Aurora or Google Cloud SQL. This database offers compatibility with Cassandra, SQL Server, MongoDB, and Gremlin, which is similar to Neo4J. Cosmos DB is more like the NoSQL version of Aurora and Cloud SQL. It also has an enterprise Redis service by default. Talking about serverless functions, it provides Azure Functions, which support languages such as Python and TypeScript, and some proprietary languages owned by Microsoft such as C# and PowerShell scripting. Azure in the context of IoT has more options to connect your devices and has a lot of certified hardware designed to run with Azure. It feels like this platform is frequently innovating. The official website can be found at https://azure.microsoft.com.

For this specific kind of book, you can also consider the Civo cloud, which provides a managed K3s service that you can use to play around with K3s. The official website can be found at https://www.civo.com.

Important Note

Take a look at the official website of each cloud provider for updates about their current services.

All this information was just a brief introduction to what these cloud providers offer, so not all the facilities of each cloud provider have been covered. Maybe you are thinking about who the best cloud provider is. The answer depends on what you prefer for certain solutions because of current service contracts, previous software adoption, and so on. Some cloud provider services are better in some situations than others, and your team will have to spend some time evaluating this. The cost of a service can change depending on the size of the services on each cloud provider. To help with your decision, you can think about the following questions:

  • Is the managed services price of the provider fair to substitute for a self-managed service that the system is planning to use?
  • Is the learning curve of the managed service adoption worthwhile and will it affect the deadline of the project?
  • Does the cloud provider include the majority of services that need to be implemented in the system without using another cloud provider?
  • Does the cloud provider include support and good documentation to use their services?
  • Does the adoption of the selected cloud provider allow you to keep running your applications without you having to make many modifications to the source code of your application?

These are some questions that you can ask the team of your project, and they could act as a good starting point to evaluate a cloud provider. Now, let’s explore some hardware that you can use in your edge computing systems.

There is plenty of hardware that you can use for your edge computing projects. Let’s look at a small list of hardware that you can use for your projects. The following list includes microcomputers such as the Raspberry Pi and microcontrollers such as Arduino:

  • Coral Dev Board: This is a board designed by Google that uses the Coral Accelerator to run ML applications. It is a reasonable size and provides processing power to run machine learning applications. For more information, check out https://coral.ai/products/dev-board.
  • Rock Pi: This device is similar to a Raspberry Pi but includes a Mali GPU, which can be used to process machine learning applications. It also has other board versions that you can use to run at the edge. For more information, check out https://rockpi.org.
  • Pine64: This is a community platform that creates boards that have ARM processors. It also has another product that can be used at the edge, similar to the Raspberry Pi. For more information, check out https://www.pine64.org.
  • ESP32: This is a commonly used microcontroller that you can program to read information with sensors at the edge. There are plenty of distributors with a lot of variations of the ESP32 that already integrate sensors. For more information, check out https://heltec.org/proudct_center/esp-arduino.
  • MicroPython: This board is designed to run Python. It has a lot of features that can be used to quickly prototype a device to capture data at the edge. For more information, check out https://micropython.org.
  • NVIDIA Jetson Nano: This device is designed by NVIDIA and has a powerful GPU. It has a lot of power to run processes and it could be a good option for running intensive tasks, including machine learning. For more information, check out https://developer.nvidia.com/embedded/jetson-nano-developer-kit.

Note that there are devices that could just be used to prototype a solution, though it is not recommended to run them in a production scenario. Check out the Further reading section to find other devices. Now, let’s explore some complementary software that you can use at the edge to create your system.

Exploring complementary software for your system

Section titled “Exploring complementary software for your system”

There are other pieces of software that you can use if some of the examples in this book don’t fit your system needs. Some examples are as follows:

  • Crossplane: This is used to deploy infrastructure using Kubernetes. Crossplane can give you the abstraction to do this. For more information, check out https://crossplane.io.
  • Thanos: This is a Prometheus cluster that you can use to scale your Prometheus services. For more information, check out https://thanos.io.
  • Argo: This is a whole ecosystem that you can use to implement GitOps, workflows, and event management. It is a powerful piece of software. Argo can also run on ARM devices. For more information, check out https://argoproj.github.io.
  • Containerd: If K3s is too big for your solution, then you may wish to use containers. Containerd can give you this abstraction without extra services. For more information, check out https://containerd.io.
  • Rancher: This is a Kubernetes distribution that you can use to manage all your clusters at the edge so that you can have a single dashboard application to manage and monitor all your clusters in a single place. For more information, check out https://rancher.com.
  • KubeSphere: This is similar to Rancher but has a different approach so that it’s more developer-friendly; Racher is more operations-friendly. For more information, check out https://kubesphere.io.
  • OpenEBS: This is an alternative to Longhorn that has pretty good support and options for storage. For more information, check out https://openebs.io.
  • KubeEdge: This is a modification of K3s that’s used to distribute your nodes across the cloud and the edge. It also supports MQTT protocols. For more information, check out https://kubeedge.io.
  • Akri: This is a Kubernetes resource interface that can easily expose your devices in the tiny edge, such as cameras or USB devices, as resources in a Kubernetes cluster. For more information, check out https://docs.akri.sh.

You can also explore the graduated, incubated, and sandbox projects of CNCF at https://www.cncf.io and the landscape at https://landscape.cncf.io to explore more options that you can add to your project. Now, let’s continue with some useful recommendations when creating your system.

Recommendations to build your edge computing system

Section titled “Recommendations to build your edge computing system”

Here is a list of recommendations that you can consider when designing your edge computing system:

  • Take your time when designing the system. You can do this on paper, which will save you a lot of time when building your system.
  • Measure the progress of building your system. Without measure, there is no pressure. You can use the Scrum and Kanban agile methodologies to manage the progress of your project. It’s very important to plan.
  • Invest time in making a proof of concept (POC) after deciding which technology, cloud provider, or a third party you will use. This will be critical to have a constant process when building your system.
  • Invest time in documentation. This is the only way you don’t lose knowledge if someone has left the job.
  • Version the code of your projects. This is a healthy best practice to ensure you don’t lose important code in your project.
  • Use encryption. Evaluate the places where you can find sensible data in the system and encrypt it.
  • Use secrets as a general rule. This book contains a lot of examples that don’t use secrets to simplify the examples. However, in a real-world scenario, using secrets is a must.
  • Think as a hacker. Sometimes, you have to think about the worst-case scenarios to consider how people can steal your information.
  • Invest in professionals with experience but don’t forget newbies. When hiring people for the project, pay attention to the experience that someone in the team can give you but remember that the youngest talents could have innovative ideas.

With that, you have a set of recommendations for building an edge computing system. Next, let’s explore other use cases for edge computing.

Exploring additional edge computing use cases

Section titled “Exploring additional edge computing use cases”

To finalize this book, here are some use cases that you can explore and implement using edge computing technologies:

  • Healthcare: In this system, data could be processed or analyzed locally. Sometimes, this information could be processed using artificial intelligence. This system can integrate local sensors and process information at the edge.
  • Industry 4.0: This is related to the use of edge computing and IoT for manufacturing processes, where you can process information at the edge with ARM devices to reduce latency when interconnecting systems and data processing.
  • Autonomous vehicles: This industry is constantly growing with the emerging market of electric cars. This use case employs cameras, augmented reality, and computer vision with the goal of cars driving autonomously.
  • Gaming: This use case focuses on sharing the processing between the cloud and high-end user devices such as consoles to reduce the lag of video games.
  • Security: In security use cases, cameras could be used for monitoring and detecting dangerous behaviors in people or to prevent robberies. These kinds of systems usually use object detection and artificial intelligence for this purpose.
  • Agriculture: This could be applied to smart farms or gardens, to monitor plants and perform actions such as watering. This use case has some contact with IoT technologies and long-distance protocols such as LoRa.
  • Smart cities: This use case has a lot of applications, such as smart traffic, which consists of monitoring traffic and its safety, thus improving the traffic flow in a city.
  • Logistics: This use case improves the delivery time of packages, optimizes delivery routes and fuel consumption, and so on. This could present a competitive advantage for companies in the market.

There are plenty of other use cases that you can explore. Check out the Further reading section for more information. Now, let’s summarize what we have learned in this chapter.

In this chapter, we learned about some complementary content for designing and implementing edge computing systems. First, we covered an edge computing system design canvas and asked some useful questions that could be used to quickly start designing your system. After that, we explored the top cloud providers with managed services that can be used with edge computing systems and some hardware that can be used for this purpose. Finally, we looked at some complementary software to use as recommendations and other use cases to explore. With all this information, you can organize and quickly start building an edge computing system. This content could be useful for organizing all the ideas behind your edge computing systems. Thank for reading this book – I hope you enjoyed it.

Here are a few questions to validate your new knowledge:

  • How can you use the edge computing systems design canvas to design an edge computing system?
  • What cloud providers can you use to complement your system?
  • What complementary software or hardware you can use to build your system?
  • What other use cases can be implemented with edge computing?

Please refer to the following references for more information on the topics covered in this chapter: