<?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 Ömer Cengiz on Medium]]></title>
        <description><![CDATA[Stories by Ömer Cengiz on Medium]]></description>
        <link>https://medium.com/@omercengiz?source=rss-b6edfccb015f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zWSUpswZufPKl6PWCVk-Tw.jpeg</url>
            <title>Stories by Ömer Cengiz on Medium</title>
            <link>https://medium.com/@omercengiz?source=rss-b6edfccb015f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:38:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omercengiz/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[JupyterHub Setup on Kubernetes Environment]]></title>
            <link>https://medium.com/@omercengiz/jupyterhub-setup-on-kubernetes-environment-9aa386547263?source=rss-b6edfccb015f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9aa386547263</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[jupyterhub]]></category>
            <dc:creator><![CDATA[Ömer Cengiz]]></dc:creator>
            <pubDate>Sun, 19 May 2024 13:32:10 GMT</pubDate>
            <atom:updated>2024-05-19T13:32:10.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UvH1NmcGSqLC4nKhNGMA8g.png" /></figure><p>Hi Folks!</p><p>In this post, I will explain step-by-step how to set up JupyterHub on a Kubernetes cluster using Minikube and Helm. While the installation is generally quite simple, it is crucial to follow the steps carefully. Therefore, I have made this article as detailed as possible. Enjoy reading! :)</p><p>For professionals in fields such as Data Engineering &amp; Data Science, JupyterHub is a powerful tool for developing projects, visualizing data, and conducting successful analyses. However, when working with large datasets and requiring computational resources, relying solely on JupyterHub on your local machine may prove inadequate for your workflow. At this point, utilizing a container orchestration platform like Kubernetes offers an ideal solution to scale your JupyterHub environments and utilize resources more efficiently. If you’re ready, let’s start with the installations.</p><h3><strong>1.Minikube Installation</strong></h3><p>If you haven’t used Kubernetes before, I’ve used Minikube in this article to make it easier for you to learn and prevent any difficulties during the installation process.</p><p>Minikube is a tool that can be used to run Kubernetes on your local computer. It is commonly used to set up and test clusters with a single node.</p><p><strong>System Requirements:</strong></p><ul><li>Minimum 2 CPU cores</li><li>Minimum 2 GB of RAM</li><li>Minimum 20 GB of disk space</li><li>Container or Virtual Machine Manager (Docker, Hyper-V, VirtualBox, etc.)</li></ul><p><strong>MacOS:</strong></p><p>Open the terminal and after installing <a href="https://brew.sh/"><strong>Homebrew</strong></a>, you can use the following command to install Minikube.</p><pre>brew install minikube</pre><p><strong>Linux:</strong></p><p>Open the terminal and run the commands sequentially.</p><pre>curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64<br>sudo install minikube-linux-amd64 /usr/local/bin/minikube</pre><p>To ensure that Minikube has been successfully installed, you can run the command minikube version .</p><h3>2.Kubectl Installation</h3><p>The Kubernetes command-line tool, kubectl, allows you to execute Kubernetes commands. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.</p><p><strong>MacOS:</strong></p><pre>curl -LO &quot;https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl&quot;</pre><pre>chmod +x ./kubectl<br>sudo mv ./kubectl /usr/local/bin/kubectl<br>sudo chown root: /usr/local/bin/kubectl</pre><p><strong>Linux:</strong></p><pre>curl -LO &quot;https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl&quot;<br>sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl</pre><p>To ensure that kubectl has been successfully installed, you can run the command kubectl version.</p><h3>3. Helm Installation</h3><p>Helm is a package manager used for managing Kubernetes applications. It is designed to make it easier to deploy, update, and manage complex Kubernetes applications. With its features, Helm enables users to quickly deploy applications without dealing with complex Kubernetes YAML files. For this reason, we will use Helm for the installation in this article.</p><p>You can follow the steps below to install Helm:</p><pre>curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3</pre><pre>chmod 700 get_helm.sh<br>./get_helm.sh</pre><p>To ensure that Helm has been successfully installed, you can run the command helm version.</p><h3>4. Creating Cluster with Minikube</h3><p>To start Minikube, run the following commands in the terminal sequentially:</p><p><strong><em>Note:</em></strong><em> You can adjust the following memory value according to your computer’s </em><strong><em>RAM</em></strong><em> capacity.</em></p><pre>minikube start --memory 16000</pre><pre>minikube addons enable ingress</pre><p><strong><em>Note:</em></strong><em> This command is used to enable the </em><strong><em>“ingress”</em></strong><em> addon on Minikube. Ingress provides a way to route external traffic to Kubernetes services within the Kubernetes environment.</em></p><p>Now let’s check if the Kubernetes cluster is ready and proceed with the JupyterHub installation.</p><pre>minikube status</pre><h3>5. JupyterHub Installation</h3><p>Now, we can install JupyterHub on the Kubernetes cluster using Helm.</p><p>First, let’s create a namespace.</p><pre>kubectl create namespace jupyter</pre><p>Now, let’s add the official <a href="https://artifacthub.io/packages/helm/jupyterhub/jupyterhub"><strong>JupyterHub Helm Chart</strong></a> repository from ArtifactHub to our local computer and follow the steps for installation.</p><pre>helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/<br>helm repo update</pre><pre>helm install my-jupyterhub jupyterhub/jupyterhub \<br>--version 3.2.2-0.dev.git.6514.h9b48b6d4 -n jupyter</pre><p>Let’s list the pods within the namespace we created.</p><pre>kubectl get pods -n jupyter</pre><p>This command will create several Kubernetes pods along with the default configuration of JupyterHub. The installation may take a few minutes to complete.</p><pre>NAME                              READY   STATUS    RESTARTS   AGE<br>continuous-image-puller-rhqz8     1/1     Running   0          5m11s<br>hub-b7f6db9f5-7mlqc               1/1     Running   0          5m11s<br>proxy-6f6447f8df-znb52            1/1     Running   0          5m11s<br>user-scheduler-7b89c56655-lhdfg   1/1     Running   0          5m11s<br>user-scheduler-7b89c56655-llcxv   1/1     Running   0          5m11s</pre><p>If your pods remain in the <strong>pending</strong> state, you can use the <strong>“-w” </strong>parameter to monitor the preparation process of the pods, troubleshoot the issue by considering restarting pods, checking logs, or reinstalling the setup if necessary.</p><h3>6. Accessing JupyterHub Services</h3><p>First, we need to make the JupyterHub services accessible from outside using Minikube. Therefore, you need to open a new terminal window and use the following command.</p><pre>minikube tunnel</pre><p><strong><em>Note: </em></strong><em>Minikube tunnel is a feature provided by Minikube and is used to establish a connection between the local Minikube and network resources outside the Kubernetes cluster. This feature is typically used to allow the cluster to access the outside world in a local environment.</em></p><p>Let’s now list the services on the cluster.</p><pre>kubectl get svc -n jupyter</pre><p>Our services should be listed as follows, and any External-IP value should not be in the <strong>pending</strong> state. If you see this expression in the list, you may have missed the minikube tunnel step.</p><pre>NAME           TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)        AGE<br>hub            ClusterIP      10.103.66.246   &lt;none&gt;          8081/TCP       17m<br>proxy-api      ClusterIP      10.105.82.188   &lt;none&gt;          8001/TCP       17m<br>proxy-public   LoadBalancer   10.98.130.199   10.98.130.199   80:32503/TCP   17m</pre><p>You can access the JupyterHub user interface on your browser by taking the <strong>External-IP</strong> and <strong>Port</strong> values of the <strong>proxy-public</strong> service you see above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbLn_S4mfjr-ps9dEXhT2g.png" /></figure><p>When you reach the user login interface, you can enter the username as <strong>user1</strong> and the password as <strong>a-shared-secret-password</strong> to access the development environment as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_Pghe2MfIUrrWxKJ9dGZg.png" /></figure><p>Now you can enjoy using Jupyter Notebook in the Kubernetes cluster environment you created. Happy coding!</p><p>I’ve prepared this article as a guiding resource for setting up a simple JupyterHub environment using Minikube and Helm. For further configurations and customizations, you can explore the resources below to perform different tasks. I hope this article has been helpful to you. If you have any questions, feel free to ask.</p><p>Thank you!</p><p><strong>Sources:</strong></p><p><strong>Minikube:</strong> <a href="https://minikube.sigs.k8s.io/docs/start/">https://minikube.sigs.k8s.io/docs/start/</a></p><p><strong>Kubectl: </strong><a href="https://kubernetes.io/docs/tasks/tools/">https://kubernetes.io/docs/tasks/tools/</a></p><p><strong>JupyterHub for Kubernetes: </strong><a href="https://minikube.sigs.k8s.io/docs/start/">https://minikube.sigs.k8s.io/docs/start/</a></p><p><strong>Helm:</strong> <a href="https://helm.sh/docs/intro/install/">https://helm.sh/docs/intro/install/</a></p><p><strong>ArtifactHub: </strong><a href="https://artifacthub.io/packages/helm/jupyterhub/jupyterhub">https://artifacthub.io/packages/helm/jupyterhub/jupyterhub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9aa386547263" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes ile JupyterHub Kurulumu]]></title>
            <link>https://medium.com/devopsturkiye/kubernetes-ile-jupyterhub-kurulumu-bfe384ac6782?source=rss-b6edfccb015f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfe384ac6782</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Ömer Cengiz]]></dc:creator>
            <pubDate>Mon, 12 Feb 2024 00:20:32 GMT</pubDate>
            <atom:updated>2024-11-27T07:40:02.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_4882zP6eRlzMLJUKX3Tg.png" /></figure><p>Merhaba arkadaşlar!</p><p>Bu yazıda, Minikube ve Helm kullanarak bir Kubernetes cluster üzerinde JupyterHub nasıl kurulur, adım adım açıklayacağım. Aslında genel olarak çok basit bir kurulumu var fakat dikkatli ve adımları takip ederek gitmek oldukça önemli. Bu yüzden olabildiğince detaylı bir yazı haline getirdim. Şimdiden keyifli okumalar :)</p><p>Günümüzde, Veri Mühendisliği &amp; Veri Bilimi gibi alanlarda çalışanlar için JupyterHub, projeleri geliştirme, verileri görselleştirme ve başarılı analizler yapma konusunda güçlü bir araçtır. Ancak, büyük veri kümeleriyle çalışırken ve hesaplama kaynaklarına ihtiyaç duyulduğunda, yerel makinenizde JupyterHub kullanmak süreciniz için yetersiz kalabilir. Bu noktada, Kubernetes gibi bir konteyner orkestrasyon platformu kullanmak, JupyterHub ortamlarınızı ölçeklenebilir hale getirmek ve kaynakları daha verimli kullanmak için ideal bir çözüm sunar. Hazırsanız, ilk olarak kurulumlar ile başlayalım.</p><h3>1. Minikube Kurulumu</h3><p>Eğer daha önce Kubernetes kullanmadıysanız, en kolay şekilde öğrenmenize ve kurulum aşamasında zorlanmanızı önlemek adına bu yazıda Minikube kullandım.</p><p>Minikube, Kubernetes’i local bilgisayarlarınız üzerinde çalıştırmak için kullanılanabileceğiniz bir araçtır. Genelde tek node’a sahip clusterlar kurup test etmek için kullanılır.</p><h4><strong>Sistem Gereksinimleri:</strong></h4><ul><li>Minimum 2 CPU çekirdeği</li><li>Minimum 2 GB RAM</li><li>Minimum 20 GB disk alanı</li><li>Container ya da Sanal Makine Yöneticisi(Docker, Hyper-V, VirtualBox vb.)</li></ul><p><strong>MacOS İçin:</strong></p><p>Terminali açın ve <a href="https://brew.sh/"><strong>Homebrew </strong></a>kurduktan sonra Minikube’u kurmak için aşağıdaki komutu kullanabilirsiniz.</p><pre>brew install minikube</pre><p><strong>Linux İçin:</strong></p><p>Terminali açın ve sırasıyla komutları çalıştırın.</p><pre>curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64<br>sudo install minikube-linux-amd64 /usr/local/bin/minikube</pre><p>Minikube’ün başarıyla yüklendiğinden emin olmak için minikube version komutunu çalıştırabilirsiniz.</p><h3>2. Kubectl Kurulumu</h3><p>Kubernetes komut satırı aracı olan kubectl, kubernetes komutlarını çalıştırmanıza olanak tanır. Uygulamaları dağıtmak, cluster kaynaklarını incelemek ve yönetmek ve loglarını görüntülemek için kubectl’i kullanabilirsiniz.</p><p><strong>MacOS için:</strong></p><pre>curl -LO &quot;https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl&quot;</pre><pre>chmod +x ./kubectl<br>sudo mv ./kubectl /usr/local/bin/kubectl<br>sudo chown root: /usr/local/bin/kubectl</pre><p><strong>Linux için:</strong></p><pre>curl -LO &quot;https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl&quot;<br>sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl</pre><p>Kubectl’in başarıyla yüklendiğinden emin olmak için kubectl version komutunu çalıştırabilirsiniz.</p><h3>3. Helm Kurulumu</h3><p>Helm, Kubernetes uygulamalarını yönetmek için kullanılan bir paket yöneticisidir. Karmaşık Kubernetes uygulamalarını daha kolay bir şekilde dağıtmak, güncellemek ve yönetmek için tasarlanmıştır. Bu özellikleri sayesinde, Helm kullanıcılarının karmaşık Kubernetes YAML dosyalarıyla uğraşmadan uygulamaları hızlıca dağıtabilmesini sağlar. Bu sebeple bu yazıda kurulum için Helm’i tercih edeceğiz.</p><p>Helm’i kurmak için aşağıdaki adımları izleyebilirsiniz:</p><pre>curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3</pre><pre>chmod 700 get_helm.sh</pre><pre>./get_helm.sh</pre><p>Helm’in başarıyla yüklendiğinden emin olmak için helm version komutunu çalıştırabilirsiniz.</p><h3>4. Minikube Başlatma</h3><p>Minikube’ü başlatmak için terminalde aşağıdaki komutları sırasıyla çalıştırın:</p><p><strong><em>Not:</em></strong><em> Bilgisayarınızın </em><strong><em>RAM</em></strong><em> kapasitesine göre aşağıdaki memory değerini değiştirebilirsiniz.</em></p><pre>minikube start --memory 16000</pre><pre>minikube addons enable ingress</pre><p><strong><em>Not:</em></strong><em> Bu komut, Minikube üzerinde </em><strong><em>“ingress”</em></strong><em> eklentisini etkinleştirmek için kullanılır. Ingress, Kubernetes ortamında dış dünya ile Kubernetes servislerini yönlendirmek için bir imkan sağlar.</em></p><p>Şimdi kubernetes cluster’ının hazır olup olmadığını kontrol edelim ve JupyterHub kurulumuna geçelim.</p><pre>minikube status</pre><h3>5. JupyterHub Kurulumu</h3><p>Şimdi, Helm aracılığıyla JupyterHub’ı Kubernetes cluster’ına kurabiliriz.</p><p>İlk olarak bir <strong>namespace </strong>oluşturalım.</p><pre>kubectl create namespace jupyter</pre><p>Şimdi kurulum için ArtifactHub’da bulunan resmi <a href="https://artifacthub.io/packages/helm/jupyterhub/jupyterhub">JupyterHub Helm Chart</a> reposunu local bilgisayarımıza ekleyelim ve kurulum için adımları takip edelim.</p><pre>helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/</pre><pre>helm repo update</pre><pre>helm install my-jupyterhub jupyterhub/jupyterhub \<br>--version 3.2.2-0.dev.git.6514.h9b48b6d4 -n jupyter</pre><p>Şimdi oluşturduğumuz namespace içerisindeki podları listeleyelim.</p><pre>kubectl get pods -n jupyter</pre><p>Bu komut, JupyterHub’ın varsayılan yapılandırmasıyla birlikte birkaç Kubernetes pod’unu oluşturur. Kurulumun tamamlanması birkaç dakika sürebilir.</p><pre>NAME                              READY   STATUS    RESTARTS   AGE<br>continuous-image-puller-rhqz8     1/1     Running   0          5m11s<br>hub-b7f6db9f5-7mlqc               1/1     Running   0          5m11s<br>proxy-6f6447f8df-znb52            1/1     Running   0          5m11s<br>user-scheduler-7b89c56655-lhdfg   1/1     Running   0          5m11s<br>user-scheduler-7b89c56655-llcxv   1/1     Running   0          5m11s</pre><p>Eğer podlarınız <strong>“pending”</strong> durumda kalırsa <strong>“-w”</strong> parametresi ile podların hazırlanma sürecini takip ederek sorunu takip edebilir, ilk etapta podları yeniden başlatmayı, logları kontrol etmeyi veya kurulumu tekrardan gerçekleştirmeyi düşünebilirsiniz.</p><h3>6. JupyterHub Servislerine Erişim</h3><p>İlk olarak Minikube aracılığı ile JupyterHub servislerini dışarıdan erişilebilir hale getirmemiz gerekiyor. Bu sebeple yeni bir terminal penceresi açarak aşağıdaki komutu kullanmanız gerekiyor.</p><pre>minikube tunnel</pre><p><strong><em>Not: </em></strong><em>Minikube tunnel, Minikube tarafından sunulan bir özelliktir ve local Minikube, Kubernetes cluster ile dış dünyadaki ağ kaynakları arasında bir bağlantı kurmak için kullanılır. Bu özellik genellikle, local ortamda cluster’ın dış dünyaya erişim sağlaması için kullanılır.</em></p><p>Şimdi cluster üzerindeki servislerimizi listeleyelim.</p><pre>kubectl get svc -n jupyter</pre><p>Servislerimiz aşağıdaki gibi listelenmelidir ve herhangi bir <strong>External-IP </strong>değeri <strong>“pending”</strong> durumda olmamalıdır. Eğer listede bu ifadeyi görüyorsanız, minikube tunneladımını atlamış olabilirsiniz.</p><pre>NAME           TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)        AGE<br>hub            ClusterIP      10.103.66.246   &lt;none&gt;          8081/TCP       17m<br>proxy-api      ClusterIP      10.105.82.188   &lt;none&gt;          8001/TCP       17m<br>proxy-public   LoadBalancer   10.98.130.199   10.98.130.199   80:32503/TCP   17m</pre><p>Yukarıda gördüğünüz <strong>proxy-public </strong>isimli servisin <strong>External-IP</strong> ve <strong>Port</strong> değerlerini alarak tarayıcınız üzerinde JupyterHub kullanıcı girişine erişebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8d6ZlJqCRdTlMHDtheQiXQ.png" /></figure><p>Kullanıcı giriş arayüzüne geldiğinizde kullanıcı adını <strong>user1, </strong>şifreyi de <strong>a-shared-secret-password</strong> olarak girebilir, aşağıdaki gibi geliştirme ortamına ulaşabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5UQhUuFL_C8FhVUsFcVwMg.png" /></figure><p>Artık oluşturduğunuz Kubernetes cluster ortamında Jupyter Notebook’u keyifle kullanabilirsiniz. İyi çalışmalar!</p><p>Bu makaleyi, Minikube ve Helm kullanarak basit bir JupyterHub ortamının kurulumu hakkında size bir yol gösterici kaynak olarak hazırladım. Daha fazla konfigürasyon ve özelleştirmeleriniz için aşağıdaki kaynakları inceleyerek daha farklı çalışmalar gerçekleştirebilirsiniz. Umarım bu yazı size yardımcı olmuştur. Herhangi bir sorunuz varsa, çekinmeden sorabilirsiniz.</p><p>Teşekkürler!</p><blockquote><strong>Kaynaklar</strong></blockquote><p><strong>Minikube:</strong> <a href="https://minikube.sigs.k8s.io/docs/start/">https://minikube.sigs.k8s.io/docs/start/</a></p><p><strong>Kubectl: </strong><a href="https://kubernetes.io/docs/tasks/tools/">https://kubernetes.io/docs/tasks/tools/</a></p><p><strong>JupyterHub for Kubernetes: </strong><a href="https://minikube.sigs.k8s.io/docs/start/">https://minikube.sigs.k8s.io/docs/start/</a></p><p><strong>Helm:</strong> <a href="https://helm.sh/docs/intro/install/">https://helm.sh/docs/intro/install/</a></p><p><strong>ArtifactHub: </strong><a href="https://artifacthub.io/packages/helm/jupyterhub/jupyterhub">https://artifacthub.io/packages/helm/jupyterhub/jupyterhub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfe384ac6782" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devopsturkiye/kubernetes-ile-jupyterhub-kurulumu-bfe384ac6782">Kubernetes ile JupyterHub Kurulumu</a> was originally published in <a href="https://medium.com/devopsturkiye">Devops &amp; AI Türkiye☁️ 🐧 🐳 ☸️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bucket and Partition: Importance in Data Engineering]]></title>
            <link>https://medium.com/@omercengiz/bucket-and-partition-importance-in-data-engineering-d771e02fc24d?source=rss-b6edfccb015f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d771e02fc24d</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Ömer Cengiz]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 11:42:43 GMT</pubDate>
            <atom:updated>2023-10-15T20:29:56.344Z</atom:updated>
            <content:encoded><![CDATA[<p>For beginners to the world of data engineering, some fundamental concepts may appear quite complex. In this article, we will explore two crucial terms that play a significant role in the field of data engineering: “Bucket” and “Partition.” These two terms are integral to data management and querying, and can help make your work more efficient. In this article, we’ll strive to explain these terms in a simple and understandable way and understand why they are so essential.</p><p><strong>1. What Is a Bucket?</strong></p><p>Data engineering often involves working with large datasets. Managing and querying these datasets can be time-consuming and resource-intensive. This is where “Bucket” comes into play. A “bucket” is a structure used to organize and store your data. It’s employed to categorize your data into logical groups, making it more accessible. For example, rather than storing millions of records in a single large pool in a database, you can classify them based on specific criteria and access the data more quickly.</p><p><em>Example:</em></p><p>Suppose you have a dataset of user information, and you want to create a bucketed table based on the user’s country for efficient querying.</p><pre>-- Create a table with bucketing<br>CREATE TABLE user_data (<br>  user_id INT,<br>  username STRING,<br>  country STRING<br>)<br>CLUSTERED BY (country) INTO 4 BUCKETS;</pre><p>In this example, we’re creating a table named user_data and specifying that we want to cluster the data based on the country column into 4 buckets.</p><p><strong>2. What Is a Partition?</strong></p><p>Partitioning is the process of logically dividing data in your storage space. When you divide data based on specific criteria or columns, it helps your queries run faster. For instance, by partitioning your data based on a date column, you can quickly access data that falls before or after a certain date. Partitioning is a powerful tool for organizing and querying data, and it enhances data access speed.</p><p><em>Example:</em></p><p>Imagine you’re managing a massive log of website user activity with a timestamp. You can use partitions to organize the data by date for quicker retrieval.</p><pre>-- Partitioning the data by date<br>CREATE TABLE user_activity (<br>  user_id STRING,<br>  action STRING,<br>  timestamp TIMESTAMP<br>) PARTITIONED BY (activity_date DATE);<br><br>-- Inserting data into partitions<br>INSERT INTO user_activity PARTITION(activity_date=&#39;2023-10-01&#39;) VALUES (&#39;user123&#39;, &#39;login&#39;, &#39;2023-10-01 12:00:00&#39;);<br>INSERT INTO user_activity PARTITION(activity_date=&#39;2023-10-02&#39;) VALUES (&#39;user456&#39;, &#39;purchase&#39;, &#39;2023-10-02 14:30:00&#39;);</pre><p>By partitioning the data by date, you can quickly retrieve user activities for specific days. For example:</p><pre>-- Querying data for October 1, 2023<br>SELECT * FROM user_activity WHERE activity_date = &#39;2023-10-01&#39;;</pre><p>This query will efficiently retrieve user activities for October 1, 2023, because the data is organized into partitions.</p><p><strong>Why Are Bucket and Partition Important?</strong></p><ul><li>Enhance data organization and query speed.</li><li>Reduce storage costs and prevent unnecessary data.</li><li>Make large datasets more manageable.</li><li>Optimize queries and improve performance.</li></ul><p><strong>Conclusion:</strong></p><p>Bucket and Partition are fundamental tools in the world of data engineering for organizing and querying data. By understanding these concepts and how to use them, you can efficiently manage your data processing processes. While they may initially seem complex, learning these terms can provide a solid foundation for your data engineering career. Remember, when used correctly, Bucket and Partition can provide significant benefits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d771e02fc24d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>