<?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[Stories by Luke Thorp on Medium]]></title>
        <description><![CDATA[Stories by Luke Thorp on Medium]]></description>
        <link>https://medium.com/@lukethorp?source=rss-28e57e146294------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XouHYMvSHcHg3XO-LeY32w.jpeg</url>
            <title>Stories by Luke Thorp on Medium</title>
            <link>https://medium.com/@lukethorp?source=rss-28e57e146294------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:32:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukethorp/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Soft Skills in Data Science — Let’s Talk About That]]></title>
            <link>https://medium.com/data-science/soft-skills-in-data-science-lets-talk-about-that-9d0db96ad2d7?source=rss-28e57e146294------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d0db96ad2d7</guid>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[soft-skills]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Luke Thorp]]></dc:creator>
            <pubDate>Sat, 04 Dec 2021 05:39:28 GMT</pubDate>
            <atom:updated>2021-12-04T05:39:28.332Z</atom:updated>
            <content:encoded><![CDATA[<h3>Soft Skills in Data Science: Let’s Talk About That</h3><h4>There is more to being a Data Scientist than just technical skills. Lets take a look at what soft skills can help you on your way to becoming a great Data Scientist</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuvdk3mZ97HGDa2_ky2jwg.jpeg" /><figcaption><a href="https://pixabay.com/photos/board-chalk-business-job-work-3695073/">Pixabay</a></figcaption></figure><p>We all see the job boards and we all see the list of doom when it comes to the required technical skillset. I have seen jobs requiring 15 years’ experience in Spark (it was only released to the public in 2012). But even the reasonable ones have enormous expectations, so tackling these skills can be daunting. Many people, both aspiring data scientists and experienced ones spend their time learning complex modelling techniques… not that they aren’t important, however, it’s worth noting, they aren’t everything.</p><h4>If not technical requirements, what else?</h4><p>So, there is a mystical beast that plays a key role in becoming a great data scientist, no… not deep learning, soft skills! Soft skills are what separates the average data scientist from the unicorn. Those able to understand and help stakeholders define and most importantly execute clear, meaningful projects.</p><p>Having even some of these skills nailed down will inevitably help you on your journey to becoming a standout candidate at any organisation. It is worth noting, this article contains my own findings and experiences with people I look up to in the data science world.</p><h4>Understanding</h4><p>Some of the best data scientists I know might not be the most technical or have the best degree from the most prestigious university, but they are able to apply their knowledge to business problems both efficiently and effectively.</p><p>So, how do they do it? It’s quite simple really, they take the time to listen, listen again, and finally, listen some more. They take in the information from their stakeholder or customer, then ask the critical question… why? Generally, stakeholders have an idea of what they want in their head, whether that be a dashboard with KPI’s, a prediction of the next quarters sales or something else. It might simple or easy, but if we just build what someone asks, we are not going to be producing our best work or more importantly, results which have a lasting impact. We need to critically understand the problem space and apply our technical experience to solve said problem in the best possible way. We aren’t going to know what the best solution is going to be, without listening and asking the tough questions.</p><p>Sometimes stakeholders can find it off putting to be asked the “why” question, but it’s the easiest way to understand from an emotional perspective how the problem affects their work and how a potential solution could ease a burden or provide value to an end user. “Why” allows us to dive deep into the problem space and define a solution alongside our stakeholder which might meet their end goal in a more effective manner.</p><p>Ok, so we know what the problem is, and the real reason; why it is a problem, but how do we think of a solution?</p><h4>Product/Industry Understanding</h4><p><a href="https://www.youtube.com/watch?v=MFzDaBzBlL0">“Knowledge is not understanding”</a>: Having knowledge of the product space is a great first step, knowing that a product has specific features and knowing that the customer does something in a particular way is another step. But, truly understanding why a product works as it does, and understanding why a customer has a specific problem is key.</p><p>A data scientist should be striving to understand their product and customer as fully as possible, because if they don’t, it will be like swimming up a waterfall. You aren’t a salmon!</p><blockquote>Once you have a rigid way of thinking in your head, sometimes you cannot change it, even if you want to.</blockquote><p>You have to force a new way of thinking; this is usually by stepping out of your comfort zone and taking the new method head on!</p><p>Industry understanding isn’t something you can change overnight, but you can change your habits to enable faster growth in this area. Working with your stakeholders, stepping into their shoes, speaking to customers.</p><h3>Business Business Business</h3><p>Yes, we don’t all work in a typical business environment, however if you do, proper business acumen goes a long way to securing trust and support from your stakeholders.</p><p>I have worked in businesses of all shapes and sizes, from small scale start-ups to global powerhouses, but all have non-data people who you need to hand hold through the process. It’s not a negative thing, but it is bringing someone along a journey that they otherwise would have ignored.</p><p>How do you bring someone on this journey? Storytelling! There are many methods for creating a narrative with your work and a good method I have used in the past is pulled from interview techniques.</p><p>The STAR technique is used by interviewees to explain a project or narrative, from the problem through to solution.</p><h4>Situation</h4><p>Set the scene and give the necessary details of your project at a top level.</p><h4>Task</h4><p>Describe what your solution covers in relation to the problem.</p><h4>Action</h4><p>How was the problem tackled, are there any interesting revelations not related to results.</p><h4>Result</h4><p>Share what outcomes your actions achieved.</p><h4>The Secret R: Retrospective</h4><p>Being able to define what went well and what went badly during a project is key, especially if you don’t want to make the same mistake in the future!</p><p>This method is a very simple and basic approach to defining a narrative, however, there are many superior ones.</p><p>This article by Ling Wong is a great detailed discussion about how to create narrative and clarity with your storytelling:</p><p><a href="https://www.gokantaloupe.com/blog/best-techniques-for-data-driven-storytelling">Effective Data-Driven Storytelling: 9 Techniques | Kantaloupe</a></p><p>Finally if you want more information on the STAR method, check this out. Yes it’s from an interview perspective, but you get the drift.</p><p><a href="https://www.themuse.com/advice/star-interview-method">How to Use the STAR Method to Answer Any Behavioral Interview Question</a></p><h3>Being a Team Player</h3><p>Being a team player means being adaptive to the situations around you. Not everyone might have the vision or scope of your knowledge, but it’s worth noting. You don’t have theirs!</p><p>Listen to your team, learn from them, share your knowledge. A great way to do this is to share your work regularly, even if you aren’t working on the same problem. Doing this will help to identify holes in your reasoning, they aren’t there to put you down, they are there to rise you up and help you cement trust with your stakeholders. Doing the same thing with your team will help to create a good team bond and propel the team forward when projects might be a little stagnant.</p><p>Secondly, being adaptive to new situations is a key part of this process. Adaptability will enable you and your team to pivot to the most important aspects of projects while keeping the overall objective and scope in mind. It’s important to not just use the same approach to a solution, because it worked last time. There may be new or simpler approach which process a much-improved result. Open your mind to new ideas and adapt to changes in requirements fast and efficiently. Remember stakeholders aren’t always data people and they are not aware of how small changes to scope can have huge impact from a data science perspective. It’s best to approach these changes pragmatically and put yourself in the shoes of the stakeholder.</p><h3>Curiosity</h3><p>Finally, be curious! Ask questions, seek out new areas or data blind spots. Sit alongside your stakeholders to truly understand the business landscape and most of all, learn! Not just technical skills but learn how and why customers and stakeholders do what they do.</p><blockquote>I have no special talents. I am only passionately curious. (Albert Einstein)</blockquote><p>If you use some of the approaches listed above, you will become a much-improved data scientist. Yes, you have spent years honing your craft when it comes to programming, statistics or machine learning, but spend some time learning your customer.</p><h3>Empathy</h3><p>I know, I know, I said that the last section was the final part, but empathy plays a huge factor being a great data scientist. Many people take this part for granted, many people are great at it, many are not. Put yourself into your stakeholders’ shoes to truly understand how they solve problems, tackle obstacles and overcome deadlines. It will help you as a data scientist, to keep motivated, as you will understand how your new solution will really benefit and improve a stakeholders work on a daily basis.</p><p>Many people have some of these skills, but remember, you are a team, work with others to solve the difficult problems. Develop solutions together as in a team you will be able to create some incredible value for those around you.</p><p>I am still working on my career, improving my craft, and understanding what it means to be a good data scientist (I’m not sure if I’m there just yet!). I have a long way to go and I’m sure it will take time, but one step at a time and you can become a great data scientist.</p><p>If there is one take away… try to be open minded to the people you are trying to help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d0db96ad2d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/soft-skills-in-data-science-lets-talk-about-that-9d0db96ad2d7">Soft Skills in Data Science — Let’s Talk About That</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Spark — Multi-part Series: Spark Architecture]]></title>
            <link>https://medium.com/data-science/apache-spark-multi-part-series-spark-architecture-461d81e24010?source=rss-28e57e146294------2</link>
            <guid isPermaLink="false">https://medium.com/p/461d81e24010</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[making-sense-of-big-data]]></category>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[Luke Thorp]]></dc:creator>
            <pubDate>Sun, 14 Mar 2021 17:07:06 GMT</pubDate>
            <atom:updated>2022-01-21T08:59:27.954Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/tagged/making-sense-of-big-data">Making Sense of Big Data</a></h4><h3>Apache Spark — Multi-part Series: Spark Architecture</h3><p>Spark Architecture was one of the toughest elements to grasp when initially learning about Spark. I think one of the main reasons is that there is a vast amount of information out there, but nothing which gives insight into all aspects of the Spark Ecosystem. This is most likely because, its complicated! There are so many fantastic resources out there, but not all are intuitive or easy to follow.</p><p>I am hoping this part of the series will help people who have very little knowledge of the topic understand how Spark Architecture is built, from the foundations up. We will also investigate how we can provide our Spark system with work and how that work is consumed and completed by the system in the most efficient way possible.</p><p>As promised, this section is going to be a little more heavy. So buckle yourself in, this is going to be fun!</p><h3>Physical Spark Hierarchy:</h3><p>To understand how Spark programs work, we need to understand how a Spark system is built, brick by brick (see what I did there). There are a number of different ways to set up a Spark system, but for this part in the series we will discuss one of the most popular ways to set it up.</p><p>Generally, a Spark system is built using a number of separate machines who all work together towards a common goal, this is referred to as a <em>cluster</em> or <em>distributed system</em>. For a system like this to work, we need to have a machine which manages the cluster as a whole. This machine is usually labelled as the <em>driver node</em>.</p><h4>Driver Node</h4><p>The Spark driver is used to orchestrate the whole Spark cluster, this means it will manage the work which is distributed across the cluster as well as what machines are available throughout the cluster lifetime.</p><figure><img alt="Driver Node Step by Step (created by Luke Thorp)" src="https://cdn-images-1.medium.com/max/529/1*jLVo8Bl4m9pXhADFxzbDVA.png" /><figcaption>Driver Node Step by Step (created by Luke Thorp)</figcaption></figure><ol><li>The driver node is like any other machine, it has hardware such as a CPU, memory, DISKs and a cache, however, these hardware components are used to host the Spark Program and manage the wider cluster. The driver is the users link, between themselves, and the physical compute required to complete any work submitted to the cluster.</li><li>As Spark is written in Scala, it is important to remember that any machine within the cluster needs to have a JVM (Java Virtual Machine) running, so that Spark can work with the hardware on the host.</li><li>The Spark Program runs inside of this JVM and is used to create the SparkContext, which is the access point for the user to the Spark Cluster.</li></ol><p>The driver contains the DAG (Directed Acyclic Graph) scheduler, task scheduler, backend scheduler and the block manager. These driver components are responsible for translating user code into Spark jobs executed on the cluster. Hidden away within the driver node is the cluster manager, which is responsible for acquiring resources on the Spark cluster and allocating them to a Spark job. These resources come in the form of <em>worker nodes</em>.</p><h4>Worker Node(s)</h4><p>Worker nodes form the <em>“distributed”</em> part of the cluster. These nodes come in all shapes and sizes and don’t always have to be the same to join a cluster, they can vary in size and performance. Although, having worker nodes which perform equally, can be a benefit when investigating performance bottlenecks further down the line. So, it’s something to bear in mind.</p><figure><img alt="Worker Node Step by Step (created by Luke Thorp)" src="https://cdn-images-1.medium.com/max/1024/1*G2lJTWP5Y8alFBXNC_ZO0A.png" /><figcaption>Worker Node Step by Step (created by Luke Thorp)</figcaption></figure><ol><li>Worker nodes are generally stand-alone machines which have hardware like any other. Such as a CPU, memory, disks and a cache.</li><li>As with the driver, for Spark to run on a worker node, we need to ensure that the system has a compatible version of Java installed so that the code can be interpreted in the correct and meaningful way.</li><li>When we have Spark installed on our worker node, our driver node will be able to utilise its cluster management capabilities to map what hardware is available on the worker. <br>The cluster manager will track the number of <em>“slots”</em>, which are essentially the number of cores available on the device. These slots are classified as available chucks of compute and they can be provided tasks to complete by the driver node.<br>There is an amount of available memory which is split into two sections, storage memory and working memory. The default ratio of this is 50:50, but this can be changed in the Spark config.<br>Each worker also has a number of disks attached. But I know what you are going to say, Spark works in memory, not disk! However, Spark still needs disks to allocate shuffle partitions (discussed further, later in this article), it also needs space for persistence to disk and also spill to disk.</li><li>Now we have the details of how Driver nodes and Worker nodes are structured, we need to know how that interact and deal with <em>work</em>.<br>For this we will create a minimalist version of the diagram to show a worker node and its available slots for work.</li></ol><h4>Minimised Physical Structure</h4><p>Now that we know how the Driver and Workers are structured independently, we can look into how they are intrinsically linked within the context of a cluster. As stated above we will simplify the view of the worker node, such that it shows only the elements that are important for the next section. (They still have memory and disks!)</p><p>Looking at the Driver and Worker nodes we can see that the Driver node is the central hub for communication between nodes in the cluster.</p><figure><img alt="Driver Node and Worker Node Architecture (created by Luke Thorp)" src="https://cdn-images-1.medium.com/max/512/1*QyiZ1hi0W5Vva-4-ZAtZSA.png" /><figcaption>Driver Node and Worker Node Architecture (created by Luke Thorp)</figcaption></figure><p>Worker nodes are able to communicate and pass data between each other but in regards to work and tasks, the Driver node is solely responsible for providing Workers with jobs to complete.</p><p>With the example above, we have a cluster containing a driver, and three worker nodes. Each node has four slots of compute available, so, this cluster would be able to complete twelve tasks in unison. It is worth mentioning that Sparks <em>new</em> photon engine is a Spark compatible vectorised query engine which has been developed to meet and take advantage of the latest CPU architecture. This enables faster parallel processing of data and even live performance improvements as data is read during task execution.</p><h3>Spark Runtime Architecture</h3><p>The Spark runtime architecture is exactly what it says on the tin, what happens to the cluster at the moment of code being run. Well, “code being run” might be the wrong phase. Spark has both eager and lazy evaluation. Spark actions are eager; however, transformations are lazy by nature.</p><p>As stated above, transformations are lazy, this essentially means when we call some operation on our data, it does not execute immediately. Spark maintains the record of which operation is being called. These operations can include joins and filters.</p><p>Actions are eager, which means that when an action is called, the cluster will start to compute the expected results as soon as the line of code is run. When Actions are run, they result in a non-RDD (resilient distributed dataset) component.</p><h4>Types of Transformations:</h4><p>There are two types of transformations which are key to understanding how Spark manages data and computes in a distributed manner, these are <strong>narrow</strong> and <strong>wide</strong>. Transformations create RDDs from each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*iS8Bo_SfgOudrKCCVkWXIA.png" /><figcaption>Narrow and Wide Transformations (created by Luke Thorp)</figcaption></figure><ul><li>Narrow Transformations are defined by one input partition will result in one output partition. An example of this could be a <em>filter</em>: as we can have a data frame of data which we can filter down to a smaller dataset without the need to understand any data held on any other worker node.</li><li>Wide transformations (shuffles) are defined by the fact the worker nodes will need to transfer (shuffle) data across the network to complete the required task. An example of this could be a <em>join</em>: as we may need to collect data from across the cluster to complete a join of two datasets fully and correctly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*EhRjctEJVpjCxWJ6W6jTXw.png" /><figcaption>Wide Transformations Extended (created by Luke Thorp)</figcaption></figure><p>Wide transformations can take many forms, and <em>n</em> input partitions may not always results in <em>n</em> output partitions. As stated above, <em>joins</em> are classed as wide transformations. So in the instance above, we have two RDD’s which have varying number of partitions being joined together to form a new RDD.</p><h4>Runtime</h4><p>When the user submits code to the driver via their preferred method, the driver implicitly converts the code containing transformations (filters, joins, groupby, unions, etc) and actions (counts, writes, etc) into an unresolved logical plan.</p><p>At the submission stage, the driver refers to the logical plan catalog to ensure all code conforms to the required parameters, after this is complete the unresolved logical plan is tranformed into a logical plan. The process now performs optimisations, like planning transformations and actions, this optimiser is better know as the catalyst optimiser.</p><blockquote>At the core of Spark SQL is the Catalyst optimizer, which leverages advanced programming language features (e.g. Scala’s pattern matching and quasi quotes) in a novel way to build an extensible query optimizer. Catalyst is based on functional programming constructs in Scala and designed with these key two purposes:</blockquote><blockquote>- Easily add new optimization techniques and features to Spark SQL</blockquote><blockquote>- Enable external developers to extend the optimizer (e.g. adding data source specific rules, support for new data types, etc.)</blockquote><blockquote><a href="https://databricks.com/glossary/catalyst-optimizer">https://databricks.com/glossary/catalyst-optimizer</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*guHPBFfkuqZHzChV.png" /><figcaption>Apache Spark Catalyst Optimiser: Databricks (<a href="https://databricks.com/glossary/catalyst-optimizer">https://databricks.com/glossary/catalyst-optimizer</a>)</figcaption></figure><p>I will be doing a deep dive into the catalyst optimiser in the next part of the series, so don’t worry about that part too much.</p><p>Once the optimisations are complete, the logical plan is converted into multiple physical execution plans, these plans are funnelled into a cost model with analyses each plan and applies a cost value to run each execution plan. The plan with the lowest cost to complete will be selected as the final output. This selected execution plan will contain job(s) with multiple stages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*aLhtMajhHD9cdhM_9xqkaw.png" /><figcaption>Physical Execution Plan (created by Luke Thorp)</figcaption></figure><p>Stages have small physical called tasks which are bundled to be sent to the Spark cluster. Before these tasks are distributed, the driver program talks to the cluster manager to negotiate for resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*72nCk3E82FsSu8CFfmPHzA.png" /><figcaption>Cluster Task Assignment (created by Luke Thorp)</figcaption></figure><p>Once this is done and resources have been allocated, tasks are distributed to the worker nodes (executors) who have free time, and the driver program monitors the progress. This is done in the most efficient way possible keeping in mind the current available resources and the cluster structure. In the above example it is simple, we have three tasks to distribute to three worker nodes. Tasks could be distributed in the way above, i.e. one task to each worker node, or they could be sent to one node and still run asynchronously due to the parallel nature of Spark. But complexity arises when we have more tasks than available slots of compute, or when we have a non uniformly divisible number of tasks compared to that of the nodes in the cluster. Luckily for us, Spark deals with this itself and manages the task distribution.</p><p>It is worth mentioning, although Spark can distribute tasks in and efficient way, it cannot always interpret the data, meaning, we could encounter data skew which can cause vast time differences in task duration. However, this all depends on how the underlying data lake is structured. If it is built using Delta Engine (Photon) we can take advantage of the live improvement to query execution as well as improvements which encourage better shuffle sizes and optimal join types.</p><p>The Spark UI (user interface) allows the user to interogate the entire workload process, meaning the user can dive into each part. For example, there are tabs for Jobs and Stages. By moving into a stage the user can look at metrics related to specific tasks, this method can be used to understand why specific jobs may be taking longer than expected to complete.</p><h3>Cloud vs Local</h3><p>As I am sure you have guessed, Spark clusters are generally built within a cloud environment using popular services from cloud service providers. This is done due to the scalability, reliability and cost effectiveness of these services. However, you may not be aware that you can run Spark on your local machine if you want to play around with the Spark config.</p><p>By far the easiest option for tinkering, is to sign up to the community edition of Databricks. This allows you to create a small but reasonably powerful single worker node cluster with the capability to run all of the Databricks code examples and notebooks. If you haven’t done it already… do it! There are limitations and the clusters do timeout after two hours of idle time, but free compute is free compute!</p><h3>Finally</h3><p>Spark Architecture is hard. It takes time to understand the physical elements, and how the core runtime code translates into data being transformed and moving around a cluster. As we work through the series, we will continue to refer back to this section to ensure we all have the fundamentals locked into our grey matter.</p><p>For this series, I will be looking into ways that we will be able to dive even deeper into the depths of Spark such that we can understand the bare bones of the JVM structurre and how the optimisers function on our unresolved logical plans.</p><p>It is worth noting that there will be an upcoming section, where we will be building a Spark cluster using a Raspberry Pi as the Driver node, and a number of Raspberry Pi Zero’s as the Worker Nodes. I just need to wait for the items to be delivered… Covid delivery times are slow!</p><p>If I have missed anything from this section, or if something still isn’t clear, please let me know so that I can improve this series and not to mention my Spark knowledge! You can find me on LinkedIn:</p><p><a href="https://www.linkedin.com/in/luke-thorp/">Luke Thorp - Senior Data Scientist - BBC | LinkedIn</a></p><h3>Series Sections:</h3><p><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-introduction-37735823c3cc">Introduction</a></p><ol><li><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-what-is-apache-spark-63c3f6caa3c">What is Apache Spark</a></li><li><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-spark-architecture-461d81e24010">Spark Architecture</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461d81e24010" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/apache-spark-multi-part-series-spark-architecture-461d81e24010">Apache Spark — Multi-part Series: Spark Architecture</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Spark — Multi-part Series: What is Apache Spark?]]></title>
            <link>https://lukethorp.medium.com/apache-spark-multi-part-series-what-is-apache-spark-63c3f6caa3c?source=rss-28e57e146294------2</link>
            <guid isPermaLink="false">https://medium.com/p/63c3f6caa3c</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Luke Thorp]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 11:30:37 GMT</pubDate>
            <atom:updated>2021-03-15T18:26:06.900Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Spark — Multi-part Series: What is Apache Spark?</h3><p>The main driving goal of Apache Spark is to enable users to build big data applications via a unified platform in an accessible and familiar way. Spark is designed in such a way that traditional data engineers and analytical developers will be able to integrate their current skill sets, whether that be coding languages or data structures with ease.</p><p><em>But what does that all mean and you still haven’t answered the question!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*LZpZI13uZmisD1UV6spV2Q.png" /><figcaption><a href="https://www.datanami.com/2019/03/08/a-decade-later-apache-spark-still-going-strong/">https://www.datanami.com/2019/03/08/a-decade-later-apache-spark-still-going-strong/</a></figcaption></figure><p>Apache Spark is a computing engine which contains multiple API’s (Application Programming Interfaces), these API’s allow a user to interact using traditional methods with the back-end Spark engine. One key aspect of Apache Spark is that it does not store data for a long period of time. Data can be notoriously expensive to move from one location to another so Apache Spark utilises its compute functionality over the data, wherever it resides. Within the Apache Spark user interfaces, Spark tries to ensure that each storage system looks reasonably similar so that applications do not need to worry about where their data is stored.</p><p>This compute engine allows a user to create an end to end solution which utilises the distributed capabilities of multiple machines all working towards a common goal. This could be large scale aggregations, machine learning on large data sets or even streaming of data with massive throughput. Most of these problems are commonly reffered to as <em>“Big Data”</em>.</p><h3>Why is Big Data a Problem?</h3><p>Big data has many definitions, but one that stuck with me is:</p><blockquote>If data is too big to fit onto your device, it’s Big Data!</blockquote><p>The term “big data” has been around for many, many years. So being able to do analysis on this data has been a challenge, almost since computing began! There have been many engines and systems built to help manage big data and they all utilise different methods to increase speed, efficiency and reliability. Parallel compute was one of these developments. As technology advances, the rate at which data is being collected is increasing exponentially, it is also becoming progressively cheaper to collect data. Many institutions are collecting data for the sake of collection and logging, so, being able to answer business critical questions from this data was, and still is becoming more and more expensive with the ageing compute engines that were available before Apache Spark.</p><p>Spark was developed to tackle some of the world’s largest big data problems, from simple data manipulation all the way through to deep learning.</p><h3>Who Created it?</h3><blockquote>Spark was initially started by <a href="https://en.wikipedia.org/wiki/Matei_Zaharia">Matei Zaharia</a> at UC Berkeley’s AMPLab in 2009, and open sourced in 2010 under a <a href="https://en.wikipedia.org/wiki/BSD_licenses">BSD license</a>.</blockquote><blockquote>In 2013, the project was donated to the Apache Software Foundation and switched its license to <a href="https://en.wikipedia.org/wiki/Apache_License">Apache 2.0</a>. In February 2014, Spark became a <a href="https://en.wikipedia.org/wiki/Apache_Software_Foundation#Projects">Top-Level Apache Project</a>.</blockquote><blockquote>In November 2014, Spark founder M. Zaharia’s company <a href="https://en.wikipedia.org/wiki/Databricks">Databricks</a> set a new world record in large scale sorting using Spark.</blockquote><blockquote>Spark had in excess of 1000 contributors in 2015, making it one of the most active projects in the Apache Software Foundation and one of the most active open source <a href="https://en.wikipedia.org/wiki/Big_data">big data</a> projects.</blockquote><blockquote><a href="https://en.wikipedia.org/wiki/Apache_Spark">https://en.wikipedia.org/wiki/Apache_Spark</a></blockquote><h3>Spark Libraries:</h3><p>There are a multitude of libraries available in Apache Spark, many of which are developed directly by the Spark community. These libraries include but are not limited to:</p><ul><li>MLlib</li><li>Spark Streaming</li><li>GraphX</li></ul><p>These libraries have been developed in such a way that they are interpretable, meaning they enable the writing of end-to-end solutions in the same engine environment for the first time.</p><h3>Spark Language Capabilities:</h3><p>Spark has the capabilities to allow the user to write code in Python, Java, Scala R or SQL, but languages such as Python, and R require the user to install an instance of their relevant interpreter. All Python, R, Scala and SQL are compiled down into Java. This is because the code you write runs inside of a JVM (Java Virtual Machine). So regardless of where you run your Spark instance, all you need is an installation of Java.</p><p>Apache Spark can be run in a multitude of ways. Locally is quite common for general development use and for hobbyists, however, in production most instances are developed in a cloud environment. An example of this would be to use AWS EMR to manage node (driver and worker) instances, Azure HDInsight or to use an online notebook experience in the form of Databricks.</p><ul><li><a href="https://aws.amazon.com/emr/">https://aws.amazon.com/emr/</a></li><li><a href="https://azure.microsoft.com/en-gb/services/hdinsight/">https://azure.microsoft.com/en-gb/services/hdinsight/</a></li><li><a href="https://community.cloud.databricks.com/">https://community.cloud.databricks.com/</a></li></ul><p>Whether Spark is run locally or in a cloud environment the user is able to access the different interactive shells available via a console or terminal. These come in the form of:</p><ul><li>Python Console</li><li>Scala Console</li><li>SQL Console</li></ul><p>However one difference is the Databricks notebook environment, which is a similar experience to the user interface provided by Jupyter. The Databricks environment provides plenty of extra functionality built into the platform which allows the user to maximise their productivity, by having access to all these features in one place.</p><p>Latest Spark Release:</p><p>The latest Spark release can be found here:</p><p><a href="https://spark.apache.org/downloads.html">Downloads</a></p><h3>Finally</h3><p>This section is quite lightweight in regards to depth, but, it lays out some scope for the sections to come. These further sections will dive deeper into each aspect, such as, architecture, libraries and data structures.</p><p>The next section will cover an in-depth look into how Apache Spark runs on a cluster and how the physical architecture works alongside the runtime architecture.</p><h3>Series Sections:</h3><p><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-introduction-37735823c3cc">Introduction</a></p><ol><li><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-what-is-apache-spark-63c3f6caa3c">What is Apache Spark</a></li><li><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-spark-architecture-461d81e24010">Spark Architecture</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63c3f6caa3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Spark — Multi-part Series: Introduction]]></title>
            <link>https://lukethorp.medium.com/apache-spark-multi-part-series-introduction-37735823c3cc?source=rss-28e57e146294------2</link>
            <guid isPermaLink="false">https://medium.com/p/37735823c3cc</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[distributed-compute]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Luke Thorp]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 10:41:51 GMT</pubDate>
            <atom:updated>2021-03-15T10:53:18.763Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Spark — Multi-part Series: Introduction</h3><p>This is a new series blogs aimed at developers in the engineering and analytical space who want to build and expand their knowledge within the inner workings of the Spark API’s (Application Programming Interfaces). A personal goal of the series is to enrich my current understanding of Apache Spark, sharing my learnings and resources in an easily digestable way, to you, the reader. So no matter what level your current understanding of distributed computing is, there will be content and material for you to use in your journey with Apache Spark. This series is aimed at Data Scientists, Data Engineers or anyone else who is new to Spark. Even if you have some knowledge hopefully I can help to fill some of those blind spots!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nY7Kgwg7_zhBZkNkJe4wfw.png" /></figure><p>During these tough times (COVID-19), I am going to endevour to release a new section every few days. This is so I can continue to build on and expand my skillset and hopefully yours too. I have been using Apache Spark on and off for around three and a half years both in working environments as well as in my personal projects.</p><h3>Series Coverage:</h3><p>This series will cover almost all aspects of Apache Spark using personal knowledge as well as reputable resources written by the creators of Apache Spark. The areas that will be covered in reasonable depth will include but may not be limited to:</p><p>All about spark:</p><ul><li>What is Apache Spark?</li><li>Spark Architecture</li><li>Spark Ecosystem and Languages</li><li>Spark API’s</li></ul><p>In depth functionality:</p><ul><li>Apache Spark and Koalas</li><li>Spark Data Types and Ecosystem Variables</li><li>Spark Steam Processing</li></ul><p>Analytics and Machine Learning:</p><ul><li>Overview of Analytics and Machine Learning Using Spark</li><li>Preprocessing and Feature Engineering in Spark</li><li>ML Modelling in Spark</li><li>Graph Analytics in Spark</li><li>Deep Learning in Spark</li><li>Apache Spark and mflow</li></ul><p>A vast amount of my knowledge and experience with Apache Spark has been from books and e-Learning provided by the creators of Apache Spark. Not to mention hand on training by a Senior Instructor from Databricks. Two books I have found invaluable during my learning process:</p><ul><li><a href="https://www.amazon.co.uk/Spark-Definitive-Guide-Bill-Chambers/dp/1491912219">Spark, The Definitive Guide — Big Data Processing Made Simple</a></li><li><a href="https://www.amazon.co.uk/Learning-Spak-Jules-Damji/dp/1492050040">Learning Spark — Lighting Fast Data Analytics</a></li></ul><p>Another key place to hone your skills using Spark is either locally on your machine or by using a cloud based solution such as Azure or AWS. Alternatively one <strong>free </strong>place to do this is on the Databricks community edition which can be found below:</p><p><a href="https://community.cloud.databricks.com/">https://community.cloud.databricks.com/</a></p><p>This environment allows you to create your own Spark cluster, create notebooks, upload data and try anything Spark related! There are some limitations, but for a free service its fantastic! The community edition even allows you to try out <strong>mlflow</strong>, one of Databricks’ open source projects released in 2019.</p><p>There are likely to be code snippets embedded within each of my learning sections which you will be able to run in a Spark environment using your own datasets. If you don’t have your own datasets, there are an abundance of them available on the Kaggle website, all you need to do is sign-up for free to access them for life.</p><p><a href="https://www.kaggle.com/datasets">Find Open Datasets for AI and Research | Kaggle</a></p><p>Alternatively, the Databricks free community edition has a number of datasets mounted to the environment on cluster creation. You can run the code below inside a Databricks notebook to retrieve a list of datasets.</p><pre>%py<br>display(dbutils.fs.ls(&quot;/databricks-datasets&quot;))</pre><p>You can also print out the README.md file for each of the datasets listed.</p><pre>%py<br>with open(&quot;/dbfs/databricks-datasets/README.md&quot;) as f:<br>    x = &#39;&#39;.join(f.readlines())<br><br>print(x)</pre><p>I will try to include any code prerequisites if any extra functionality or libraries are required to run any code examples.</p><h3>Finally:</h3><p>It is going to be a challenge to release all of these sections in rapid succession but I will do my best to do so. If you have any questions or advice please send them over to me via LinkedIn:</p><p><a href="https://www.linkedin.com/in/luke-thorp/">Luke Thorp - Senior Data Scientist - BBC | LinkedIn</a></p><p>Thanks for coming along this journey with me, stay safe!</p><h3>Series Sections:</h3><p><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-introduction-37735823c3cc">Introduction</a></p><ol><li><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-what-is-apache-spark-63c3f6caa3c">What is Apache Spark</a></li><li><a href="https://lukethorp.medium.com/apache-spark-multi-part-series-spark-architecture-461d81e24010">Spark Architecture</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37735823c3cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>