{"id":80,"date":"2024-03-01T18:00:00","date_gmt":"2024-03-01T18:00:00","guid":{"rendered":"https:\/\/permutationcity.co.uk\/bp\/?p=80"},"modified":"2024-03-01T13:02:28","modified_gmt":"2024-03-01T13:02:28","slug":"interconnection-complexity","status":"publish","type":"post","link":"https:\/\/permutationcity.co.uk\/bp\/2024\/03\/01\/interconnection-complexity\/","title":{"rendered":"Interconnection complexity"},"content":{"rendered":"\n<p>This problem is sometimes referred to as communication complexity and can be a problem for teams.\nIt also has implications for systems architecture and probably elsewhere.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"team-problem\">Team problem<\/h2>\n\n\n\n<p>One person by themselves doesn&#8217;t have to worry about synchronising their work with anyone.\nThere is no communication overhead.\nOn the other hand, it&#8217;s just one person so big tasks will take a long time.<\/p>\n\n\n\n<p>Growing the team means there are more people to do the work but\nchecks must be made to ensure everything is compatible.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">People<\/th><th class=\"has-text-align-center\" data-align=\"center\">Checks<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">0<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td class=\"has-text-align-center\" data-align=\"center\">10<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><td class=\"has-text-align-center\" data-align=\"center\">15<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">7<\/td><td class=\"has-text-align-center\" data-align=\"center\">21<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">8<\/td><td class=\"has-text-align-center\" data-align=\"center\">28<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">9<\/td><td class=\"has-text-align-center\" data-align=\"center\">36<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>More people means exponentially more checks. More time being &#8220;wasted&#8221; on coordination.\nOf course is not really wasted but it <em>is<\/em> a cost that comes from having larger teams.<\/p>\n\n\n\n<p>The exact nature of the checks depends on the work that&#8217;s being done.\nIt could be one on one conversations between developers.\nIt could be the number of people who have to be involved in code reviews.\nIt could be how many people that are at each team meeting.\nThere are more potential interactions with more people and so more cost.<\/p>\n\n\n\n<p>A small team of, say, 3 or 4 people can work on a tough problem.\nEven if they have to regularly work closely together the cost of those interactions isn&#8217;t too high.\nA larger team has to work differently.\nWhether that&#8217;s breaking the problem into smaller less connected problems,\nchanging the team structure reduce communication channels, or ideally both.\nA bigger team should work differently from a smaller team.\nThis problem is the basis of the recommended team sizes for Scrum.\nDepending on who you listen to that might be 3-9 members or 5-9 members.<\/p>\n\n\n\n<p>By splitting up teams into smaller groups and combining checks you can reduce overhead.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">People<\/th><th class=\"has-text-align-center\" data-align=\"center\">Groups<\/th><th class=\"has-text-align-center\" data-align=\"center\">Checks<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">0<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">2\/2<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td class=\"has-text-align-center\" data-align=\"center\">3\/2<\/td><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><td class=\"has-text-align-center\" data-align=\"center\">2\/2\/2<\/td><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">7<\/td><td class=\"has-text-align-center\" data-align=\"center\">3\/2\/2<\/td><td class=\"has-text-align-center\" data-align=\"center\">8<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">8<\/td><td class=\"has-text-align-center\" data-align=\"center\">3\/3\/2<\/td><td class=\"has-text-align-center\" data-align=\"center\">10<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">9<\/td><td class=\"has-text-align-center\" data-align=\"center\">3\/3\/3<\/td><td class=\"has-text-align-center\" data-align=\"center\">12<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>So with 3 groups of 3 people the checks inside each group will be 3 and the checks between each group will be 3.\nSo that&#8217;s 3 * 3 + 3 = 12 checks in total.\nThis is a lot less than the 36 checks to coordinate everyone at once.\nIf you&#8217;re working on a bigger project then maybe it will be 5 groups of 5 people or something completely different.\nThe right balance will depend on the exact work your doing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"system-architecture-problem\">System architecture problem<\/h2>\n\n\n\n<p>The same sort of argument can be made about system architectures.\nWith tightly connected modules in a project you have to make checks whenever you make a change.\nThe more modules you have the more checks you need to make.\nAs the number of modules gets higher the specific of the original change matter less and less.\nInstead you spend more and more time to check all the different interactions.<\/p>\n\n\n\n<p>The first step here is to try and break the system up into modules that don&#8217;t have to interact much.\nBadly organised modules means interwoven dependencies.\nWell organised modules means each module has it&#8217;s own responsibilities and limited connection to others.\nThat means, say, putting the complicities of database access into one module rather than having it everywhere.\nOther modules still have have to interact with the database module but a lot of intricacies are hidden inside it.<\/p>\n\n\n\n<p>The second step might be to organise modules or libraries into layers or tiers.\nHigher layers use lower layers to perform tasks but the lower layers don&#8217;t have to care about higher layers.\nSometimes these layers might have official names, e.g. Presentation, Business, Database.\nHowever you can have many more layers for technical reasons.\nUnit tests for each layer could be written assuming that lower layers have already been tested and are working.\nThis reduces the need to duplicate functionality inside tests, you can safe just use code from lower layers.<\/p>\n\n\n\n<p>It&#8217;s also important to remember than dependencies between modules can be both explicit and implicit.\nIf two modules both use a constant, <code>const uint32_t MaximumTokenCount = 1024;<\/code>,\nthen they are explicitly linked to that definition.\nHowever if two modules both have their own constant or just use 1024 directly but these have to\nbe in sync then they are still implicitly linked.\nIt&#8217;s much better for the compiler to take care of an explicit link than to rely on manually updating\nvalues with an implicit link.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"network-problem\">Network problem<\/h2>\n\n\n\n<p>If you are choosing between a peer-to-peer architecture, a client-server module or\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Network_topology\">something else<\/a> there is a communication overhead between nodes.\nA networked video game might use a peer-to-peer system if there was just a few players.\nThat would minimise the round trip time to synchronise data.\nFor a large number of players that becomes impractical as more and more data has to be passed round.\nThere a client-server module would reduce the amount of data that had to be transmitted but\nwould increase the round trip time to distribute data.\nFor massive numbers of players extra layers would be required to stop a single server from becoming overloaded.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"general-problem\">General problem<\/h2>\n\n\n\n<p>The number of connections in any tightly couple systems grows quickly.\nTechnically for a system with <code>n<\/code> nodes that&#8217;s:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><code>connections = n x (n-1)\/2<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>If there is a cost to those connections then that cost also grows quickly.\nEven if it the cost starts small it can become a problem.<\/p>\n\n\n\n<p>This is a general problem that can affect all sorts of systems.\nMaybe we can learn lessons for one field by thinking about at other fields.\nGenerally if you have any complicated system then try to isolate the parts.\nMake it so that changes in to one part doesn&#8217;t impact all the other parts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This problem is sometimes referred to as communication complexity and can be a problem for teams. It also has implications for systems architecture and probably elsewhere. Team problem One person by themselves doesn&#8217;t have to worry about synchronising their work with anyone. There is no communication overhead. On the other hand, it&#8217;s just one person [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[17],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-general","tag-organisation"],"_links":{"self":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":1,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/posts\/80\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/permutationcity.co.uk\/bp\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}