https://bencane.com/cell-based-architecture-explained-with-zombies-f5e814d3e5d2 Open in app Sign up Sign in [ ] Write Sign up Sign in [1] Cell-based Architecture Explained, with Zombies Benjamin Cane ITNEXT Benjamin Cane * Follow Published in ITNEXT * 6 min read * 4 days ago -- 2 Listen Share Image Generated by AI What do Cell-based Architectures and Zombies have in common? Absolutely nothing, until today, that is. If you've been reading about cell-based architectures, you've come across the bulkhead of a ship analogy. While it's a good analogy, it loses people. Today, I will explain Cell-based Architecture differently by introducing Zombies to the story. [?] The Scenario: A City Under Siege Let's pretend that the world is on the brink of a Zombie Apocalypse, and we are responsible for figuring out how to keep an entire City from becoming Zombies! We will design our city to be Zombie-resistant! We want to: * Reduce potential for exposure to Zombies. * Limit the impact when Zombie exposure happens. * Avoid everyday citizens from dealing with Zombies and leave that to trained professionals. * Ensure the city is prosperous and operates smoothly. [?] Designing the City: Avoiding Total Collapse With our goals in mind, let's start to understand our design. The first gut reaction would be to put defenses around the city to prevent Zombies from entering. But everything has flaws, and these defenses will fail eventually. If our defenses failed and our critical infrastructure, like the Hospital, Grocery Stores, etc., were to be compromised by Zombies, it would only be a matter of time before the Zombies spread throughout the city. A single protected city is just not practical. We must prevent a single failure from taking down the whole town and isolate those failures (like Cell-based Architecture). [?] The Solution: Isolated Neighborhoods (Cells) Rather than creating one big isolated city, we can create several isolated neighborhoods with critical infrastructure and defenses. Our citizens will be distributed to these neighborhoods so they can stay safe. The idea is that everyday citizens can remain in their isolated neighborhoods and live their best lives without being exposed to zombies. We need to ensure that everything citizens need is in this neighborhood to avoid travel. * Grocery Stores * Restaurants * Medical Centers/Hospitals * Offices * Entertainment * Coffee Shops?!? * Etc. Leaving the neighborhood is dangerous, but within the neighborhood, everything is close by, readily available, and zombie-free. Supply Routes: Keep the Neighborhoods Stocked Of course, if supplies for these critical services run out, citizens will be forced to leave the neighborhood. We don't want them to leave. So, to avoid them leaving, we will have a group of trained professionals responsible for moving supplies from our Farms, Manufacturing, etc., to the Neighborhoods. It's vital to ensure these facilities are never short of supplies. Controlled Travel: Safe & Resilient Routing These Neighborhoods may get crowded. As new citizens arrive, we may need to reroute them from one neighborhood to another if the original doesn't have enough capacity. So, like the supply routes, we'll need to set up a special group of trained professionals who can safely transport our citizens across neighborhoods. This transportation group can also monitor the neighborhood's services; if any are down, it can transport citizens to another neighborhood. Traveling via this unique group is not without risk, but since they are specialists, they have experience. In contrast, traveling without this unique group is dangerous and prone to Zombie encounters. Why does this design work? Isolated neighborhoods ensure that citizens rarely leave, reducing exposure to Zombies and increasing our city's resiliency. We avoid overcrowding and create safe intra-neighborhood travel through our transportation network. We also avoid the desire to leave the neighborhood with our supply routes, ensuring each neighborhood has everything it needs. But as anyone who has watched a Zombie movie can tell you, everything fails. The real key to this design is the limited impact a Zombie can make. If a single Neighborhood had an incident where a Zombie snuck through, while that neighborhood would be in big trouble, the rest of the isolated neighborhoods would continue to operate as usual. Traveling to the infected neighborhoods would not be permitted, but travel could resume once those neighborhoods are safe. Scaling: Expanding the City by Adding More Cells With the city's success, more and more citizens will want to live in these safe neighborhoods, which leads to another benefit of this design. As more capacity is needed, we have a working blueprint; we can create new ones, establish the supply and transportation routes, and direct new citizens there without disrupting existing infrastructure. Cell-based Architecture = A Zombie-resistant City Our City design followed a cell-based architecture. Each Zombie-resistant neighborhood was a cell, and the schools, stores, and hospitals within a neighborhood were our microservices, databases, and caches. Keep Traffic Local: Avoiding Transit Failures The goal of the neighborhood was to provide everything citizens needed and avoid citizens leaving the boundaries. The idea behind cells is that each cell can fully service requests within the cell, eliminating external calls from the cell. Because, like our Zombie example, leaving the cell is dangerous. An army of firewalls, unreliable networks, and unreliable services can drop a request anytime. Data Population: Put Data Where it is Needed Like our neighborhoods, cells need supplies. However, a cell's supply route doesn't provide food or medical supplies; it supplies the data used during processing. The supply route is a cell's data replication strategy. Data replication might occur between cells, from a central hub, or both. The goal is to ensure that neighborhoods and cells have what they need before they need it. Traffic Controls: Distribute Load & Route Safely The inter-neighborhood transportation is the infamous "cell router." A cell router is responsible for detecting failure within a cell (Zombie outbreak) and rerouting requests (Citizens) to other neighborhoods. While leaving a cell is always dangerous, there are ways to mitigate those dangers (e.g., retries, circuit breakers, priority load balancing). The cell-router is where you place an extra emphasis on these techniques. Failure Isolation: Limit the Blast Radius of Failure A core concept of cell-based architecture is isolation from failures, just like our neighborhoods. You decentralize services into each cell rather than having centralized services, where a centralized service failure can cause widespread outages. When a service fails, only that cell is affected; all other cells continue to operate normally. Wrapping up Hopefully, the Zombie analogy will help explain the concept of cell-based architectures. TL;DR: Instead of one big system, split it into isolated cells to improve Resilience (keeping failures contained), Performance (keeping data local & avoiding network latency), & Scalability (copying and pasting new cells to add capacity). Have you had a hard time conceptualizing Cell-based Architecture? Can Zombies teach us more about designing resilient systems? Software Engineering Software Development Cloud Programming Coding -- -- 2 ITNEXT ITNEXT Follow Published in ITNEXT 68K Followers *Last published just now ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies. Follow Benjamin Cane Benjamin Cane Follow Written by Benjamin Cane 1K Followers *39 Following Builder of payments systems & open-source contributor. Writing mostly micro-posts on Medium. https://github.com/madflojo Follow Responses (2) See all responses Help Status About Careers Press Blog Privacy Terms Text to speech Teams