<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Aljabr - Medium]]></title>
        <description><![CDATA[Simple, Smart Data Pipelines - Medium]]></description>
        <link>https://medium.com/aljabr?source=rss----b2a8b6bc547b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Aljabr - Medium</title>
            <link>https://medium.com/aljabr?source=rss----b2a8b6bc547b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:41:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/aljabr" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Storytelling in the Dataverse]]></title>
            <link>https://medium.com/aljabr/storytelling-in-the-dataverse-2b57e3559174?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/2b57e3559174</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[automated-reasoning]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <dc:creator><![CDATA[Mark Burgess]]></dc:creator>
            <pubDate>Thu, 23 May 2019 10:06:27 GMT</pubDate>
            <atom:updated>2019-05-24T12:16:58.638Z</atom:updated>
            <content:encoded><![CDATA[<p>When Quantum Gravity governs your pipeline! (sort of :-))</p><p><em>In developing data platforms for the cloud era, we are effectively building (cognitive) learning systems that span a wide range of scales — agents that receive inputs and compute results, sometimes with feedback. Virtualization and parallelism throw a layer of obfuscation over the tracing of dataflows, as well as performance measurement and causality. Data pipelines from the </em><strong><em>edge</em></strong><em> of the </em><strong><em>cloud</em></strong><em> to the </em><strong><em>centre</em></strong><em> and back are especially vulnerable to distortion and loss of traceability, as they muddle the expectation of deterministic processing with the randomness of arrival times arising from the uncertainties of distributed processing. Sometimes dependency tracing takes care of this, but if we pool results into a `data lake’ we then wipe out meaningful order, rendering the timing moot. The result is that many users don’t have any control over what their data are telling them.</em></p><p>It’s not often one could say that Quantum Gravity has much use in the everyday world, but (as I explain in my book <a href="https://www.amazon.com/Smart-Spacetime-information-challenges-process/dp/1797773704">Smart Spacetime</a>) basic spacetime physics holds the keys to understanding a lot of what goes on in the cloud. There are simple principles relevant to every aspect of change that explain the meaning of connectivity and the ordering of events. When data sources are distributed, we have to deal with partial ordering — sets of data whose causal order (as defined by a <a href="https://en.wikipedia.org/wiki/Causal_sets">Causal Sets</a> approach <a href="http://markburgess.org/semantic_spacetime.html">to Semantic Spacetime</a>) is not absolute or even well defined.</p><p>No one teaches us this stuff in college!</p><p>The problem in the cloud is that parallelism and distribution lead to a classic problem of data <em>relativity</em>. No observer has complete information about everything locally — we rely on messages passed between agents inside of the system. These travel at finite speed, and may not be available to all parties. Data collection (which is central to monitoring) is, in fact, closely related to the more widely discussed <em>data consensus</em> problem. In <strong>consensus</strong> systems, we are trying to ensure that a broad audience sees that same version of local history as we do; in <strong>data collection</strong>, we are trying to aggregate local histories into a meaningful timeline that a single observer can make sense of.</p><h3>Mapping interior and exterior context</h3><p>Most information gathering (usually logging) systems simply push out data without calibrating their meanings, or aligning their causal order. They leave the entire burden of interpretation to human postmortem pathologists. This is a wasted opportunity.</p><p>The key to understanding complex systems is to break them down by separating behaviours by <strong>timescale</strong> — not just by function. We can sort and classify garbage using the machinery of the cloud, if we organize by scale. We don’t have to dump problems onto human operators. The machinery of our data processing universe are there to help.</p><p>This starts with the classic separation of decision processes from implementation, using platform tools like Kubernetes, but it continues by using<em> embedded instrumentation</em> that acquires knowledge from within each local process, so that context is not lost. We need to be clear about where the boundary between observer and observed lies, when collecting data, to avoid losing the ability to interpret it later. <strong>What we did </strong>versus <strong>what happened</strong> to us should be distinguishable. Not all data processes are simple input output graphs — they take considerably more work to comprehend. When we reach the level of an ecosystem, things get hard to understand — but not impossible.</p><p>In Koalja, we can define a data circuit (pipeline or cluster) using a simple declaration like the one below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*nQunlmd9MwcuV90KHzYQmQ.png" /><figcaption>A pair of DAG pipelines conjoined by a service (declaration)</figcaption></figure><p>This defines a model “tfmodel” that consists of two pipelines that are correlated by a service relationship (see figure).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/0*0EhaeCU46uwUO9nV" /><figcaption>A pair of DAG pipelines conjoined by a service (visual)</figcaption></figure><p>Two separate (parallel) processes are defined, with independent causation. Above, there is a training process that accumulates data and builds a machine learning model, then uploads this model into a service for use by a recognition process. Below, the recognition process independently collects data for classification. It converts the forms into something compatible with the model, and then a prediction phase performs a lookup to the service maintained by the first pipeline. This is not a classic single DAG relationship, but a service dependency (query-response). Once the service returns, the predictor can complete its computation of a result and send it for output through the lower pipe.</p><p>The second pipeline has a formal output, the first doesn’t. All such combinations of input and output pattern are possible in data circuitry. But how can we see this as a causal trace? This challenges us both with <em>configuration</em>, <em>comprehension of operation</em>, and <em>comprehension of outcome</em>.</p><p>Which version of the model was being served when a particular output was processed? Are we even aware of the hidden dependency between the two pipelines? If we consider only DAG models, we couldn’t possibly know.</p><p>We need to be able to debug these processes in two ways: by the <strong>invariable relationships</strong> between their parts, and by the timelines of <strong>variable events</strong> that pass through them.</p><h3>Time and space to the rescue</h3><p>History plays a big role in our understanding of systems. We are storytellers by nature, so we look for truth in logs and journals. The problem is that logs and journals are written by single authors (or single processes).</p><p>In the cloud, we want to aggregate logs into a library of journals. However, because IT has had no strong theoretical underpinning, the approach has simply been to aggregate pages from everyone’s journals indiscriminately and join them together in a single journal, without pausing to keep separate what was causally independent. We believe we can throw the job of searching aggregate logs to a process of unlimited power, by brute force.</p><p>Aggregation is entropy. It creates garbage landfill. Technology is supposed to help us recycle meaning as well as help with the work of being an efficient collector. Dumping everything in a giant landfill to be sifted through for body parts in times of trouble (the opening scene of many a murder mystery) is not a good strategy. It’s very expensive and perhaps not even possible to piece together forensic information that has been thrown away. So let’s keep it.</p><p>We need to use information technology more intelligently, and spacetime principles are free and open for the picking.</p><p>Most logs use Unix clock time as the measure of causal order. But clocks are independent and potentially different on every machine. This no longer makes sense in a parallel world, or a world of turbulent coroutines that interleave timelines and threads. Logs have meaning on a different scale than what the kernel uses for timesharing, and this is again different from the scale on which data processing has meaning. If we muddle these, we just create muddle.</p><p>Computer programs are causal process threads. Order lies in their execution on the process interior, not in the arrival of messages between them. There is a proper time (NOW) related to the moment at which a process passes key landmarks in its code. Other messages may interpolate details with deltas relative to those. When we seek a so-called “root cause” of an event, a Unix time log is a garbage heap, but a causally ordered proper time log can point back to the root(s) from whence the event came — i.e. those earlier landmarks that fed into the current moment.</p><p>Even resource anomaly detection can be processed in line, to capture environmental changes with proper causal order. By designing the careful separation of <strong>variants</strong> (event instances) from <strong>invariants </strong>(persistent patterns), raw observational data can be highly compressed — far more efficiently than text based logs, without being too slow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*P-qL-XpWsKtB4JsL" /></figure><p>The meaning, however, is far richer than current logging formats. The trace below was generated from an <a href="https://github.com/AljabrIO/koalja-operator/blob/master/pkg/history/cmd/test_history.go">illustrative test process</a> to show how logs can express proper causation, even in programs with co-routines and parallel execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/0*dK7dp1kzfUoZ2tei" /></figure><p>An anomalous CPU spike, during this containerized execution, becomes a signpost in the timeline of the process — measured from within, as Einstein taught us. We can also attempt to detect and point out interior non-simple causality, such as that produced by co-routines.</p><p>The traditional timestamps in the example are for real context guidance only: they can’t be considered accurate, but we still like to know roughly what was going on in the outside world. The sequence numbers from the code flow indicate the occurrence of major “signpost events”. This is how we told the time (before the invention of clocks) — we attached meaning to significant events: e.g. the year of the flood, the Christmas outage, etc. Such <strong>process anomalies</strong> are meaningful to us, but clock times are just repeating patterns that need further explanation.</p><p>Indentation, added by <em>post hoc</em> presentation helps to show the subordination of interior “subtime” deltas within the larger intentional scheme of a process. All this can dropped into code using normal logging-style messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*DBKivUl6zUISce1lzPzeUQ.png" /></figure><p>The history of this thinking goes back to CFEngine and its machine learning anomaly detection, modified for the modern world. The Cellibrium project further developed an experimental fork of those ideas. The layers of wrapping and containment in the cloud detach causation from observable metrics, but this provides a more targeted “intentional” way of promising the state of containerized workloads.</p><h3>Sum over histories</h3><p>Histories are only one part of understanding. Meaningful concepts emerge by invariant pattern and repetition, not as single events. The <strong>path well-trodden</strong> by data events leads to an invariant average behaviour that we can call the <em>stable path of action</em>, intended by the code. The emergence of such invariants from repeated trials is what we mean by <strong>learning</strong>.</p><p><em>[Remarkably, this has a lot in common with the way we describe quantum physics: there is a general distribution of assets associated with conservation of resources, but the precise locations or values of observables are hard to pin down with certainty. The world is probabilistic when you see it second hand. Over time, it wears a path of `stationary action’, which is what we call the principle of least action, which is actually a principle of superposition of alternatives.]</em></p><p>We can do more with a spacetime model than trace simple path histories. By labelling the channels of influence using their spacetime semantics, we can separate and relate them according to the information that transmits their relevant influence — going beyond guesswork. By accessing a properly labelled aggregate overview, generated by iterative learning from cluster data, we can reconstruct a god’s eye view of the system over the past, for future prediction. The significance of invariants persists, and can be used to infer behaviour in the future.</p><p>This is the scientific method in action: in cases of sufficient stability, we are able to use the past as a guide to the future.</p><p><em>Advanced boundary conditions are what I have earlier called convergent processes — other names like “CALM” logical monotonicity have been used, but the spacetime structure is the simple common denominator that unifies these ideas.</em></p><p>The output from <strong>Koalja,</strong> from declared knowledge combined with process invariants, leads to a self-organization of persistent concepts, which is partially ordered by causal ordering. This tells a diagnostician far more than a log of ephemeral events — and can be used together with the proper timeline to elevate meaning above quantity — recycling meaning before it hits the landfill.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/0*nvGVCg3wNggZQeRv" /><figcaption>Automated reasoning based on theprinciples for <a href="http://markburgess.org/spacetime.html">Semantic Spacetime</a></figcaption></figure><p>By following only causally ordered pathways that generalize as “volumes of generalization” along different “spacetime” channels, we can quickly make predictions about complex outcomes based on past behaviours, without having to trawl logs in a lengthy and speculative postmortem. It’s the very same principle used in Quantum Gravity to attach directed evolution to networks. The `classical paths’ are the paths most travelled, worn by the common elements of repeated learning.</p><h3>Turning Search into Certainty</h3><p>I am not a fan of current logging systems. Koalja is not a logging library — but it embeds a semantically enhanced recording device that enables meaningful diagnosis of processes running in cloud. Experience has shown that the data measured in most such libraries say almost nothing that isn’t obvious about a system today.</p><p>One could say that going through someone’s garbage gives them a complete picture of their distributed lives. Certainly this is the logging and tracing approach to distributed systems (including microservice architectures), but surely there is a better way when the parties are collaborating. Not everything should be a murder mystery.</p><p>Meaning decays quickly with time, as human users stare helplessly at wiggly lines like paranoid security guards. As I wrote in my book <a href="http://markburgess.org/certainty.html"><em>In Search of Certainty</em></a>, it all seems a lot like trying to diagnose the cause of a bad mood by taking someone’s pulse. The best part of reinventing system instrumentation, from the bottom up, is that we can choose more practical and efficient formats for it, that preserve simple signalling semantics and detailed diagnostic causation. For the data circuitry in the cloud, this is more important than ever.</p><p><em>You can read more about these issues, in my </em><a href="http://markburgess.org/smartspacetime.html"><em>new book:</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*kqDY_F1rJNy_GlkC-9hXMw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b57e3559174" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/storytelling-in-the-dataverse-2b57e3559174">Storytelling in the Dataverse</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[15# Beyond data pipelines]]></title>
            <link>https://medium.com/aljabr/15-beyond-data-pipelines-8f22b2102cf?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/8f22b2102cf</guid>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <dc:creator><![CDATA[Mark Burgess]]></dc:creator>
            <pubDate>Mon, 10 Dec 2018 15:50:13 GMT</pubDate>
            <atom:updated>2018-12-10T15:50:13.174Z</atom:updated>
            <content:encoded><![CDATA[<h3>Realizing Smart Workspaces</h3><p><em>In this series of posts, we’ve described many issues that encircle data pipelines, past and present, mainly from the traditional sense of workflow management. Yet this story, even with all its historical twists and turns, is the tip of an iceberg that is currently expanding throughout businesses and social spaces. As we extend data services into every corner of our living and working environments, as sophistication in service engineering and bulk processing accumulates, so the problems of distributed data access and data processing take on an entirely new significance. We are heading from an abstract, far-away cloud towards the embedded modularization of pervasive specialized</em> spaces<em> — with data as the glue that holds it all together.</em></p><h3>Pervasive ubiquity</h3><p>When is a pipeline not a pipeline? When it’s plumbing. Your house, your workplace, your town, and your country have pipes that carry utility services — water, gas, sewage, electricity. These networks are partly centralized and partly decentralized for sharing common resources, but they have access points everywhere. We may start with simple pipelines, but as the plumbing expands, the scope of the pipelining transforms into something else entirely. Moreover, on top of this public plumbing there is even more specialized and private plumbing — the linkage of human process flows, with policies, barriers, access controls and adaptive responses.</p><p>It’s 20 years since the terms <em>ubiquitous</em> and <em>pervasive</em> computing were coined, around the innovative work of Xerox PARC. During that time, Information Technology infrastructure has undergone something of a revolution to open up hardware and software. Without that change, ubiquitous computing was never going to take hold. Today we’ve rebranded it, as the Internet of Things, and a few companies have taken the first baby steps. Pervasive computing didn’t pass in the night — it’s still on its way, building momentum, and navigating the changing trajectories of business. The trajectory is clear. What a few giant companies do with data today, everyone will be doing in the next decade. But today, it’s still too hard to plumb even simple systems in a scalable way. Product developers build for one use-case at a time. How about building for growth and maintainability?</p><h3>Plumbing the depths and the edges</h3><p>We want to instrument human processes all the way out to the edges of our involvement in the world — from distant space probes, to homes and cities, as well as from inside businesses. We might talk about the computing cloud as if it’s everything there is, but it’s not there yet. Even that pales into insignificance compared to the logistical processes that keep an economy running. The growing topic of `serverless’ computing is trying to reinvent the cloud as a single transparent multi-user time sharing system, but so far it doesn’t address practicalities of real world needs. The cloud itself is evolving — and will eventually encompass far more of those edge computers too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/0*MkU90wVbFfZb3vp0" /></figure><p>Sources come from environments that equip data with both <em>context </em>and <em>semantics</em>. Those are the gold that data processing is sieving for — and they are only found at the edge. Centralized datacentres can provide brute force to dispatch certain large tasks that go beyond individual resources, but there is an abundance of wasted capacity at the edge to be reclaimed by a better, more inclusive platform. If there is one lesson we’ve learned from dataprocessing, it should be that processes benefit from being context aware — from being <em>data aware</em> — a complete separation of concerns leads to an inefficiency of layers. As long as there is no unified data aware network stack to plug into, IT innovation for that new era will be choked off by its own complexity. It doesn’t have to be like that.</p><p>There’s enormous scope for the routing and scheduling of `business processes’ (whether in the public or private sectors) on new multi-scale platforms. Key processes want to live in two kinds of location:</p><ul><li><strong>Detached</strong>,<em> in situ</em>, at the edge (<strong>ingress tasks</strong>):</li><li>Close to the data sources, you deploy initial logic to handle the smart sampling, selection and ingestion of data, discarding noise at the outset.</li><li>You keep the source data in a repository, with replication for disaster recovery as long as it could be needed.</li><li><strong>Integrated</strong>, <em>in virto</em>, in the cloud (<strong>core tasks</strong>):</li><li>Selected data are pulled on demand into the more powerful cloud.</li><li>Process containers manipulate and transform data, and publish results as accessible, available URIs.</li></ul><p>In between these extremity locations lies a limited network that cannot absorb every bit of data we produce (even if that were a good idea), and a storage layer that has mostly forgotten about garbage collection. I wonder how long before IT confronts its own plastic crisis — and we move from images of plastic mountains in Indochina to documentaries about choking derelict data graveyards in the cloud that consume electricity and spur on global warming by their massive energy inefficiency?</p><h3>Getting DNA</h3><p>Tracking what went into and what came out of a cauldron of mixed up data isn’t just a practical issue, but one of security and integrity. That’s especially true as data processing becomes integral to embedded services on all levels of society. Chains of evidence, in business and public processes are important in everything from forensic records, to blockchain transactional records. The traditional tools for monitoring individual time-sharing systems (apart from being 40 years old) are next to useless for tracing behaviours in a micro-modular cloud environment. Something better is on the horizon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XlJkQKnATbq51Mlb" /></figure><p>From inputs to outputs, data driven processes conceal execution traces, that are labelled by provenance, and by intent. Standing on the edge of data processes, Koalja exploits ways to distill insight from these flows and can provide actionable, semantic data for realtime and forensic analyses — a rescaling and a modernization of kernel tracing for a new generation. This is <a href="https://www.youtube.com/channel/UCxoHs7KK2GCYcEZK6ttigaA/videos">Promise Theory</a> in action.</p><h3>From the plumbing to the workspaces</h3><p>The core challenges of computing are not about endless layers of APIs, or programming language choices — quite apart from the scaling of physical and virtual infrastructure — they amount to a few common issues about the smart management of space and time:</p><ul><li>Breaking a computation into an expressive graph of stages.</li><li>Storing essential data, “close to” users with <em>low latency</em> and <em>without loss of context.</em></li><li><em>Distributing data</em> efficiently, presenting a <em>consistent index</em> of updates.</li><li>Accessing versioned data in a consistent state.</li><li>Tracing processes for understanding and diagnostics.</li></ul><p>The last of these is more important than we tend to admit — today computer systems are living evolving things, not stable machinery. The goal of data processing is to understand stuff — a process involving humans as well as IT infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/0*bUhk8XpwGdssohUk" /></figure><p>Service ecosystems begin as simple processing pipelines, but that doesn’t capture their real significance. At Aljabr we are more interested in the long term trajectory of data processing, starting with the practical simplicity to bring it to a broad audience. Solving today’s problems, without addressing the underlying and upcoming challenges, would be missing an opportunity to provide stability to a generation of users.</p><h3>Smart workspaces</h3><p>We work together around single tasks because that is how humans organize. We already saw the shift to a tradesman model in IT with microservices allowing separation of concerns for complete lifecycle management of specializations. Heating, lighting, building engineers, (Smiths, Carpenters, Coopers, even Burgesses — pick a surname) have been doing this for centuries. Overlapping but independent concerns benefit from smart assistance, and communicate through community meeting places.</p><p>Today, we are still getting into a muddle over IT complexity, grappling with relatively new challenges of the Information Age. Tomorrow, we’ll return to the old model of human society, with modular trades, while making room for automation and even AI. The enabler for that Integration Age will be smart plumbing. The next step will be to go from smart plumbing to smart spaces, with smart virtual ecosystems, extending all the way out to the edge. The ingredients are available today from leading edge companies. The composition of those maturing ideas is Aljabr’s pipeline task.</p><p><em>The goal of smart infrastructure, with tasks and links, DAGs and DCGs, is not to just wire stuff together, but to act as coherent data circuitry, to be the “linker” in a multiscale compiled language — -binding jobs that are written in totally different tongues.</em></p><h3>It’s programming…</h3><p>We’ve exposed many of the basic requirements for future pipelines, and beyond, over the course of this blog, based on almost fifty years of lessons derived from history and experiences. If we forget about the transitory novelty of technologies in the news: microservices, Kubernetes, Knative, serverless, unikernels, service mesh, and so on, what it all amounts to is: how to scale a programming system from a single PC to world-spanning mega-computer — formed from many parts, partially shared by the private individuals, and changing in realtime. The <a href="http://shop.oreilly.com/product/0636920038542.do">principles</a> are known and reasonably understood — so it’s time to get on and integrate them for the emergent, interoperable cloud.</p><p><em>This is the final blog post for this year. In the New Year, we’ll return with new posts on the future of data aware infrastructure.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f22b2102cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/15-beyond-data-pipelines-8f22b2102cf">15# Beyond data pipelines</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[14# From wireframe to fully rendered]]></title>
            <link>https://medium.com/aljabr/14-from-wireframe-to-fully-rendered-3c740e7312b?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/3c740e7312b</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <dc:creator><![CDATA[Mark Burgess]]></dc:creator>
            <pubDate>Wed, 05 Dec 2018 12:23:40 GMT</pubDate>
            <atom:updated>2018-12-05T12:23:40.232Z</atom:updated>
            <content:encoded><![CDATA[<h4>Resampling for trial and error</h4><p><em>The interplay between scale and reasoning contains </em><a href="https://www.infoq.com/articles/microservices-economics-small-things"><em>many pitfalls</em></a><em> for the unwary, as we discussed in the last posts. It is not one that users should need to confront on a technical level. Prototyping and testing code causes headaches for data scientists and may waste a considerable amount of computational resources. To avoid dealing with massive (non portable) data sets, it’s common generate fake data, much smaller in size, that can be tested quickly, but in doing so we might lose track of real causal effects — which combinations of changes were the ones the mattered? In this post we look at how a smart platform can shield users from these chores.</em></p><h3>Wireframing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*B0v3e1yycqMC_KO2" /></figure><p>Most readers will have seen the movies <em>Avatar</em> and <em>Jurassic Park, </em>and will have been amazed at the realism of the computer generated graphics in those movies. But the finished and polished version of the movies is very different from the models used during the planning and directing of the film. In the initial stages, skimpy wireframe skeletons move around the screen, with varying levels of filling over time (see the figure below). Only in the final cut are the details rendered fully at the maximum resolution of the final format.</p><p>The same principle is true when developing test data for a later full processing. The larger the input data, the more painful it becomes to test and debug processes using the real thing later (e.g. when I re-published my old novel <a href="https://www.amazon.com/dp/1521035105?ref_=pe_870760_150889320">Slogans</a>, on the Amazon platform, through an online book production service, the validation of the 500 page PDF document took several hours each time before crashing without a useful error message). When you try to fake data you inevitably miss the real issues that come back to bite you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*l2MMlnqyYQM5jNw3" /></figure><p>While developing their story-lines, directors and CGI graphic designers work with simple real-time wireframe models. They run the same experiments over and over again, to get the details right. Later, when all the details are known, the entire experiment is run at full resolution as a batch job that might take significantly longer. The same is true of digital music rendering at different bit densities. All that happens at the flip of a switch. Data resolution affects the promise made by the final artifact. In a production environment, we want data to keep its best promises, but for wireframing a storyline strategy, we only need an outline of the data. The final rendering can be done later, in batch, in the cloud.</p><h3>The ghosts in the shell</h3><p>We can imagine a kind of “volume level” attached to data streams that governs their intensities, much like the volume controls on the different stages of your stereo system, from source to amplifier, etc. The lightest possible rendition of data analysis is to turn the volume to minimum, doing no sampling at all! Perhaps that sounds silly, but it could be used as a simulation of the pipeline, with no actual data, just empty messages to validate the connectivity and control flow. Tools like this have been common for modelling TCP/IP networks and Petri Nets for years.</p><p>Like the Internet, batching of dataflow is basically a traffic problem. There are stages (tasks) and there are links that guide the flow in a forward direction (links). Each stage needs to wait for enough data to arrive to make it worth while to process.</p><p>There are lots of ways to selectively sample data for testing, depending on file formats and batching strategies. For example:</p><ul><li>First n records,</li><li>Every ⅓ record,</li><li>Skip a stage.</li><li>Dummy transformation.</li></ul><p>Data scientists may only need to provide a notion of what the minimum acceptable sample is that can be used to generate an output. As steps are taken to full resolution — described as policy for the pipeline — smart links could adapt automatically to build low-resolution artifacts. These temporary artifacts could be cached as just another version attribute too, allowing re-scalings to take place without mandatory re-computation of every stage.</p><h3>Pump up the volume!</h3><p>Suppose we imagine a data pipeline with several stages (in the figures below). At each <strong>smart link</strong> in the process (dashed boxes), one could imagine a slider or volume knob, something like what you find on an audio-visual mixing desk, which would cause the link to alter the throughput of data by sub-sampling transparently. The user’s task code need never know anything about the fullness of the sample — the user can keep the setting low while working from the hammock on the beach. And turn it to full once the code and data are both believed to be for the final cut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jQWiLnfJAMbAlgZW" /></figure><p>Turning up the volume on the lower link (between task 2 and task3) might spawn a flood of data, which the link can then respond to by parallelizing its task. At low resolution, the user can save CPU cycles and time by turning down the resolution. If running the pipeline on a laptop from the beach, you don’t want to be pulling data over the WiFi. Later when you run it in the cloud, congestion is less of an issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jK3tvZ5GCSG4A-DE" /></figure><p>These are very simple helper functions for users, but they can make all the difference.</p><h3>The beginning of a platform</h3><p><em>Behaviours that make a real difference to user focus should only need the permission and guidance of users, not complex re-coding and associated administrative skills — and it should especially not require any special incantations to summon forth changes to cloud infrastructure. Kubernetes is the beginning of a great platform, but it should never be mistaken for a cool toy to engage users. Its job is to disappear. One of Aljabr’s goals with the Koalja project is to enable platform transparency for users in all organizations. No one should need a team of SREs just to get simple work done flexibly and scalably.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c740e7312b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/14-from-wireframe-to-fully-rendered-3c740e7312b">14# From wireframe to fully rendered</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[13# The 4 R’s]]></title>
            <link>https://medium.com/aljabr/13-the-4-rs-5688f38241bb?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/5688f38241bb</guid>
            <category><![CDATA[data-processing]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mark Burgess]]></dc:creator>
            <pubDate>Thu, 22 Nov 2018 13:16:45 GMT</pubDate>
            <atom:updated>2018-11-22T13:16:45.349Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reading, ‘Riting, Recursion, and Reusability</h3><p><em>Data pipelines connect graphs of tasks together, reading and writing over data links in between. In previous posts, we’ve hinted at how a platform with smarter links and smarter tasks could help users to develop and test processing circuitry. It could simplify — perhaps even eliminate — certain issues that plague data pipelines, letting the platform do the work of processing, instead of forcing technical acrobatics onto end users. In this post, we point out how to enable simple breadboarding for a generalized circuitry model, based on a smart pipeline paradigm.</em></p><p>Data pipelines obviously read and write data, but while folks normally mention Directed Acyclic Graph (DAG) flowcharts, that model is limiting, and in general we need something more expressive — as the Ko language showed internally at Google. There is also a powerful case to be made for extending DAGs to include ordinary programming constructs like loop iteration and recursion in the evaluation of results.</p><p>When data get shared over wide areas, there’s usually a need to distribute the processing too. That turns the network into a giant computer. But we shouldn’t oversell this (the call for Turing Completeness in all things always feels more like a protest than a carefully considered position) — but let’s rather say that there are cases where reasoning needs to be distributed, because it’s impractical to localize computation when dealing with “Big Data”.</p><h3>Distributed reasoning</h3><p>Data processing can benefit from explicit and implicit loops, with privisos. Everyone understands the idea of iterating over queues and lists, re-using the same code on each item. Recursion means that we first promise an outcome then calculate it `just in time’. The imperative approach would be to build all prerequisites for a result one by one, and then combine them at the end. The result is the same, but putting detail before understanding results in a clumsier form of expression.</p><p>In the last post we emphasized the relationship between process safety and data privacy, mentioning the importance of handling the 3 F’s (faults, error, and flaws). In this piece, we are jumping from the 3 F’s to the 4 R’s: reading, writing, recursion, and reusability. As mentioned, reproducibility is a common business imperative, but any public (global and mutable) data involved in a processing pipeline will render it potentially <em>non-reproducible</em>, and push the burden of managing process safety onto the user. That might well be an unjust burden if the user is primarily interested in data science. In the cloud, the stakes are higher, as the potential ramifications of scaling up a disaster could have potentially unbounded cost.</p><h3>Recursion and privacy at scale</h3><p>To do more general processing at scale, you might use a mixture of iteration and recursion, across distributed shared data, for:</p><ul><li>Reusability of code in the same process</li><li>Reusability of data in the same process</li></ul><p>The classical way to achieve reuse of code is to use local variables and parameter passing, with private workspace, just like passing parameters to functions. The problem when doing this at scale is that, for large data sets this can involve copying large amounts of data to the “stack frame” of every call. It’s expensive and unnecessary as long as input data are immutable.</p><p>The temptation to just let the “infinite cloud” handle it is also compelling, especially for inexperienced users who don’t know what goes on behind the scenes. Moreover, even some old school system developers still think in terms of simplistic patterns like the “good old load balancing middlebox” and may feel that they’ve handled scale just by throwing a naive load balancer process into the flow.</p><p>Moving data to and from functions directly, instead of pointing to it by reference, will lead to data bottlenecks that plague classical middlebox load balancers. Instead of “eating” data, processes can sit alongside the pipeline and dip into that data on a “need to know” basis (Don’t Eat, Take a Seat). This can lead to a side benefit of very useful helper functionality, for partial data analyses, such as in testing (see the next post #14).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C24FjsD_NRT15tjD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xOQumGE40-htsmU9" /></figure><p>For a platform to take smart decisions, on behalf of users, it needs to scale data processing in a smart way, taking the computation to the data rather than vice versa. It needs to make that computation safe to recursion and iteration, with guard rails against unintended mistakes and inexperienced choices.</p><h3>Looping out of control</h3><p>Users love databases as a means of permanent and temporary storage, but databases are global variables, and may lead to covert back channels. If a persistent non-ordered datastore, say a vanilla SQL database, is used instead of an explicit FIFO, a pipeline may end up revisiting values that it has already worked on before — because they don’t automatically disappear from the queue once done. At best this might be wasteful, at worst it may lead to inconsistency, unbounded loops, and deadlocks. Fortunately, the issues can be handled with <a href="https://www.usenix.org/legacy/publications/library/proceedings/lisa97/full_papers/15.burgess/15_html/main.html">adaptive locking</a> policies, and the discipline of making outcomes <a href="https://www.sciencedirect.com/science/article/pii/S0167642303000479">idempotent</a>. These disciplines can also be embedded as a service within smart platform as an optional convenience. Letting the platform provide meaningful assistance is a powerful way of keeping control over the pipeline on a local level, as well as simplifying major details for users.</p><p>Let’s look at such a hypothetical example of a pipeline, which is not a true DAG, and try to formulate the problem as `bread boarded’ pipeline, as simply as possible. The figure below shows a simplistic web crawler, seeded by a few URLs, which reaches out to those URLs and scans them for further links, returning any new URLs to the queue to visit in turn. The process is a process DAG, wrapped in an implicit data loop, making it an implicitly cyclic graph — with all the potential dangers of infinite looping, etc. Let’s further assume that the data are dropped into a plain old database that is not explicitly a part of the pipeline. Inexperienced users naturally find this convenient, and may not appreciate the issues. It could easily get stuck in an infinite loop by crawling the same pages again and again. Each thread is superficially a DAG, but the entire process is an endless non-deterministic loop. What the example needs is a proper FIFO queue, with repeated values expunged for a policy-determined interval of time.</p><p>The way we are taught to think about programming is through imperative constructions, from left to right. So, without special assistance, we might first create a process to spawn off a number of worker threads, then each thread can pass along its stages in separate channels. To share the data and keep track we write to a database (see the figure below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u2fEq-l3wipBSEuS" /></figure><p>As shown, this pipeline does nothing until some data are fed into the serial queue. To get it started we have to pre-seed the data queue with some URLs, by dropping them into the database out of band — then off it goes crawling from those locations and accumulating more. But crucially, it does nothing to avoid getting stuck in loops, e.g. if pages refer to one another, the entire pipeline can oscillate back and forth between the same URLs without end. The scaled process needs to avoid retracing recent paths.</p><h3>Locks for short term memory</h3><p>We can improve on this first draft in a few ways — first, by adding locking protection from revisiting recently visited URLs somewhere in the loop, with an expiry date on blocking data for repeat crawling (this is basically why neurons have a dead time after firing — to preventing tight loop seizures). We can also remove the explicit parallel logic, which is of no interest to a data scientist, and make the parallelism automatic according to the number of pending URLs in the stream, and a resource limit. In this way, when the pipeline is quiet, or when we are happy to “nice” it to a lower priority, we can reduce the number of threads without halting the process or losing its state. The diagram below shows this behaviour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*rNK4Gg4ETTBIYHqh" /></figure><p>The obvious point, however, is why should the pipeline user need to think about these issues, and define the parallel processes at all. They are not part of the logic. In its simplest form, we can forget about all the scaling issues, and draw the process entirely in terms of its dependencies (see below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*VCR9BT117yp-XoOw" /></figure><p>We may then leave implicit or as a configuration parameter the amount of parallelism (say maximum of 3 threads) to be handled automatically by smart wrappers for the tasks and links. For the user, the whole thing could look as simple as this:</p><pre><br># Pipeline notebook<br></pre><pre>ingress -&gt; getURLs</pre><pre>getURLs -&gt;3 “crawl neighbours”</pre><pre>        -&gt; “store graph”</pre><pre>        -&gt; getURLs<br></pre><pre># Notes</pre><pre>[crawl neighbours]</pre><pre>Container = crawler_*.docker.img</pre><pre>Version = 1.2</pre><p>The labels represent functions, some of which may need further configuration, annotated at the bottom for instance, in a notebook approach. Very few details need be given explicitly, and the need for locking can be detected implicitly from the self-reference implied by the loop.</p><p>To handle looping, the getURLs function only has to aggregate its inputs from two sources unambiguously: i) the ingress source where hints get dropped off, and ii) the data queue returned from crawling. A few policy choices are needed to disambiguate the method fully, but is otherwise well defined and automatable. The figure below sketches schematically how inputs may be aggregated. The details are for another time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*51-cnXshjbAASl8k" /></figure><h3>Smart and SmartRRRR</h3><p><em>In this post, we considered how reading and writing of data, as well as recursion, and re-usability of code, can be handled safely and efficiently across multiple data channels, without unnecessary copying to repetition. Alongside those considerations, we can remove awkward issues, like scaling, into the abstractions about connectivity and task management. The role of a smart platform starts to look helpful in dealing with these issues. In the next post, we’ll return to dig deeper into the sampling of data across links — and see what smarter links could do to help users test pipelines.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5688f38241bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/13-the-4-rs-5688f38241bb">13# The 4 R’s</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[12# One step forwards, two steps backwards]]></title>
            <link>https://medium.com/aljabr/12-one-step-forwards-two-steps-backwards-459a2e3caca3?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/459a2e3caca3</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mark Burgess]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 09:09:51 GMT</pubDate>
            <atom:updated>2018-11-14T09:09:51.012Z</atom:updated>
            <content:encoded><![CDATA[<h3>Faults, flaws, errors, and policy</h3><p><em>In the previous post, we looked at how </em><strong><em>policy decisions</em></strong><em> about slicing the data cake can affect a pipeline’s ability to process data effectively, determine scale decisions, and decide the semantics of a correct outcome. There are also plenty of subtle issues in data sharing that can lead to </em>indeterminism<em>. If the goal of a pipeline is to enable reproducible version-controlled computation — -in a way that supports of proper chain of custody, then we need to look at the influence of scope, errors, and caching, with versioning of data and software too. This quickly becomes a combinatoric issue of challenging proportions. Thankfully, proper tooling can make this easier, but it can’t take away the problem completely. In this post, we look at the issues: from smart caching policy of the intermediate stages, to the scope and mutability of data. How can we recover from broken pipes, undo bad changes? What should be the Time To Live (TTL) for data in a pipeline cache? How shall we handle </em><strong><em>faults, flaws, and errors</em></strong><em>…</em></p><h3>The three F’s</h3><p>The three F’s (faults, errors, and flaws) are unavoidable parts of any real world system. But what do they have to do with data policy?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rZ3cqq1s1tgIsE75" /></figure><p>With clear definitions (see figure above and <a href="http://markburgess.org/treatise.html">Treatise on Systems, volume 2</a>), the answer becomes quite apparent:</p><ul><li>Faults are <em>failures to keep an intended promise</em>;</li><li>Errors are <em>execution anomalies or mistakes; and</em>,</li><li>Flaws are <em>inappropriate intentions/promises for the intended context</em> at design stage.</li></ul><p>In other words, you can’t define a fault, error, or flaw, without making promises about what your intent is, so decision-making, policy, and faults are joined at the hip. But programming of a system (whether by code or edict) can be dangerous when promises don’t deal with all the cases. Logic presumes complete enumerability, but our real world leads to the unexpected.</p><p>If a promise is broken, it is not simply “not kept”, the remediation may be to do it again, or have someone else do it, but it might be too late, especially in a “realtime” setting. This sounds easy enough, but nothing about distributed systems is ever easy.</p><h3>So what promises does a data pipeline make?</h3><p>Even simple data pipelines need to keep a lot of promises in order to hang together. When pipelines become large in number of stages or amount of data, span wide areas, or play mission/time critical roles in a process, like data processing onboard a vehicle, priorities may change significantly as compared to the more leisurely processing of a web crawler data or error logs in web applications.</p><ul><li><strong>Scale / parallelism: </strong>a promise to suck up all the data presented at the input and process it within a certain amount of time. A user might be able to speed up processing of data by utilizing parallelism, as long as a job does not rely on the serial order of data. Data processing might have a Service Level Objective (SLO) to promise, as part of a time-critical business process. This can also be a flawed idea. There will be limits to any system — and therefore eventually faults. No pipeline can ingest arbitrary volumes of data at an arbitrarily fast rate without managing flow control, and ultimately having to drop something (like TCP/IP).</li></ul><p>If a parallel branch fails because of incorrect splitting, improper coordination, or resource exhaustion, the final result may be damaged, reordered, or incapable of completing. A damaged result might be more harmful than no result at all, and vice versa. That value judgement may require a forensic determination only after the incident — all very unsatisfactory for programmers who want “truth”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/0*useAlJSTwArQv6x0" /></figure><ul><li><strong>Accuracy:</strong> This promise depends on the amount of data and the algorithm used by the data transformations. Software bugs and encoding mismatches could lead to errors and flaws in the software plugged into your pipeline. But when you are riding on top of a whole stack of infrastructure turtles from hardware to virtualized software, the possibility of being affected by faults in infrastructure has to be taken seriously. Networking is a common cause of errors, because it relies on so many collaborating parts.</li><li><strong>Locality and latency</strong>: A more hidden promise relates to the effective location of data artifacts implicit in a computation. Where should these artifacts be located virtually and physically? How does that affect their timely arrival? Volumes in Kubernetes might be local or remotely mounted. There is often something to be said for keeping data on local disk. Only the largest datacentres may have shadow networks with fibre channel for storage. Latency is data transportation is a key issue — -and, while Ethernet is many times faster than the computer’s internal bus, this doesn’t necessarily translate into better performance for reading and writing data. Finite size limitations on memory and disk storage are equally common. When memory is short, computers start to fall apart — -CPU flies off the handle trying to page memory to disk, and this has a cascading impact on other services.</li></ul><p>Underneath these issues, there are many dependent promises made by platform infrastructure too (see box below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*SeUJNNA9NCvr9Bfka8P6nA.png" /><figcaption>See also <a href="https://kubernetes.io/docs/concepts/workloads/pods/disruptions/">Kubernetes disruptions</a>.</figcaption></figure><h3>Data permanence — smart caching</h3><p>In the last post we talked about how to decide when enough data are ready for processing, by buffering inputs into batches. A related issue is what happens when previously accepted data need to be recomputed, because of errors, faults, and flaws in previous runs. Recomputations may or may not need to preserve a sense of the original time and conditions, but they need to be reproducible in order to trust the process.</p><p>Data pipelines typically need to buffer, cache, and aggregate data, and even maintain state though their transformation rules could be stateless. Data transformations, which convolute data further, may need access to multiple <em>constant</em> data values that might be too large to load into a single container. They need attached storage that can be addressed using a method appropriate to the process.</p><p>Some computations are one-time events, with a clean expiry date; but data scientists may also want to <em>revisit the data timelines</em> many times in order to shape their thinking and perfect their code. They may not initially know what they need from data, but may need to be able to revisit sources until some “statute of limitations” has expired, e.g. for legal reasons, such as tax audits. The time in between might be decades (as for criminal investigations, movies, and music performance master tapes) — far in excess of the lifetime of a computing cluster in the public cloud. On the other hand, it might be mere hours for routine flight data telemetry. All this adds up to a need to archive sourced inputs for future reference, in a secure immutable location <em>with relevant contextual metadata for reference</em>. This is part of a larger story about knowledge management in IT.</p><p>A smart platform can assist in these matters:</p><ul><li>By caching<strong> original upstream sources</strong> and tracking downstream changes.</li><li>By ensuring reproducibility of downstream results, with <strong>smart cache buffers</strong> and preservation of <strong>metadata context</strong>. (Caching may be “permanent” and from the initial ingress)</li></ul><p>Then results can be recreated from cached source material if need be. Keeping a copy of any external source is essential for reproducibility, while retention of later stages is non-critical but convenient for speedup.</p><h3>Hidden flaws: scope and reproducibility</h3><p>The downside of caching and snapshotting of data is that it freezes time even when time keeps on going. We work hard in IT to maintain the illusion of <a href="http://markburgess.org/certainty.html">determinism</a>, but the most pernicious source of uncertainty is reliance on data that are exterior to a process. The analogous case is the use of global variables in programming.</p><p><strong>Global variables</strong> (i.e. shared memory) are much maligned in computing these days, but they are a necessary evil for cooperation (and therefore for scaling) — all databases are global shared memory, for instance. You just need to understand the implications. If you want <strong>reproducibility,</strong> and the ability to roll reproducibility back and forth in time while debugging your process semantics, through different versions of code and computation, then you should stick cautiously to local pipeline data channels. For example, compiling a software version is “safe”, but crawling the web is not “safe”.</p><p>Of course many processes don’t aspire to reproducibility, they are quite ad hoc, e.g. machine learning, daily stats, etc. But some variations may have greater consequences than others! The hard truth about hidden flaws: anything you read from or write to that is <em>mutable</em>, over the duration of your process, i.e. is beyond the controlled scope of local links, will lead to <em>non-reproducible results</em>. If you read from an external source, you could cache the response to ensure a form of reproducibility, but if you write to anywhere outside the pipeline (except say a passive log) then you’ve changed the world. Caching can be a helpful tool in allowing you to replay the past — that’s why it can be crucial to those inevitable calls for “roll back”.</p><h3>Intended and unintended outcomes</h3><p>Some pipelines are based on intentional processes (like a deliberate query of a source), some on `realtime capture’ from sensors or streams, which is unintentional (take what you get as `best’ as you can). Should the system protect itself or crash on error? In order to survive, a process might have to drop data batches (as routers and switches do). Caching can help to buffer processing, but clearly we can’t cache everything forever. There has to be garbage collection. You have to forget data sometime. It will be interesting to see how many Photos and Videos on the Internet survive the decade.</p><p>When users pull data from mutable sources, the result can be different on each trial. “Tell me the latest” is not a reproducible query, so mutable outcomes will lead to flawed reproducibility. This is made worse when pipelines are recursive, i.e. when they feed back on themselves, we have to deal with the possibility of mutable state (global variables). A single immutable timeline, based on its own internal clock, is what Kafka ties to provide. This is an expensive solution though — perhaps not all users would be willing to pay for the infrastructure cost for this level of “truth”. It depends on the stakes.</p><p><em>Putting data into a database is a classic solution that brings with it a classic problem: databases, caches and storage eliminate causal ordering. You may try to replace process time ordering with timestamps according to someone’s clock, but that might not be a consistent set with respect to a query process using its own clock. Whenever you put data into a cache, database, or aggregate store (including a neural or Bayesian learning network) it becomes a “big grey mess”.</em></p><p>The upshot of all of this is that we cannot definitively promise reproducibility of <em>process outcomes</em>, only reproducibility of <em>pipeline behaviours</em>. Repeating the same actions will not always lead to the same result. It will always be incumbent on users to understand the process they are initiating.</p><h3>Policy for handling simple interruptions</h3><p>Caching can help trade latency for backlog, and avoid wasting energy costly CPU, at the expense of memory, but there are limits to how much caching can be tolerated.</p><p><em>All of us have some experience of intermediate caching for data with trivial semantics. Think of download managers for large files — such as video or music — these usually have a progress bar cursor. In case of interruptions, data transfers can be picked up where they left off, by keeping a cursor in the input stream. A cursor remembers its place within immutable source data, but becomes useless if the source data can change in “real time”.</em></p><p>During a recovery, we would always like to avoid doing work more than once, unless it was performed incorrectly (or the definition of correct changes). This might not only be convenient but necessary to deliver some level of reproducibility. However, a data process cannot know whether data were processed correctly or not, unless the process is aware of the data payload, at some level. A tantalizing question is therefore: <em>can we make this data awareness a clear reality at a platform level? </em>There are some hard <strong>policy issues</strong> lurking in this question.</p><p>It often comes as a shock to many that data science is <em>itself </em>an <a href="https://www.infoq.com/articles/microservices-economics-small-things">unstable process</a> when scaling data. Small changes in data and processing policy can reverse the conclusions determined, because of the naive use coarse grain resolution, or a Boolean view of decision making.</p><p><em>In this post, we’ve discussed some of the important issues around caching and copying of data for continuity, and the distortions that come from the three F’s. We deliberately avoided the issue of data consistency between parallel process lanes, but that is an additional complication. From a purely dependency perspective, there is a great deal of room to improve the user burden and quality of experience by supporting traceable caching of artifacts. Ultimately, we cannot definitively promise reproducibility of process outcomes, only reproducibility of pipeline behaviours. It will always be up to the users to understand the process they are initiating. In the next post, we look at how batching could be used to make policy based trade-offs between accuracy and speed, during testing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=459a2e3caca3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/12-one-step-forwards-two-steps-backwards-459a2e3caca3">12# One step forwards, two steps backwards</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aljabr in the news]]></title>
            <link>https://medium.com/aljabr/aljabr-in-the-news-6181072a83fc?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/6181072a83fc</guid>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Mark Burgess]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 08:40:15 GMT</pubDate>
            <atom:updated>2018-11-09T08:40:14.791Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><a href="https://thenewstack.io/aljabr-aims-to-simplify-care-and-feeding-of-data-pipelines/">Aljabr Aims to Simplify Care and Feeding of Data Pipelines - The New Stack</a></li><li><a href="https://thenewstack.io/aljabr-bringing-pipelines-together/">Aljabr, Bringing Pipelines Together - The New Stack</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6181072a83fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/aljabr-in-the-news-6181072a83fc">Aljabr in the news</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#11: Say Cheese!]]></title>
            <link>https://medium.com/aljabr/11-say-cheese-7fa4b6f5ec8?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/7fa4b6f5ec8</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[batch-processing]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <dc:creator><![CDATA[Aljabr, Inc.]]></dc:creator>
            <pubDate>Wed, 07 Nov 2018 15:12:34 GMT</pubDate>
            <atom:updated>2018-11-07T15:29:02.128Z</atom:updated>
            <content:encoded><![CDATA[<h4>When to snapshot batches</h4><p><em>Data processing is often presented like a relay race of tangled swim lanes, in which the main point is to reach the end. It’s is a simplistic view of a distributed system, but it is a narrative of </em>primary<em> </em>intent<em> that we need to focus on, without neglecting other details. However, there are some subtle technical questions that play a key role in how to move data through a pipeline that we need to think about. A data relay race starts when data arrive from one or more sources, but the preparations begin before that — -when a user asks a question, and designs a process to compute it. Once the process is underway, some flows proceed in series, others are fan out (map) to parallel lanes, and are later integrated (reduced) into a final answer. So — who fires the gun? Who judges the finish line? These turn out to be crucial issues that a platform needs to understand. In this blog, we take a deep dive into these issues.</em></p><h3>Packetizing flows: when to start and stop?</h3><p>You put your data in, you get your data out, you do the hokey-algorithm and shake it all about. Easy right? If only it were so. In previous posts we’ve looked at complexity and causation, but there is another aspect to the logistics of scheduling: when can we start, when do we need to wait for data, when should we hand over processed data, and when are we clear to proceed? In other words, how do we slice and reassemble the processing cake’s many vertical and horizontal layers?</p><p>The history of breaking long streams of data into short batches, for efficient processing, goes back to <a href="https://en.wikipedia.org/wiki/Leonard_Kleinrock">Leonard Kleinrock</a> and his work on queues that led to packet networks and TCP/IP. The idea is simple: if you break up work into chunks, smart infrastructure can compute and route the optimal delivery of a result for you. It’s exactly analogous to packaging manufactured items in boxes, component by component, say on a visit to IKEA.</p><p>Sometimes you might need several boxes from different shelves of the warehouse to complete your flat-packed furniture. You need <em>tuples</em> of input data to arrive and be declared simultaneous in order to proceed, as in the figure below. This is a lateral aggregation (from parallel lanes).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/0*ArBga8g0MQtlzccy" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*_AxHXEsziX4CZEka" /></figure><p>There may also be a longitudinal aggregation (you need to wait for 4x feet, from the same source, to complete the chair). Batching of work and typed packetization are the same problem, and we are going to see many of the same solutions appear in data processing.</p><h3>Traffic, with stop signs and lights</h3><p>Like the Internet, batching of dataflow is a traffic problem (see figure below). There are stages (tasks) and there are links that guide the flow in a forward direction (links). Each stage needs to wait for enough data to arrive to make it worth while to process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/0*6-njxuSQf7muCisU" /></figure><p>Batch sizes are part of a divide and conquer approach to processing. Suppose you need 10 data records to be able to compute a value to pass on to the next stage, the data may arrive in groups of 10, or as a random arrival process 2,3,5,1,6… It’s up to the stages to decide when they have enough to proceed.</p><p>Longitudinal batching is related to scaling, and may lead to new lateral parallelization. When data come in bursts, it might be necessary to spin up and down resources to expedite data more quickly. Cluster scaling and process flow are thus tied together.</p><p>A longitudinal aggregation process is a form of efficient congestion control. You want to fill up a unit of processing — to “ferry” data from one side of a transformation to the other side of the processing divide — in an efficient manner. How many data vehicles do you wait to arrive before sailing the ferry? The answers might be easy, but they aren’t unique:</p><ul><li>You sail as soon as a single car arrives.</li><li>You stick to a published policy schedule (wall clock time)</li><li>You wait for a minimum viable number (threshold time)</li><li>You could wait until the ferry was full (bucket fill time)</li></ul><p>There are other constraints too. Imagine you are feeding data into a printer, which effectively takes a static snapshot of the input. When should you stop changing the source data? Is it okay to keep writing new content while the data are being printed? How long do you wait to say “cheese!” and take the photo? This all depends on how we sample and print the data.</p><p>There is a difference between a print-out and a ferry though. A print-out is a derivative copy, but a transport is a transaction. You can print data many times, but once a ferry has moved a vehicle, it can’t do it again. Different processes have different semantics.</p><h3>Timeseries, snapshots, and policy</h3><p>There is a reason why we don’t submit a video clip as a passport photo. Facial recognition is based on a particular visual matching process of a single static image, not on episodic patterns. A constant (immutable) representation, sampled from a moment in time is what we need, not an episode or story.</p><p>The photo in a passport plays the role of a parameter to a function — like in programming. The value you want to hand over is a one-time snapshot (a sample) of a possibly larger changing process. If we follow a single variable over its history, resampling it many times, we could turn it into a whole <em>time series</em> — versioning every sample with a timestamp, and forming a complete database. Alternatively, we might overwrite the sampled value each time and interpret the data as a <em>random variable</em>. Choosing between these interpretations is a policy decision that’s informed by how fast data change(s) relative to its processing. How we interpret the semantics affects how we process.</p><p>Remember there are different kinds of process.</p><ul><li>Sometimes data come in continuously like a stream that needs to be processed immediately in realtime. Imagine recording a concert, or capturing flight avionics data. When we try to match timescales, pipelines run continuously, scaling up and down as supply and demand fluctuate.</li><li>Sometimes data are bursty, and pooled in reservoirs to be processed later, e.g. data from satellites and space probes, where the input process is much slower or much faster than the need to consume it. To decouple timescales, we use long term buffering, and processings resources are not needed all the time.</li></ul><p>A passport photo is essentially a random variable, when treated as an entity. Its inner composition as an ordered stream of bits is not interesting, except to say that we assume it has version consistency. We bet on each photo sample being relatively slow to change and hopefully not too random. Nyquist’s law of sampling tells us that we have to sample at least twice as fast as the shortest change we want to capture, but sampling much more frequently than that is a waste of resources. These issues guide us about what sampling policy we ought to choose — -in practice, however, the details lead to endless problems of coordination in the semantics of distributed processes, as users make naive assumptions about how time and causation work from a purely local perspective.</p><p>So, the issue for a data platform is: how does a data pipeline know when it’s safe to rely on a data value — -e.g. when can we know that inputs are at rest, and when it’s safe to compute a function f(x) of x, without being afraid that x will change?</p><p>Deterministic computer processing languages use <em>scoping </em>and data immutability to address a part of this issue, but another part is <em>application specific</em> and requires a user policy decision to be made, perhaps even changes to algorithms. What should a pipeline do?</p><p>We can make some inferences based on timescales and proper instrumentation of data, but there are some decisions that can only come from user intent.</p><h3>Specified or inferred?</h3><p>A pipeline can’t begin until a user has made some basic <em>policy </em>decisions about the acceptance of inputs.</p><ul><li>What to sample (and in what combinations)?</li><li>How much to sample (as a batch)?</li><li>What is an acceptable range for the input value?</li><li>What to do with the sample next?</li><li>How long do you need buffer or cache the samples to revisit later?</li></ul><p>In the final point, we acknowledge that as workflows unfold, we might find that we need rework products again because of mistakes, changes of intent, and even new opportunities. The choices above are the users’ responsibilities to decide. But after they have been made, smart infrastructure’s behaviour can offer powerful assistance and flexibility to the user by helping to ask the questions, and help with the forensics of post delivery diagnosis.</p><p><strong><em>How we parse data timeline depends on our changing view of intent.</em></strong></p><p>Suppose you automate data collection from some instrumentation (perhaps you are recording a concert). You may want to test the sound system, throughout the whole process, without keeping the results. You only need to retain the recording of the final performance, not the sound checks, or noise after the concert. Also, you don’t want to keep recordings that contain errors or distortions . Later you may want to go back over those same data to remaster the recording for mp3, CD, and 24 bit hi res sound.</p><h3>Two cases: transactions vs copies</h3><p>Aggregation into batches (or tuples) can sometimes be a barrier to scaling and to data retention. At what level of processing should we queue and retain process data for future revisitation? For transactions, we should probably retain nothing in the queue (a transaction is a movement of data, not a copy), but for derivative data transformations, which are only copies of source data, there can be a value to keeping intermediate stages for UNDO operations and for changing our minds, during an experimental development phase. File system journals and blockchains are a hybrid approach to keeping transactions over extended time, thus allowing them to be replayed in case of disaster recovery.</p><p>Different sources may have similar or different semantics:</p><ul><li>When data come from different <em>locations</em>, they have no specific order, but they have a unique context to preserve — -yet you might want to eliminate context by averaging.</li><li>When data come from different <em>times</em>, they have a potentially important order — yet, you might want to eliminate that order by declaring each arrival equivalent because they contribute to the same result (e.g. an average).</li><li>etc.</li></ul><p>Intended semantics are central in making these decisions. For example, there is no sense in aggregating security camera footage from different countries, except perhaps for disaster recovery. The sources belong to different contexts. Aircraft black box recorders are another example where data refer to a single “flight episodes”, each with unique legal significance that should not be mixed up. On the other hand, in a different interpretation, we can give an average meaning to certain aspects of multiple episodes of the same flight, since flight routes are repeated many times. Fuel consumption, weather variations, incident reports, etc, could all lead to meaningful average statistics.</p><p><em>Every time we aggregate, we make decisions that are scale dependent and semantics dependent — -a small change in the amount of data or the source characteristics of an aggregation can change the outcome discontinuously.</em></p><h3>Smart means context aware</h3><p>To be an effective tool for data science, a pipeline execution system can try to offer users assistance in dealing with these issues. It can track, measure, and assess metadata as part of its framework of the smart wrapping. The unspoken truth is that statistical methods are unstable as decision making bases — -though machine learning practitioners are starting to realize this — -you can undertrain and you can overtrain your pattern recognition service, leading to very different results.</p><p>If we can’t fully immunize against problems of scale sensitivity, we can at least provide a forensic chain of custody detailing how data were used to derive outcomes so that the steersmen and women of data science can make their own value judgements and policy decisions. This is a topic we’ll have to return to.</p><p><em>Batching of data is an inevitable part of data processing. Deciding when or whether it is the right moment to recompute an answer has arrived is a non-trivial matter — it boils to a policy decision — and we’ve only scratched the surface in this post. How we parse the timeline of data depends on our changing view of intent. Only the process instigator knows whether data have long term significance or only temporary value — -but even those judgements may change, as new ideas come about. In either case, there is an argument to be made for persisting data values for a policy-specified amount of time. In the next posts, we’ll try to unpack how smarter platform semantics can help users to make sense of these issues, in the related larger context of error handling.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fa4b6f5ec8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/11-say-cheese-7fa4b6f5ec8">#11: Say Cheese!</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#10: Swallow the spider to catch the fly]]></title>
            <link>https://medium.com/aljabr/10-swallow-the-spider-to-catch-the-fly-a2586ee46487?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/a2586ee46487</guid>
            <category><![CDATA[data-processing]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Aljabr, Inc.]]></dc:creator>
            <pubDate>Tue, 30 Oct 2018 18:46:27 GMT</pubDate>
            <atom:updated>2018-10-30T18:46:26.983Z</atom:updated>
            <content:encoded><![CDATA[<h4>When infrastructure gets in the way</h4><p><em>The first commandment of data is: Let not infrastructure get out of hand and dominate your data process! You don’t want to swallow an entire horse just to catch a small fly, by starting an entire multi-server cloud just to process a few numbers. At the same time, in any data project, you likely need to think about future scaling, to progress to the ability to ask and answer questions at scale. These are the promises of serverless computing — -but in a more general sense than is sometime implied. However processes are defined, there has to be flexibility and scalable modularity. In this post, we look at how Koalja uses Kubernetes and </em><a href="http://github.com/kocircuit/kocircuit"><em>KoCircuit</em></a><em> to keep a lid on complexity.</em></p><blockquote>“…We need a <em>standard model</em> for shrink-wrapping data processing with pipelines…and the solution should not be tied to a particular language.”</blockquote><p>“Sometimes you want to work on your laptop — but for the big stuff you need more power. Using cloud is non-trivial, and a headache to even think about — what to do? Although we live in an age where developers have begun to develop primarily for other developers, we can’t forget about the ordinary experience of mere mortal users. What we need is a <em>standard model</em> for shrink-wrapping data processing with pipelines that can address these issues. And the solution should not be tied to a particular language.</p><p>There are excellent frameworks, e.g. <a href="https://akka.io/">Akka</a>, TensorFlow, and so on, that are designed for particular languages and for particular tasks, but we want to think beyond these horizons…</p><p>Kubernetes is perhaps the first cloud platform to be thought through as a distributed system, rather than as a collection of useful components. Using containers, it retains the pluggability of a component system, but adds features like namespaces and coordination layers. It can be the basis of a “server free” abstraction, or a point to point chain of services. Like many systems that came before it, its idea to replace free imperative control with declarative composition falls short of reality at some point. Complexity turns declarations into a structureless nightmare — death by a thousand YAML files. Simplicity multiplied by complexity equals complexity, unless you can renormalize it away with new abstractions.</p><h3><a href="https://en.wikipedia.org/wiki/King_Canute_and_the_tide">Canute</a> on the beach, when the walls fell</h3><p>A lot of coordination is needed to run things on a distributed system — even for simple cases. Luckily, today, Kubernetes is available on laptops (minikube/kubeadm) and in the cloud as a service, containing a lot of tools for this environmental purpose.</p><p>Suppose you want to command waves of data flooding in, like King Canute ordering back the tides — then capture them in “a pipe”, and irrigate your services with CSV goodness. Say you want to feed it first into one filter to clean up the noisy CSV data, and then pipe them into another stage that adds up the totals, like the sequence in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*ibVpL3y0sq0rRppy" /></figure><p>The implementation of this pipeline, in Kubernetes is through declarations in YAML. Even for this simplest of cases, the manual incantations needed to set up a Kubernetes cluster might look as complicated as this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*_D_TcfGT2gX5neCG" /></figure><p>That’s quite a mouthful, and not one easily spoken by a king. It could be acceptable as an internal representation, intended for developers, as an intermediate stage in a hidden execution, but it’s not a desirable working format for data scientists. No one even wants to type this in. It’s error prone and hard to see the wood for the trees. Let’s face it — even developers would balk at something much more complex than this, and it gets rapidly more complex as we add parts.</p><h3>Choosing the right concepts</h3><p>Kubernetes was designed as a simple resource layer, not as a programming coordination layer. It was designed initially to support a model of stateless services, running on top of shared storage, for the web. That’s a very popular model for web processing, but not all cloud workloads are well served by this model. It doesn’t offer much in the way of abstractions on top of this. As with nearly all declarative systems, it leaves too much of the story to additional scripting, leading to a mixed model.</p><p>To add more types of workload, in Kubernetes, one has to create a Custom Resource Definition (CRD), which then integrates with the general API server mechanisms and APIs. Many <a href="https://github.com/operator-framework/awesome-operators">technology projects now offer CRDs for Kubernetes</a> to make the deployment of their products and services easier.</p><p>Aljabr’s goal is to elevate the user experience above these details. Our assembler language KoCircuit strips away control flow aspects of pipelines and interfaces to Kubernetes, reducing complexity on a low level. Our upcoming pipeline service <em>Koalja</em> extends out-of-the-box algorithms provided by Kubernetes, in a smart way, to keep the tangible benefits of the stateless model (such as auto-elastic replication, boundary management, and self-healing) without limiting users to a stateless processing model. Koalja implements its features as CRDs and operators within the Kubernetes ecosystem, but does this transparently.</p><p>A <strong>CRD (Custom Resource Definition)</strong> is an interface that allows Kubernetes developers a way to make custom controllers. Not every operation falls into the basic categories if deploy, test, scale, etc. By creating new CRDs, developers can create complex imperative processes, while presenting the user with only simple declarative parameters.</p><p>An <strong>Operator </strong>is an application specific custom controller. It allows basic Kubernetes functionality to be tailored and extended for the specific domain knowledge about an application.</p><p>Kubernetes has internal operators for ReplicaSets DaemonSets and more.</p><h3>Smarter linkage</h3><p>A simple way to improve on the abstractions of a resource layer is to address processes as simple graphs. In our current proto-cloud age, the tendency is for developers to throw piles of half-finished complexity at users “take it or leave it”. Their abstractions are often designed for their own specific needs and internal processes. Maturity in cloud systems can only come by abstracting away these quirks, and eliminating the details of implementations as far as possible. At Aljabr, we believe that Smart DAGs (formed from Smart Tasks and Smart Links) are the answer to this commoditization.</p><p>Passing data around sounds like a straightforward enough task, but developers are not usually thinking about the underlying resource bottlenecks. That ought to be taken care of by the platform, but current platforms can’t do this because they don’t have sufficient insight into their payloads.</p><p><strong>Smart links speak many tongues: </strong>Intermediate data may be stored in a variety of structured or unstructured formats, concealing a variety of technologies for “publishing” and “subscribing” to stashes and flows, each with policy based access rights:</p><ul><li>File stream semantics — READ, WRITE, APPEND</li><li>Query semantics — INSERT INTO, SELECT FROM</li></ul><p>Smart linkage can help to smooth over these differences for users, and handle the potential resource bottlenecks implicit in each. We’ll return to this later in the series.</p><p>Data intensive processing is, by implication, a <em>network intensive</em> process — -even more than it is a CPU intensive process. This is where a smart platform can help. Forget about the underlying structure of microservices, pods, deployments, and service mesh. Those are issues for a platform to virtualize away, not expose to the user.</p><p>Smart links can handle sampling and scaling issues, as well as security and integrity boundaries, and the coordination between different stages. In Koalja, using a smart link abstraction allows us to abstract away a lot of issues, including: instrumentation and tracing (process observability), auto-build, artifact caching, forensic reanalysis, and data consensus coordination between parallel tasks. We are going to be unpacking these ideas in this blog over the coming weeks.</p><h3>Platforms all the way down</h3><p><em>Building abstractions on top of Kubernetes is a path to multi-cloud processing that offers a number of advantages over today’s Do-It-Yourself coding. If we can reduce interactions between services and tasks to the level of drawing a labelled graph, then managing real world processes will finally come of age. Users should not live in fear that their code will not run in a few years time due to changes in infrastructure and its API layers. Smart tasks and links that are aware of the kind of Wide Area Distributed Environment they must inhabit in our cloud future can shift the paradigm towards a standard model for data processing that will outlast technology shifts, and deliver cloud as the utility it need to become.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2586ee46487" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/10-swallow-the-spider-to-catch-the-fly-a2586ee46487">#10: Swallow the spider to catch the fly</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#9: Data, data, everywhere…]]></title>
            <link>https://medium.com/aljabr/9-data-data-everywhere-d4c9b7f100a1?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/d4c9b7f100a1</guid>
            <category><![CDATA[data-processing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Aljabr, Inc.]]></dc:creator>
            <pubDate>Mon, 15 Oct 2018 17:40:47 GMT</pubDate>
            <atom:updated>2018-10-15T17:40:28.628Z</atom:updated>
            <content:encoded><![CDATA[<h4>And Smart Links in between</h4><p><em>In the </em><a href="https://medium.com/aljabr/8-clutching-at-pipelines-f50acf06b981"><em>last chapter</em></a><em>, we talked about simple process abstractions for prototyping in cloud pipelines, but we didn’t say too much about how data move around. This is one of the most important aspects of data processing, as the volume of data is generally far greater than code required to process it. In </em><a href="https://medium.com/aljabr/7-data-in-story-out-a6ffca30e0c"><em>post #7</em></a><em>, we remarked that processing by batch versus stream is just a high level version of the queue scheduling issue that led to packet networks and TCP/IP. Even in a continuous stream, you need to transmit packet by packet to remain agile and to recover from errors. The question is: what are the right abstractions to make these issues transparent for users?</em></p><h3>Drink from the source</h3><p>Data sources are basically generalized sensors, attached to some real world process (see figure below). It might be accounting records, the Internet of Things (smart homes and factory systems, delivery trucks for logistics, or telemetry from aircraft in flight), it might be public Smart City systems, or just users clicking away about their preferences on e-commerce websites. Some data start life far away from the point of analysis, while some are integrated into business processes, already in the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2cJBfAO9-YoRs3RU" /></figure><p>Data sources act as pseudo-services, some local and some remote. In practice, the delivery mechanism for data might be represented in a number of ways — binary or ASCII text, stored as simple file objects, assembled from separate queries to online servers, data buffered through a Kafka stream, or even pushed into multiple queues for batch processing. A file stream may be a pipe, and a service might be a sensor, but in programming terms, the service model forms the bulk of the normal cases. Push and pull semantics can be added as flavors to each, where they make sense in different cases.</p><p>Data updates are sometimes fed into sensory inputs manually, like a batch of coffee beans poured into a grinder, and sometimes they arrive of their own volition. Sometimes they are fetched explicitly, like fetching water from a well. Some tools assume that there is only one appropriate model for input and output, as they are designed for a specific narrow case, and this can cause consternation for users who have designed their thinking around their own constraints. Aljabr’s Koalja embraces these variations without prejudice.</p><h3>Chopping it up</h3><p>How users choose to process data is going to depend on their internal constraints. One of the key issues that’s difficult for users to think about it how to handle the different <em>timescales</em> for inputs. The time between updates, relative to the processing rate and capacity, is key to scaling the processing. Researchers might have the luxury of time freedom, but in an industrialized setting, the processing software, however it may be written, needs to packetize data into batches, and process them with a certain Service Level Objective (SLO). Whether we deal with file objects or a stream abstraction shouldn’t matter, or require different tooling or infrastructure. What we need is an abstraction that works for all these different cases — instead of building a different technology for each case.</p><p><em>Think of the following example: new data arrive from a website analytical engine every few microseconds, but we decide to avoid user disruption and undue cost by processing updates only every hour. Processing an update involves a chain of processes to train a machine learning network. The processing time take 3 hours to complete. Software updates that improve the machine learning network’s algorithms change every few weeks, but may involve updating all the affected artifacts to release a new version of the online service. What do all these timescales mean for the data pipeline in continuous operation?</em></p><h3>Sketching the <a href="https://en.wikipedia.org/wiki/Directed_acyclic_graph">DAG</a></h3><p>A data processing DAG, like any kind of flow circuit, takes time to sketch out, develop, and debug. Some parts of the circuit will be of our own making, others will be exterior off-the-shelf services and sources that we want to integrate. A mixture of strategy and technical architecture is involved, as in any programming task. As this becomes a more common business task, users will want to do this flexibly — on their phones, pads, or laptops, lying under a coconut tree at the beach, instead of being tied to a data center terminal. They will want access to the real data, wherever they may be, rather than spending time to fake a small amount of data for testing. They won’t want to have to set up a new platform to do that. They won’t even want to know if there is a platform.</p><p><em>Today, most pipeline technologies are written for developers or engineers. The assumption is that users will not only be adept at cloud development (and in a variety of languages), but that they will enjoy learning new platform details and becoming part of a new tribe dancing around a git repository. Software is mainly being written for that persona, instead of for business users or data scientists. Users are thrown into the deep end, having to not only think about the reasoning behind their business process, but also confronted by a dearth of technological decisions: which database, which programming language, where to hire expert help. Users are expected to keep track of reams of configuration settings, build unfamiliar intermediary objects like containers, submit them for deployment, map port number and IP addresses, set up proxies. The Internet has become a `kit car’ on steroids rather than a self-driving delivery truck — not really suitable for global logistics without a team of traveling mechanics.</em></p><h3>Making the drop off</h3><p>Underlying the difficulties of data processing is a growing burden of technological overhead. Modern cloud computing has too many moving parts. We think of <a href="https://en.wikipedia.org/wiki/Mark_Weiser">Mark Weiser</a>’s observation about mature technologies being those that <a href="http://markburgess.org/talkingwalls.html">disappear into the walls</a>, and ask: how can we make the technology disappear for ordinary users, without compromising their ability to customize and optimize their processing needs?</p><p>The essence of automation is to let the machinery do the heavy lifting, and let the humans do the thinking. Today, the heavy lifting is not as heavy, but there are many more layers of it! This is not a problem that is particular to data pipelines, but rather to situations where collaborative processes exchange data. In our minds, DAGs might look like flowcharts or microservices, but in practice they are far more intricate.</p><p>Let’s think about the ideal user experience for the average user. Data scientists like to think about the flow of reasoning using a mixture of ad hoc manual experiments, combined in a series of simple interactive steps, and eventually scripted to document the steps. They might start with single step transformations:</p><pre>Run program_A &lt; input &gt; output<br>Run program_B | filter</pre><p>Then they might progress to a standard set of steps that run as a service, allowing them to drop an update into a queue, where it will be picked up and processed automatically.</p><pre>Drop &lt;fileref&gt; at &lt;input ref&gt;<br>Drop &lt;directory&gt; at &lt;input ref&gt; order bydate/random</pre><p>A developer might do the same, but using a version control system to `commit` a change, instead of dropping a file. Both personas might want to have the freedom and safety to play around with data before pushing a button to commit to authorizing the next stage of a computation.</p><blockquote>Databases are also files — structured ones. From a database perspective, a file drop is an “INSERT INTO” operation, while a sampling of data is a “SELECT FROM” operation. A database can be a partially ordered queue in between these two.</blockquote><h3>Smart links</h3><p>In principle, the experience sounds easy, but, of course, things that add layers of headaches are:</p><ul><li>The data formatting or type schema interpretation between stages</li><li>The proxy for intermediate buffering between stages</li></ul><p>The ingenious idea of <a href="https://en.wikipedia.org/wiki/Pipeline_(Unix)">pipes in Unix</a> made simple joins easy for text streams, but in a modern environment, we need pipes to have matching multivariate data semantics, different for each link. We also need to handle privacy, access controls, and buffer differences in timescales on the input and output, i.e. to handle batching of data, we need smart storage to be embedded within the links. That might involve a message bus, a file, or a database from one of the multitude of possible flavors and variants available (TensorFlow, Kafka, Spark, Heron, ONNX, PyTorch, etc.), with implicit semantics. Users want to focus on the data semantics, not on setting up the technology, installing endless database connector APIs, and then go through dependency hell to make the versions compatible.</p><p>In Koalja, we provide the support for <em>smart links</em> between <em>smart tasks, </em>to handle a number of policy decisions and abstract away contextually irrelevant details and highlight priorities. Suppose you could just say:</p><pre>Konnect stage1 stage2a with link2a<br>Konnect stage1 stage2b with link2b</pre><p>(see figure below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/0*IaJG254j1p4Vt5pK" /></figure><p>By wrapping user transformations (tasks) in smart connectors, we can follow a long tradition of modular pipeline technology used in recording studios and performance software, from patchboards to mixing desks — like an adaptive breadboard for data processing. Imagine that each “smart link” has an adaptive “volume control” setting the sampling rate for data to a maximum level to limit the computational resources invoked by the pipeline. A coordinator can now elastically scale from a wireframe test configuration to full production density by adjusting these settings, as well as change other policy settings. Additional sliders may be used to control other aspects of smart behavior.</p><p>We can try to preserve the simplicity of something like a <a href="https://nodered.org/">Node Red</a> interface — but as users advance in their sophistication, they will want more control, perhaps through a language interface. The Internet of Things makes a fitting and highly relevant example of some other aspects of data processing, too. Smart houses are easy, but smart cities involve the collaboration of multiple jurisdictional workspaces. Just how smart do we want a process to be on our behalf? What aspects of setting up and running can be absorbed into smartness? These are key questions that we’ll delve into in the coming weeks.</p><p><em>Even before Kubernetes existed, we speculated on the idea of </em><a href="http://markburgess.org/workspaces.html"><em>Smart Workspaces</em></a><em> for spanning distributed environments for the Internet of Things, with role based access layers and transparent traceability — from computing at the edge of the network, in vehicles and homes. Kubernetes is a platform that could make that vision a reality. If we solve this basic problem, the applications are truly limitless.</em></p><h3>Computing from edge to center</h3><p>When dealing with large processing volumes, the principle is to move computation to where the data are, not the other way around. The less we have to transmit, the better. Computers are everywhere, so it makes sense for the first stages of pipelines to be <em>in situ</em>, in the field, not in a backend data center / “on-prem” cloud (i.e. EC2). There is then scope for filtering and security-privacy policy.</p><p><em>Koalja is a vision for a smart data processing platform — a practical way of breadboarding and wireframing data circuitry for engineers and data scientists, involved in a distributed collaboration, where all the technology is concealed in the walls.</em></p><p><em>In the next chapters, we’ll unravel what it means for links and tasks to be smart.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4c9b7f100a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/9-data-data-everywhere-d4c9b7f100a1">#9: Data, data, everywhere…</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#8: Clutching at pipelines]]></title>
            <link>https://medium.com/aljabr/8-clutching-at-pipelines-f50acf06b981?source=rss----b2a8b6bc547b---4</link>
            <guid isPermaLink="false">https://medium.com/p/f50acf06b981</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Aljabr, Inc.]]></dc:creator>
            <pubDate>Wed, 10 Oct 2018 19:48:05 GMT</pubDate>
            <atom:updated>2018-10-12T18:45:11.187Z</atom:updated>
            <content:encoded><![CDATA[<h4>The world of the Koalja</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rb4-cFy6LloiXUfF" /></figure><p><em>Over the past weeks, we’ve looked at various models for data pipelines, or workflow in the form of data processing. From simple shell scripts, where workflow is commanded by edict, to makefiles and distributed convergent configurators, where workflow is steered and optimized by the guiding star of a desired end state. What we end up with is a picture of result-oriented computing at scale. This is not a new vision, per se, but everything is new again in the multi-cloud-native era. So, we’re returning to the fundamentals: how can we make pipeline processing both simple and easy in the age of Cloud? </em><strong><em>Welcome to Aljabr’s Koalja project.</em></strong></p><p>Our goal of making pipelines simple points to both technical principles and a strong attention to the user experience. Let’s try to peel back some of these issues.</p><h3>Utility computing</h3><p>Utility computing, in all its forms, is destined to subsume all our backend systems over the next decade or two. Even computing at the edge, in our homes and environments will likely be run by cloud providers, as they merge with telecommunications giants to serve us information infrastructure as a utility. Looking ahead to that trajectory, and to make better use of the commodity service, we need a model that can scale not only computationally and geographically but also <em>transparently</em>. This is not without its challenges! But let’s start with some pragmatic considerations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VzY5F5669zae5JN2MWOoDg.png" /></figure><p>The diagram above shows a tiny handful of tools for data processing, with circles for specialists and boxes for integrated overlays. Existing task managers occupy different abstraction realms, and we are starting to see overlays like <a href="https://beam.apache.org/">Apache Beam</a> that unify the patchwork of specialities using meta managers. Koalja belongs to this meta level too, as it spans the full range of pipeline types with a data-oriented model.</p><p>What’s missing from this pantheon of tools is a simple pluggable framework that could be used to build a library of solutions for data processing, based on use case rather than on technology. TensorFlow and recent machine learning frameworks are examples of use case tailored approaches for specific cultural groups. On the other hand, we don’t want to try to replace any existing technology (even if that could bring efficiency): today, technology adoption is driven to a large extent by allegiances to signature open source projects, so we should not undermine the positions of these tools, but rather find a way to subsume and abstract them appropriately!</p><h3>Data and culture driven</h3><p>Pipeline consumers are data scientists, developers, and business processes following recipes. None of these have a primary interest in the technical aspects of data flow, and even less interest in the internals of the cloud (i.e. compute infrastructure primitives). A practical advantage of a meta-oriented data-driven system is that, once a tool understands the data flow, the user doesn’t need to codify resource requirements directly (as you would with task management tools) because it can largely be inferred from the data relationships themselves.</p><p>There are significant cultural differences between these groups too, especially in how users like to work on coding and data collection. A meta-pipeline can’t be too opinionated and force users to change their habits. Some users will appreciate a “serverless” / event-driven functional approach to coding, with minimal technical infrastructure awareness required, while others will prefer to package containers and take control of low-level details.</p><p>The container virtualization model for packaging and execution of software, up to and including unikernels, will almost certainly survive generational shifts for managing deployment units, so we can safely assume that a form of containerization will be a desirable feature — without mentioning any specifics. Kubernetes is now dominating the runtime management of container workloads, in a fairly agnostic way, so a good starting point for cloud data processing is to take a Kubernetes platform, with the goal of making it vanish into the walls, like a transparent underlay. Only specialists will actually have an interest in the underlay, but currently everyone is confronted with the detailed setup of all the layers, so there is a huge opportunity to cater to non-specialists.</p><h4>Bread and circuitry</h4><p>Data processing involves a lot of trial and error, during which it is quite helpful to maintain agility and flexibility. If we’re careful about the design, we can try to preserve the sense of prototyping through to production, using abstractions around the management of runtime environments. We can explain this using an example from electronics — which is quite similar in spirit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*ZC9326zmP6FrIEDs" /></figure><p>Think of the following analogy: Back in the 1980s when electronics was a hobbyist pursuit, <a href="https://en.wikipedia.org/wiki/Breadboard"><em>breadboards</em></a> were invented to enable pluggable circuit design. No need for a soldering iron, and designing for permanence at the tinkering stage! Bread boards allowed users to plug in and rip apart. Breadboards represented the earliest kind of circuit board virtualization (see the top right figure above). It was a great idea: reversible, low risk, if not too elegant. Breadboards are still used by hobbyists to design and construct circuitry. Of course, probably no one would try to deploy such a mockup circuit “into production”, we would first turn it into a packaged, productized version, with a printed circuit board, or ultimately a <a href="https://en.wikipedia.org/wiki/Very-large-scale_integration">VLSI</a> chip. Now, we have languages like <a href="https://en.wikipedia.org/wiki/Verilog">Verilog</a> to assist in virtualization of chip design in code. This is all very expensive, but software is cheaper than committing to hardware.</p><p>Every early stage technology “breadboards” its way to maturity, exposing all the wiring to enthusiastic hobbyists, and celebrating its ingenuity, tweaking the system along the way. Eventually we want to make the outcome small and efficient, like VLSI. This extends all the way up to the giant chip layouts of cloud infrastructure (as in the bottom right of the figure above). Virtualization opens up the possibility of transforming mockups directly into production scale and quality, if only the underlying “cloudboard” is smart enough.</p><p>Our goal with Koalja is to create a smart platform that can adapt from prototyping to production without having to know about scale or machinery. The Kubernetes ecosystem is gradually improving to make this a plausible goal. Intermediate languages like <a href="https://twitter.com/asynchio/status/1044326512399241216">Ko</a>, and extensions like <a href="https://cloud.google.com/knative/">Knative</a> can play a role in bridging the gap. Users will focus on their data and reasoning, and we leave the rest to Arthur C. Clarke’s <a href="https://en.wikipedia.org/wiki/Clarke%27s_three_laws">third</a> law.</p><h3>Summary</h3><p>Imagine a plugin model of data pipeline components, with container integration to wrap and modularize software components, and transparent integration with data sources. Some data circuit components look like transformers and diodes, while some look like service flux capacitors. Some integrated services will even have their own external service dependencies, provided by third parties. This adds to the complexity of scaling, but it should not add to the complexity for the user. It all gets quite complicated in the utility-driven future. Koalja wraps itself around these branching data paths and embraces their diversity with a friendly face.</p><p>In the next chapter, we’ll talk about how data move around a virtual circuit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f50acf06b981" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aljabr/8-clutching-at-pipelines-f50acf06b981">#8: Clutching at pipelines</a> was originally published in <a href="https://medium.com/aljabr">Aljabr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>