<?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 Jansutris Apriten Purba on Medium]]></title>
        <description><![CDATA[Stories by Jansutris Apriten Purba on Medium]]></description>
        <link>https://medium.com/@jansutris10?source=rss-1cacdaf156e9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*cOXTF2-EtNb3OHD1rCLrkg.jpeg</url>
            <title>Stories by Jansutris Apriten Purba on Medium</title>
            <link>https://medium.com/@jansutris10?source=rss-1cacdaf156e9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 06:52:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jansutris10/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[How to Survive a Layoff: Losing Your Job Isn’t the End of Your Career]]></title>
            <link>https://jansutris10.medium.com/how-to-survive-a-layoff-losing-your-job-isnt-the-end-of-your-career-4a3b2b7b9833?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a3b2b7b9833</guid>
            <category><![CDATA[survive]]></category>
            <category><![CDATA[layoffs]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[company]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 04:05:03 GMT</pubDate>
            <atom:updated>2026-07-03T04:12:22.716Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“We’re sorry to inform you that your position has been eliminated as part of the company’s restructuring.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cw9YGorQqWMetejmGR7HaA.jpeg" /><figcaption><a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><p>For the company, it’s just another business decision.</p><p>For the employee, it can feel like the ground disappears beneath their feet.</p><p>One moment, you’re planning next week’s meetings, thinking about your next promotion, and mapping out your career. The next, you’re packing up your desk, returning your company laptop, and wondering how you’re going to explain to your family that you’ve just lost your job.</p><p>If you’ve recently been laid off, I want you to know something before anything else:</p><p><strong>What you’re feeling is completely normal.</strong></p><p>Losing a job isn’t just about losing a paycheck. It’s about losing stability, routine, confidence, and sometimes even a part of your identity.</p><p>But here’s the truth that often gets overlooked:</p><p><strong>A layoff is a career event — not a measure of your worth.</strong></p><h3>Layoffs Have Become the New Reality</h3><p>Over the past few years, layoffs have become increasingly common across industries.</p><p>Technology companies, startups, financial institutions, media organizations, manufacturing firms — even companies reporting billions in annual revenue — have announced workforce reductions.</p><p>According to the <strong>International Labour Organization (ILO)</strong>, the global labor market continues to face uncertainty due to slowing economic growth, inflation, geopolitical conflicts, and rapid technological transformation. These factors have forced many organizations to restructure and reduce operating costs.</p><p>The technology sector illustrates this trend clearly.</p><p>Data from <strong>Layoffs.fyi</strong>, which tracks global technology layoffs, shows that <strong>more than 700,000 tech employees have lost their jobs since 2022</strong> across thousands of companies worldwide.</p><p>These numbers tell us something important:</p><p>Being laid off doesn’t automatically mean you weren’t good enough.</p><p>Sometimes, you’re simply caught in a business decision that has nothing to do with your performance.</p><h3>The Hidden Cost of Losing a Job</h3><p>When people think about layoffs, they usually think about money.</p><p>The paycheck stops.</p><p>Bills continue.</p><p>Savings begin to shrink.</p><p>But financial stress is only part of the story.</p><p>Research consistently shows that unemployment can have a significant impact on mental health.</p><p>A large meta-analysis published in the <em>Journal of Vocational Behavior</em> found that unemployment is strongly associated with increased levels of depression, anxiety, psychological distress, and lower overall well-being.</p><p>Why?</p><p>Because work provides much more than income.</p><p>It gives us structure.</p><p>It creates daily routines.</p><p>It offers social interaction.</p><p>It provides a sense of purpose.</p><p>It reinforces our identity.</p><p>When that disappears overnight, it’s natural to feel lost.</p><p>The mistake isn’t feeling overwhelmed.</p><p>The mistake is believing you have to hide those feelings.</p><h3>Step One: Allow Yourself to Grieve</h3><p>One of the biggest misconceptions about layoffs is that you should “move on” immediately.</p><p>You don’t have to.</p><p>A layoff is a loss.</p><p>And every loss deserves time to be processed.</p><p>It’s okay to feel angry.</p><p>It’s okay to cry.</p><p>It’s okay to feel disappointed.</p><p>Recovery doesn’t begin when you pretend everything is fine.</p><p>It begins when you acknowledge that things are hard — and choose to keep moving anyway.</p><h3>Step Two: Get Control of Your Finances</h3><p>Once the initial emotional shock begins to settle, shift your attention toward your finances.</p><p>Take an honest look at your situation.</p><p>Calculate your emergency savings.</p><p>Review your monthly expenses.</p><p>Separate essential spending from discretionary spending.</p><p>Determine how many months you can realistically support yourself.</p><p>This isn’t about living in fear.</p><p>It’s about giving yourself clarity.</p><p>Financial uncertainty often feels more frightening when you don’t know where you stand.</p><h3>Step Three: Don’t Wait Until You Feel “Ready”</h3><p>Many people postpone their job search because they believe they need the perfect résumé, the perfect portfolio, or another certification.</p><p>The truth is, perfection rarely gets people hired.</p><p>Action does.</p><p>Update your résumé.</p><p>Refresh your LinkedIn profile.</p><p>Reconnect with former colleagues.</p><p>Reach out to mentors.</p><p>Apply for positions — even if you don’t meet every qualification.</p><p>Remember that job searching is a numbers game.</p><p>Not every application will lead to an interview.</p><p>Not every interview will lead to an offer.</p><p>But every application increases your chances.</p><h3>Step Four: Invest in Skills That Matter</h3><p>The workplace is changing faster than ever.</p><p>According to the <strong>World Economic Forum’s Future of Jobs Report</strong>, employers increasingly value skills such as:</p><ul><li>Analytical thinking</li><li>Problem-solving</li><li>Digital and AI literacy</li><li>Communication</li><li>Leadership</li><li>Adaptability</li><li>Continuous learning</li></ul><p>Being unemployed doesn’t mean your professional growth has to stop.</p><p>In fact, it can become the perfect opportunity to develop skills you’ve been putting off for years.</p><p>Today, high-quality education is more accessible than ever through platforms like Coursera, edX, LinkedIn Learning, Google Career Certificates, and Microsoft Learn.</p><p>Every new skill becomes another investment in your future.</p><h3>Step Five: Don’t Isolate Yourself</h3><p>One of the most damaging responses to a layoff is withdrawing from other people.</p><p>You stop replying to messages.</p><p>You avoid networking events.</p><p>You feel embarrassed.</p><p>You convince yourself that everyone else is moving forward while you’re standing still.</p><p>But here’s what many people forget:</p><p>Opportunities often come through relationships.</p><p>Former coworkers.</p><p>Friends.</p><p>Mentors.</p><p>Professional communities.</p><p>Sometimes a single conversation leads to the next chapter of your career.</p><p>Don’t be afraid to ask for help.</p><p>Asking for support isn’t a sign of weakness.</p><p>It’s a sign that you’re human.</p><h3>Your Job Is Not Your Identity</h3><p>This may be the hardest lesson to accept.</p><p>For years, many of us introduce ourselves through our work.</p><p>“I’m a software engineer.”</p><p>“I’m a project manager.”</p><p>“I’m a financial analyst.”</p><p>Then suddenly, that title disappears.</p><p>And we’re left asking ourselves:</p><p><em>“Who am I now?”</em></p><p>The answer is simpler than it feels.</p><p>You are still the same person.</p><p>Your experience didn’t disappear.</p><p>Your knowledge didn’t disappear.</p><p>Your integrity didn’t disappear.</p><p>Your resilience didn’t disappear.</p><p>Only your employer changed.</p><p>Your value did not.</p><h3>Careers Are Rarely Linear</h3><p>Social media has convinced us that successful careers move in one direction.</p><p>Promotion.</p><p>Raise.</p><p>New company.</p><p>Another promotion.</p><p>Another achievement.</p><p>Reality looks very different.</p><p>Most careers are filled with unexpected turns.</p><p>Periods of growth.</p><p>Periods of uncertainty.</p><p>Moments of failure.</p><p>Fresh beginnings.</p><p>Ironically, some of the most successful people look back and identify their biggest setback as the turning point that ultimately changed their lives for the better.</p><p>Perhaps a layoff isn’t the end of your story.</p><p>Perhaps it’s simply the chapter you never planned to write.</p><h3>Final Thoughts</h3><p>A layoff hurts.</p><p>There is no motivational quote that can erase that reality.</p><p>But history tells us something encouraging.</p><p>Millions of people have lost their jobs.</p><p>Millions have rebuilt their careers.</p><p>Many have gone on to find better opportunities, healthier workplaces, higher salaries, or more meaningful work than they ever imagined possible.</p><p>If you’re currently navigating unemployment, remember this:</p><p><strong>Your job was part of your life. It was never the definition of your life.</strong></p><p>A company may decide to end your employment.</p><p>It cannot erase your experience.</p><p>It cannot erase your character.</p><p>It cannot erase your ability to learn, adapt, and grow.</p><p>Keep applying.</p><p>Keep learning.</p><p>Keep showing up.</p><p>Because sometimes, the opportunity that changes your life only appears after the door you thought would stay open closes behind you.</p><p>And one day, you’ll look back on this chapter — not as the end of your career — but as the beginning of a stronger one.</p><h3>References</h3><ul><li>International Labour Organization. <em>World Employment and Social Outlook</em>. <a href="https://www.ilo.org/">https://www.ilo.org</a></li><li>World Economic Forum. <em>The Future of Jobs Report</em>. <a href="https://www.weforum.org/reports/the-future-of-jobs-report">https://www.weforum.org/reports/the-future-of-jobs-report</a></li><li>Layoffs.fyi. <em>Tech Layoff Tracker</em>. <a href="https://layoffs.fyi/">https://layoffs.fyi</a></li><li>Paul, K. I., &amp; Moser, K. (2009). <em>Unemployment Impairs Mental Health: Meta-Analyses</em>. Journal of Vocational Behavior.</li><li>OECD. <em>Employment Outlook</em>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a3b2b7b9833" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara Bertahan Setelah Layoff: Bukan Akhir dari Karier, Melainkan Awal dari Babak Baru]]></title>
            <link>https://jansutris10.medium.com/cara-bertahan-setelah-layoff-bukan-akhir-dari-karier-melainkan-awal-dari-babak-baru-8864152329aa?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8864152329aa</guid>
            <category><![CDATA[layoffs]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[company]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 03:59:26 GMT</pubDate>
            <atom:updated>2026-07-03T04:14:00.762Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Kamu terdampak restrukturisasi perusahaan.”</blockquote><p>Kalimat itu mungkin hanya membutuhkan waktu beberapa detik untuk diucapkan. Namun bagi orang yang mendengarnya, dampaknya bisa bertahan berminggu-minggu, berbulan-bulan, bahkan bertahun-tahun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cw9YGorQqWMetejmGR7HaA.jpeg" /><figcaption><a href="https://unsplash.com/">unsplash.com</a></figcaption></figure><p>Dalam satu hari, rutinitas yang selama ini terasa begitu pasti mendadak hilang. Tidak ada lagi rapat pagi. Tidak ada lagi target mingguan. Tidak ada lagi obrolan dengan rekan kerja di pantry. Bahkan alamat email kantor yang setiap hari dibuka kini sudah tidak bisa diakses.</p><p>Yang tersisa hanyalah pertanyaan-pertanyaan yang terus berputar di kepala.</p><p><em>“Kenapa aku?”</em></p><p><em>“Apa aku memang tidak cukup baik?”</em></p><p><em>“Bagaimana kalau aku tidak mendapatkan pekerjaan lagi?”</em></p><p>Jika Anda pernah mengalami layoff, saya ingin mengatakan satu hal terlebih dahulu.</p><p><strong>Apa yang Anda rasakan itu normal.</strong></p><p>Layoff bukan hanya soal kehilangan pekerjaan. Layoff juga berarti kehilangan rutinitas, rasa aman, identitas profesional, bahkan kepercayaan diri.</p><p>Namun ada kabar baik.</p><p>Banyak penelitian menunjukkan bahwa sebagian besar orang yang mengalami PHK akhirnya mampu kembali bekerja dan bahkan menemukan peluang karier yang lebih baik. Yang membedakan bukan siapa yang paling pintar atau paling berpengalaman, tetapi siapa yang mampu bertahan selama masa transisi.</p><h3>Layoff Bukan Lagi Peristiwa Langka</h3><p>Beberapa tahun terakhir menunjukkan bahwa tidak ada industri yang benar-benar kebal terhadap layoff.</p><p>Mulai dari startup, perusahaan teknologi, manufaktur, media, hingga sektor keuangan, semuanya pernah melakukan efisiensi tenaga kerja.</p><p>Menurut <strong>International Labour Organization (ILO)</strong> dalam <em>World Employment and Social Outlook</em>, ketidakpastian ekonomi global, inflasi, konflik geopolitik, serta perubahan teknologi membuat pasar tenaga kerja menjadi semakin dinamis. Banyak perusahaan memilih melakukan restrukturisasi agar tetap bertahan.</p><p>Sementara itu, data dari <strong>Layoffs.fyi</strong> mencatat bahwa sejak tahun 2022, lebih dari <strong>700.000 pekerja sektor teknologi di seluruh dunia</strong> kehilangan pekerjaan akibat gelombang PHK di ribuan perusahaan teknologi.</p><p>Angka tersebut terus bertambah setiap tahunnya.</p><p>Artinya, kehilangan pekerjaan saat ini tidak selalu mencerminkan kualitas seseorang.</p><p>Dalam banyak kasus, keputusan itu lebih dipengaruhi oleh kondisi bisnis dibandingkan performa individu.</p><h3>Layoff Lebih Menyakitkan dari Sekadar Kehilangan Gaji</h3><p>Ketika mendengar kata PHK, kebanyakan orang langsung memikirkan hilangnya penghasilan.</p><p>Padahal, penelitian menunjukkan dampaknya jauh lebih luas.</p><p>Sebuah tinjauan penelitian yang dipublikasikan dalam <em>The Lancet</em> menemukan bahwa kehilangan pekerjaan berkaitan dengan meningkatnya risiko depresi, kecemasan, stres, gangguan tidur, hingga penurunan kesehatan fisik.</p><p>Mengapa demikian?</p><p>Karena pekerjaan bukan sekadar tempat mencari uang.</p><p>Pekerjaan memberikan struktur dalam kehidupan.</p><p>Ia menentukan kapan kita bangun pagi.</p><p>Ia memberi alasan untuk belajar.</p><p>Ia memperluas pergaulan.</p><p>Ia membuat kita merasa berguna.</p><p>Ketika pekerjaan hilang, semua itu ikut terguncang.</p><p>Tidak heran jika banyak orang merasa kehilangan arah.</p><h3>Langkah Pertama: Izinkan Diri untuk Berduka</h3><p>Sering kali kita mendengar nasihat seperti:</p><p><em>“Semangat ya!”</em></p><p><em>“Masih banyak perusahaan lain.”</em></p><p><em>“Move on saja.”</em></p><p>Niatnya baik.</p><p>Namun kenyataannya, tidak semua orang siap langsung bangkit.</p><p>Layoff adalah bentuk kehilangan.</p><p>Dan setiap kehilangan membutuhkan proses berduka.</p><p>Tidak apa-apa jika hari ini Anda merasa sedih.</p><p>Tidak apa-apa jika Anda kecewa.</p><p>Tidak apa-apa jika Anda marah.</p><p>Yang penting adalah jangan berhenti di sana.</p><h3>Langkah Kedua: Kendalikan Keuangan Sebelum Kepanikan Mengambil Alih</h3><p>Ketika sumber penghasilan berhenti, hal pertama yang harus dilakukan bukan membuka LinkedIn.</p><p>Melainkan membuka aplikasi mobile banking.</p><p>Hitung seluruh tabungan yang dimiliki.</p><p>Hitung pengeluaran wajib.</p><p>Pisahkan kebutuhan dari keinginan.</p><p>Buat rencana bertahan minimal tiga hingga enam bulan ke depan.</p><p>Semakin cepat Anda mengetahui kondisi finansial, semakin tenang Anda mengambil keputusan.</p><p>Panik sering kali muncul karena kita tidak tahu situasi sebenarnya.</p><h3>Langkah Ketiga: Jangan Menunggu Sampai Merasa Siap</h3><p>Banyak orang menunda melamar pekerjaan karena merasa CV belum sempurna.</p><p>Portofolio belum lengkap.</p><p>Skill masih kurang.</p><p>Padahal kenyataannya, tidak ada kandidat yang benar-benar sempurna.</p><p>Mulailah dari apa yang sudah dimiliki.</p><p>Perbarui CV.</p><p>Rapikan profil LinkedIn.</p><p>Hubungi mantan rekan kerja.</p><p>Ikuti seminar.</p><p>Hadiri networking event.</p><p>Kirim lamaran.</p><p>Mungkin sembilan lamaran pertama ditolak.</p><p>Namun pekerjaan sering datang dari lamaran yang kesepuluh.</p><h3>Langkah Keempat: Belajar Menjadi Investasi Terbaik</h3><p>Laporan <strong>Future of Jobs Report</strong> dari <strong>World Economic Forum</strong> menunjukkan bahwa perubahan teknologi akan terus mengubah kebutuhan tenaga kerja.</p><p>Beberapa kemampuan yang diprediksi semakin penting antara lain:</p><ul><li>Berpikir analitis</li><li>Problem solving</li><li>AI dan literasi digital</li><li>Komunikasi</li><li>Kepemimpinan</li><li>Adaptasi terhadap perubahan</li><li>Kemampuan belajar sepanjang hayat (<em>lifelong learning</em>)</li></ul><p>Artinya, masa menganggur tidak harus menjadi masa yang hilang.</p><p>Ia bisa menjadi masa untuk memperkuat diri.</p><p>Hari ini tersedia ribuan kursus gratis maupun berbayar melalui platform seperti Coursera, edX, Google Career Certificates, Microsoft Learn, maupun LinkedIn Learning.</p><p>Setiap keterampilan baru akan menambah nilai jual Anda di pasar kerja.</p><h3>Langkah Kelima: Jangan Menghadapi Semua Ini Sendirian</h3><p>Salah satu kesalahan terbesar setelah layoff adalah menghilang dari lingkungan sosial.</p><p>Merasa malu.</p><p>Tidak membalas pesan.</p><p>Menolak bertemu teman.</p><p>Padahal banyak peluang kerja justru datang melalui relasi.</p><p>Menurut berbagai survei rekrutmen, sebagian besar lowongan kerja terisi melalui jaringan profesional dan rekomendasi.</p><p>Berbicaralah.</p><p>Minta bantuan.</p><p>Perbarui jaringan.</p><p>Bukan karena Anda lemah.</p><p>Tetapi karena manusia memang tidak dirancang untuk menghadapi masa sulit sendirian.</p><h3>Jangan Mengukur Nilai Diri dari Status Pekerjaan</h3><p>Ini mungkin bagian yang paling sulit.</p><p>Ketika bekerja, kita sering memperkenalkan diri dengan jabatan.</p><p><em>“Saya Software Engineer.”</em></p><p><em>“Saya Marketing Manager.”</em></p><p><em>“Saya Analis Data.”</em></p><p>Lalu ketika pekerjaan hilang, muncul pertanyaan:</p><p><em>“Kalau bukan itu, lalu saya siapa?”</em></p><p>Jawabannya sederhana.</p><p>Anda tetap orang yang sama.</p><p>Pengalaman Anda masih ada.</p><p>Kemampuan Anda masih ada.</p><p>Karakter Anda masih ada.</p><p>Integritas Anda masih ada.</p><p>Yang hilang hanyalah tempat Anda bekerja.</p><p>Bukan nilai diri Anda.</p><h3>Hidup Tidak Pernah Berjalan Lurus</h3><p>Media sosial membuat kita percaya bahwa karier yang sukses adalah karier yang terus naik.</p><p>Promosi.</p><p>Naik gaji.</p><p>Pindah perusahaan.</p><p>Naik jabatan lagi.</p><p>Padahal kenyataannya tidak demikian.</p><p>Sebagian besar perjalanan karier justru penuh belokan.</p><p>Ada masa berkembang.</p><p>Ada masa berhenti.</p><p>Ada masa kehilangan.</p><p>Ada masa memulai lagi dari nol.</p><p>Dan sering kali, justru titik terendah itulah yang membawa seseorang ke arah yang tidak pernah ia bayangkan sebelumnya.</p><h3>Penutup</h3><p>Layoff memang menyakitkan.</p><p>Tidak ada kata-kata motivasi yang mampu menghapus rasa cemas dalam semalam.</p><p>Namun sejarah menunjukkan bahwa jutaan orang pernah kehilangan pekerjaan dan berhasil bangkit kembali.</p><p>Sebagian bahkan menemukan karier yang lebih sesuai, penghasilan yang lebih baik, atau kehidupan yang lebih seimbang dibanding sebelumnya.</p><p>Jika hari ini Anda sedang berada dalam fase tersebut, ingatlah satu hal:</p><p><strong>Layoff adalah sebuah peristiwa, bukan identitas.</strong></p><p>Perusahaan mungkin menghentikan kontrak kerja Anda.</p><p>Namun perusahaan tidak dapat menghapus kemampuan yang telah Anda pelajari, pengalaman yang telah Anda kumpulkan, maupun karakter yang telah Anda bangun selama bertahun-tahun.</p><p>Teruslah belajar.</p><p>Teruslah mencoba.</p><p>Teruslah membuka pintu-pintu baru.</p><p>Karena terkadang, kesempatan terbaik dalam hidup datang bukan ketika semuanya berjalan sesuai rencana, melainkan ketika kita dipaksa memulai dari awal.</p><h3>Referensi</h3><ul><li>International Labour Organization (ILO). <em>World Employment and Social Outlook</em>. <a href="https://www.ilo.org/">https://www.ilo.org</a></li><li>World Economic Forum. <em>Future of Jobs Report</em>. <a href="https://www.weforum.org/reports/future-of-jobs-report">https://www.weforum.org/reports/future-of-jobs-report</a></li><li>Layoffs.fyi. <em>Tech Layoff Tracker</em>. <a href="https://layoffs.fyi/">https://layoffs.fyi</a></li><li>Paul, K. I., &amp; Moser, K. (2009). <em>Unemployment impairs mental health: Meta-analyses</em>. Journal of Vocational Behavior.</li><li>The Lancet Public Health. Berbagai publikasi mengenai hubungan antara pengangguran dan kesehatan mental.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8864152329aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Grab Store and Process Millions of Orders Daily]]></title>
            <link>https://jansutris10.medium.com/how-grab-store-and-process-millions-of-orders-daily-fb3e5f127f2a?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb3e5f127f2a</guid>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 11:42:45 GMT</pubDate>
            <atom:updated>2023-11-17T11:51:12.644Z</atom:updated>
            <content:encoded><![CDATA[<h4>System Design</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/0*3mJd9k-sORko1Oiu.jpg" /><figcaption>Grab’s Application Services</figcaption></figure><p>Grab (formerly known as GrabTaxi) is an on demand service platform from Malaysia headquartered in Singapore. Starting from transportation services, the company now has other services such as food delivery and payments which can be accessed via mobile applications.</p><p>Initially, Grab was founded in Malaysia, before later moving their head office to Singapore. Currently, Grab operates in Southeast Asia (except Laos and Brunei). Grab is the first “decacorn” startup (a term for startups that have a company valuation of US$ 10 billion) in Southeast Asia.</p><p>In Indonesia, Grab serves vehicle orders such as motorcycle taxis (GrabBike), cars (GrabCar), taxis (GrabTaksi), couriers (GrabExpress), food delivery (GrabFood), and carpooling (GrabHitch Car).</p><p>Currently Grab is available in 125 cities throughout Indonesia, from Banda Aceh — Aceh to Jayapura — Papua.</p><h3>Introduction</h3><p>In the real world, after a passenger places a GrabFood order from the Grab App, the merchant-partner will prepare the order. A driver-partner will then collect the food and deliver it to the passenger.</p><p>Have you ever wondered what happens in the backend system? The Grab Order Platform is a distributed system that processes millions of GrabFood or GrabMart orders every day. This post aims to share the journey of how we designed the database solution that powers the order platform.</p><h3>Background</h3><p>What are the design goals when building the database solution? We collected the requirements by analysing query patterns and traffic patterns.</p><h3>Query patterns</h3><p>Here are some important query examples that the Order Platform supports:</p><h4>Write queries:</h4><p><em>a. Create an order.</em></p><p><em>b. Update an order.</em></p><h4>Read queries:</h4><p><em>a. Get order by id.</em></p><p><em>b. Get ongoing orders by passenger id.</em></p><p><em>c. Get historical orders by various conditions.</em></p><p><em>d. Get order statistics (for example, get the number of orders)</em></p><p>We can break down queries into two categories: transactional queries and analytical queries.</p><p>Transactional queries are critical to online order creation and completion, including the write queries and read queries such as 2a or 2b. Analytical queries like 2c and 2d retrieves historical orders or order statistics on demand.</p><p>Analytical queries are not essential to the oncall order processing.</p><h3>Traffic patterns</h3><p>Grab’s Order Platform processes a significant amount of transaction data every month.</p><p>During peak hours, the write Queries per Second (QPS) is three times of primary key reads; whilst the range Queries per Second are four times of the primary key reads.</p><h3>Design goals</h3><p>From the query and traffic patterns, we arrived at the following three design goals:</p><ol><li><strong>Stability</strong> — the database solution must be able to handle high read and write QPS. Online order processing queries must have high availability. Even when some part of the system is down, we must be able to provide a degraded experience to the end users allowing them to still be able to create and complete an order.</li><li><strong>Scalability and cost</strong> — the database solution must be able to support fast evolution of business requirements, given now we handle up to a million orders per month. The solution must also be cost effective at a large scale.</li><li><strong>Consistency</strong> — strong consistency for transactional queries, and eventually consistency for analytical queries.</li></ol><h3>Solution</h3><p>The first design principle towards a stable and scalable database solution is to use different databases to serve transactional and analytical queries, also known as OLTP and OLAP queries.</p><p>An OLTP database serves queries critical to online order processing. This table keeps data for only a short period of time. Meanwhile, an OLAP database has the same set of data, but serves our historical and statistical queries. This database keeps data for a longer time.</p><p>What are the benefits from this design principle? From a stability point of view, we can choose different databases which can better fulfil our different query patterns and QPS requirements. An OLTP database is the single source of truth for online order processing; any failure in the OLAP database will not affect online transactions.</p><p>From a scalability and cost point of view, we can choose a flexible database for OLAP to support our fast evolution of business requirements. We can maintain less data in our OLTP database while keeping some older data in our OLAP database.</p><p>To ensure that the data in both databases are consistent, we introduced the second design principle — data ingestion pipeline.</p><p><strong>In Figure 1</strong>, Order Platform writes data to the OLTP database to process online orders and asynchronously pushes the data into the data ingestion pipeline. The data ingestion pipeline ensures that the OLAP database data is eventually consistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*4ZRpMNagvM9ZATDv.png" /><figcaption>Figure 1</figcaption></figure><h3>Architecture details</h3><h3>OLTP database</h3><p>There are two categories of OLTP queries, the key-value queries (for example, load by order id) and the batch queries (for example, Get ongoing orders by passenger id). We use DynamoDB as the database to support these OLTP queries.</p><p><strong>Why DynamoDB?</strong></p><ol><li>Scalable and highly available: the tables of DynamoDB are partitioned and each partition is three-way replicated.</li><li>Support for strong consistent reads by primary key.</li><li>DynamoDB has a mechanism called adaptive capacity to handle hotkey traffic. Internally, DynamoDB will distribute higher capacity to high-traffic partitions, and isolate frequently accessed items to a dedicated partition. This way, the hotkey can utilise the full capacity of an entire partition, which is up to 3000 read capacity units and 1000 write capacity units.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*dmBwolYuQnh9g27Y.png" /></figure><p>In each DynamoDB table, it has many items with attributes. In each item, it has a partition key and sort key. The partition key is used for key-value queries, and the sort key is used for range queries. In our case, the table contains multiple order items. The partition key is order ID. We can easily support key-value queries by the partition key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SE4MvaO8s0jeLB-i3IIWIQ.png" /></figure><p>Batch queries like ‘Get ongoing orders by passenger id’ are supported by DynamoDB Global Secondary Index (GSI). A GSI is like a normal DynamoDB table, which also has keys and attributes.</p><p>In our case, we have a GSI table where the partition key is the pax_id_gsi. The attribute pax_id_gsi is linked to the main table. It is eventually consistent with the main table that is maintained by DynamoDB. If the Order Platform queries ongoing orders for Alice, two items will be returned from the GSI table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*wejzSEWFXpnCwZY1VDfUjQ.png" /></figure><p>We also make use of an advanced feature of GSI named sparse index to support ongoing order queries. When we update order status from ongoing to completed, at the same time, we set the pax_id_gsi to empty, so that the linked item in the GSI will be automatically deleted by DynamoDB.</p><p>At any time, the GSI table only stores the ongoing orders. We use a sparse index mechanism to control our table size for better performance and to be more cost effective.</p><p><strong>The next problem</strong> is data retention. This is achieved with the DynamoDB Time To Live (TTL) feature. DynamoDB will auto-scan expired items and delete them. But the challenge is when we add TTL to big tables, it will bring a heavy load to the background scanner and might result in an outage.</p><p>Our solution is to only add a TTL attribute to the new items in the table. Then, we manually delete the items without TTL attributes, and run a script to delete items with TTL attributes that are too old.</p><p>After this process, the table size will be quite small, so we can enable the TTL feature on the TTL attribute that we previously added without any concern. The retention period of our DynamoDB data is three months.</p><p><strong>Costwise,</strong> DynamoDB is charged by storage size and the provision of the read write capability. The provision capability is actually auto scalable. The cost is on-demand. So it’s generally cheaper than RDS.</p><h3>OLAP database</h3><p>We use MySQL RDS as the database to support historical and statistical OLAP queries.</p><p><strong>Why not Aurora?</strong> We choose RDS mainly because it is a mature database solution. Even if Aurora can provide better high-availability, RDS is enough to support our less critical use cases.</p><p><strong>Costwise, </strong>Aurora charges by data storage and the number of requested Input/Output Operations per Second (IOPS). RDS charges only by data storage. As we are using General Purpose (SSD) storage, IOPS is free and supports up to 16k IOPS.</p><p>We use MySQL partitioning for <strong>data retention</strong>. The order table is partitioned by creation time monthly. Since the data access pattern is mostly by month, the partition key can reduce cross-partition queries. Partitions older than six months are dropped at the beginning of each month.</p><h3>Data ingestion pipeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/0*iokNRjd_Ujr64d-j.png" /></figure><p>A Kafka stream is used to process data in the data ingestion pipeline. We choose the Kafka stream, because it has <strong>99.95% SLA.</strong> It is not restricted by the OLTP and OLAP database types.</p><p>Even if Kafka can provide <strong>99.95% SLA</strong>, there is still the chance of stream producer failures. When the producer fails, we will store the message in an Amazon Simple Queue Service (SQS) and retry. If the retry also fails, it will be moved to the SQS dead letter queue (DLQ), to be consumed at a later time.</p><p>On the stream consumer side, we use back-off retry at both stream and database levels to ensure consistency. In a worst-case scenario, we can rewind the stream events from Kafka.</p><p>It is important for the data ingestion pipeline to handle duplicate messages and out-of-order messages.</p><p>Duplicate messages are handled by the database level unique key</p><blockquote>(For example: order ID + creation time).</blockquote><p>For the out-of-order messages, we implemented the following two mechanisms:</p><ol><li><strong>Version update:</strong> we only update the most recently updated data. The precision of the update time is in microseconds, which is enough for most of the use cases.</li><li><strong>Upsert:</strong> if the update events occur before the create events, we simulate an upsert operation.</li></ol><h3>Impact</h3><p>After launching our solution this year, we have saved significantly on cloud costs. In the earlier solution, Order Platform synchronously writes to DynamoDB and Aurora and the data is kept forever.</p><h3>Conclusion</h3><p>In terms of stability, we use DynamoDB as the critical OLTP database to ensure high availability for online order processing. Scalability wise, we use RDS as the OLAP database to support our quickly evolving business requirements by using a rich, multiple index. Cost efficiency is achieved by data retention in both databases. For consistency, we built a single source of truth OLTP database and an OLAP database that is eventually consistent with the help of the data ingestion pipeline.</p><h3>What’s next?</h3><p>Currently, the database solution is running on the production environment. Even though the database solution is proven to be stable, scalable and consistent, we still see some potential areas of improvement.</p><p>We use MySQL RDS for OLAP data storage. Even though MySQL is stable and cost effective, it is difficult to serve more complicated queries like free text search. Hence, we plan to explore other NoSQL databases like ElasticSearch.</p><h3>References</h3><p>Amazon Web Services. (2019, 28 April) <em>Build with DynamoDB: S1 E1 — Intro to Amazon DynamoDB</em> [Video]. <a href="https://youtu.be/W3S1OnDqWl4?t=455">YouTube</a>.</p><p><a href="https://id.wikipedia.org/wiki/Grab_(perusahaan)">https://id.wikipedia.org/wiki/Grab</a></p><p><a href="https://engineering.grab.com/how-we-store-millions-orders"><em>https://engineering.grab.com/how-we-store-millions-orders</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb3e5f127f2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Network Policy — Cilium]]></title>
            <link>https://jansutris10.medium.com/kubernetes-network-policy-cilium-bfab4c1b893e?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfab4c1b893e</guid>
            <category><![CDATA[network-policies]]></category>
            <category><![CDATA[cilium]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Wed, 05 Oct 2022 15:36:38 GMT</pubDate>
            <atom:updated>2022-10-05T15:36:38.053Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Network Policy — Cilium</h3><h4>eBPF-based Networking, Observability, Security</h4><p>Network policies are Kubernetes resources that control the traffic between pods and/or network endpoints. They uses labels to select pods and specify the traffic that is directed toward those pods using rules. Most CNI plugins support the implementation of network policies, however, if they don’t and we create a NetworkPolicy, then that resource will be ignored.</p><p>Now let’s examine network policies in greater detail. In Kubernetes, pods are capable of communicating with each other and will accept traffic from any source, by default. With NetworkPolicy we can add traffic restrictions to any number of selected pods, while other pods in the namespace (those that go unselected) will continue to accept traffic from anywhere. The NetworkPolicy resource has mandatory fields such as apiVersion, kind, metadata and spec. Its spec field contains all those settings which define network restrictions within a given namespace:</p><ul><li>podSelector selects a group of pods for which the policy applies</li><li>policyTypes defines the type of traffic to be restricted (inbound, outbound, both)</li><li>ingress includes inbound traffic whitelist rules</li><li>egress includes outbound traffic whitelist rules</li></ul><p>Why does we propose Network Policy?</p><h3>Background</h3><p>We just moved to kubernetes (k8s) env for prod env. We got all the benefits of k8s containerization such consistent deployment, immutable and easy to scale infra. But on the other hand, we slightly lost in terms of <strong>network control.</strong><br>we can not perform granular access control (limit inbound / egress connectivity) to the specific pods. Opening firewall/security group to the node level will obviously grant all the container access on top of it as well.</p><p>So, we propose Network policy to control inter-service communication (pod to pod) or from another private resources.</p><h3>Prospective Solution</h3><p>The most popular CNI plugins with network policy support are:</p><ul><li><a href="https://github.com/cilium/cilium">https://github.com/cilium/cilium</a></li><li><a href="https://github.com/cloudnativelabs/kube-router">https://github.com/cloudnativelabs/kube-router</a></li><li><a href="https://github.com/projectcalico/calico">https://github.com/projectcalico/calico</a></li><li><a href="https://github.com/antrea-io/antrea">https://github.com/antrea-io/antrea</a></li><li><a href="https://github.com/flannel-io/flannel">https://github.com/flannel-io/flannel</a></li></ul><h3>Cilium</h3><p>Based on <a href="https://cilium.io/get-started/"><strong>official documentation</strong></a>, Cilium is an open source project to provide networking, security, and observability for cloud native environments such as Kubernetes clusters and other container orchestration platforms.</p><p>At the foundation of Cilium is a new Linux kernel technology called eBPF, which enables the dynamic insertion of powerful security, visibility, and networking control logic into the Linux kernel. eBPF is used to provide high-performance networking, multi-cluster and multi-cloud capabilities, advanced load balancing, transparent encryption, extensive network security capabilities, transparent observability, and much more.</p><p>In a nutshell Cilium is an “add-on” for Kubernetes that mainly implements the <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/">NetworkPolicy (NP) resource</a> (fresh K8s installation doesn’t come with network policy implementation) <strong>to provide the concept of firewalls or security groups</strong> inside the cluster. But Cilium also extends NP with CiliumNetworkPolicy to provide L7 rules (DNS based, HTTP, etc.)</p><p>Cilium is a CNI-compliant networking plugin whose purpose is to provide multi-host network connectivity for Linux containers and a way to define granular network-layer and application-layer security policies. we can read full documentation of cilium at <a href="https://docs.cilium.io/en/stable/intro/"><strong>here</strong></a>.</p><p>Cilium has a built in observability platform called Hubble that can be access both from CLI and GUI. It enable deep visibility into the communication and behavior of services, e.g. topological map that inform us which pod can hit another pod.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ok0bDV2YoImbUwcUHepH8g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfab4c1b893e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes]]></title>
            <link>https://jansutris10.medium.com/kubernetes-744b882f9139?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/744b882f9139</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[annotations]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Tue, 02 Aug 2022 12:01:47 GMT</pubDate>
            <atom:updated>2022-08-02T12:01:47.311Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial Kubernetes Series 7 — Annotation</h4><h3>Apa Fungsi Annotation?</h3><p>Annotation mirip dengan Label, hanya tidak dapat di filter seperti label.<br>Biasanya Annotation digunakan untuk menambahkan informasi tambahan dalam ukuran besar. Annotation bisa menampung informasi sampai 256kb.</p><h3><strong>Bagaimana Cara Membuat Annotation?</strong></h3><p>Pertama, saya akan gunakan kode program yang sudah saya gunakan sebelumnya sebagai template.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51a538236cfb3dca864c1275ac9e1ff8/href">https://medium.com/media/51a538236cfb3dca864c1275ac9e1ff8/href</a></iframe><p>Anda hanya perlu menambahkan key yaitu annotations, dan value dari annotation tersebut. Pada kode program diatas saya telah membuat contoh penerapan annotation dengan key: <strong>annotation-key1 </strong>dan value: <strong>veri long annotation, bla bla bla</strong></p><p>Selanjutnya, simpan perubahan yaml file tersebut dengan menjalankan perintah berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYGhxneQ9txY82DX-oR5Eg.png" /></figure><p>Anda dapat melihat bahwa pod bernama nginx-with-annotation telah berhasil dibuat. sekarang kita punya pod baru dengan nama tersebut.</p><p>Kalau kita periksa, maka annotation yang kita buat tidak akan tertampil ketika kita ingin melihat daftar pod yang ada. Kita hanya dapat melihat label dari pod tersebut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nG1bIwpnplXsL4t1UiEuKA.png" /></figure><p>Maka untuk melihatnya anda dapat menjalankan perintah berikut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd10dkWWpsohmzrjMbdooA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHu3tkaq5e2Fqm6NrAuW7Q.png" /></figure><p>Sekian dan terimakasih.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=744b882f9139" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes]]></title>
            <link>https://jansutris10.medium.com/kubernetes-ccc9b0294d7e?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccc9b0294d7e</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Sat, 30 Jul 2022 19:03:01 GMT</pubDate>
            <atom:updated>2022-08-03T18:06:10.576Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial Kubernetes Series 6— Label</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/0*ykxmrB5sF99QnomN.jpeg" /><figcaption>Implementation of label in kube8s</figcaption></figure><h3>Kenapa Butuh Label?</h3><ul><li>Untuk memberi tanda pada Pod</li><li>Untuk mengorganisir Pod</li><li>Memberi informasi tambahan pada Pod</li><li>Label tidak hanya bisa digunakan pada Pod, tapi pada semua resource di Kubernetes, seperti Replication Controller, Replica Set, Service, dan lain-lain.</li></ul><h3>Membuat Label</h3><p>Saya akan memberikan template dalam penerapan label pada Pod.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb68561ef8fd3ba8008447e8b49b45c8/href">https://medium.com/media/bb68561ef8fd3ba8008447e8b49b45c8/href</a></iframe><p>Berikut contoh penerapannya:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/10319dec7bba6ff4631f9d939f017072/href">https://medium.com/media/10319dec7bba6ff4631f9d939f017072/href</a></iframe><p>Selanjutnya untuk melakukan perubahan (berlaku untuk pembuatan pod dan berbagai resource kubernetes lainnya) anda hanya perlu mengeksekusi perintah berikut:</p><p><strong><em>kubectl create -f example-pod-with-label.yaml</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YP0kphIDvEv70lpaZdT9wA.png" /></figure><p>Jika berhasil, maka anda dapat memastikannya dengan menjalankan perintah berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YslhPs6Ld4a64VrTO9i2lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6FCLMXD_k0bav4lih2bbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YODqdsl44cK2mlCR108O9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OYenqB1l5KuinnI4bD3VNQ.png" /></figure><p>Sekian dan terimakasih.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccc9b0294d7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes]]></title>
            <link>https://jansutris10.medium.com/kubernetes-103e26bdbceb?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/103e26bdbceb</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Wed, 27 Jul 2022 19:01:16 GMT</pubDate>
            <atom:updated>2022-08-03T18:09:52.094Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial Kubernetes Series 5 — Pods</h4><h3>Apa itu Pod?</h3><p>Pod adalah unit terkecil yang bisa di deploy di Kubernetes Cluster. Pod berisi satu atau lebih container. Secara sederhana Pod adalah aplikasi kita yang running di Kubernetes Cluster</p><h3>Arsitektur Pod</h3><p>Berikut arsitektur Pod didalam kubernetes Cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/0*GTsJpUvgqoShXCfw" /></figure><h3>Kenapa Butuh Pod?</h3><ul><li>Kenapa tidak langsung menggunakan Container?</li><li>Kenapa dalam Pod bisa menjalankan lebih dari satu Container?</li></ul><p>Karena, didalam Pod kita dapat me-manage banyak container didalam Container Manager (Docker) kedalam sebuah abstraction layer yang bernama pod.</p><h3>Cara melihat daftar Pod?</h3><p>anda dapat menjalankan perintah:</p><p><strong><em>kubectl get pod</em></strong></p><p>Pada gambar ini kita tidak melihat satupun pod, dikarenakan kita belum membuat pod tersebut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*zjk2Oci3__M02PZDqffjOA.png" /></figure><h3>Cara membuat Pod?</h3><p>berikut saya berikan template dalam formal .yaml file yang bisa anda gunakan untuk membuat pod. Anda dapat membuat sebuah file konfigurasi tersebut dengan perintah:</p><p><strong><em>kubectl create -f pod.yaml</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FPYqrBLr9MlkYWMbHmQgZw.png" /></figure><p>dengan isi file sebagai berikut:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3cabd12674b42f44c58da61991b94e52/href">https://medium.com/media/3cabd12674b42f44c58da61991b94e52/href</a></iframe><p>selanjutnya, jika anda periksa maka telah ada pod baru bernama: pod-name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*jTRlmeP7L0fUyo1vnyk5og.png" /></figure><p>Maka, saya akan mencontohkan bagaimana jika anda ingin membuat sebuah pod dengan pull image <strong>nginx</strong> yang berasal dari docker image repository (docker hub).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fab6a787c14a6ea761a1a068d856700f/href">https://medium.com/media/fab6a787c14a6ea761a1a068d856700f/href</a></iframe><p>Dan jalankan kembali perintah berikut:</p><p><strong><em>kubectl create -f pod.yaml</em></strong></p><p>Maka anda akan menemukan sebuah pod baru bernama:<strong> nginx-jan</strong> dengan pull/download image nginx yang berasal dari docker-hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YIlu0Xj5Do3Jt0IgBy5BOQ.png" /></figure><p>selanjutnya, check apakah pod anda telah berhasil di download/pull.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*qVVaGLN0HiCNlsrvDkklPA.png" /></figure><h3>Cara akses Pod kubernetes?</h3><p>Lalu, bagaimana mengakses aplikasi nginx anda? mudah sekali, anda hanya perlu melakukan port forwarding dengan menjalankan perintah berikut. Port 8989 adalah port eksternal dan port 80 adalah port internal yang telah kita definisikan sebelumnya pada file <strong>pod.yaml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXuZYfKXBrC37Fz4DMdBNg.png" /></figure><p>Mari kita akses aplikasi nginx kita dari browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfDEp3Go29Y8h_zGrQ57ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lJi9XgUK1TVsR3QbA4Z6Kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaJYTgD_tk1_fn7fxtofQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9eJaZkzmvDQEjhxRHVi9Q.png" /></figure><p>Baru saja anda telah mempelajari tentang pod pada kubernetes. Semoga anda paham dalam mengimplementasikannya. Terimakasih.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=103e26bdbceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes]]></title>
            <link>https://jansutris10.medium.com/kubernetes-9438f384288e?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9438f384288e</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[arsitektur]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 04:30:55 GMT</pubDate>
            <atom:updated>2022-07-27T19:04:42.567Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial Kubernetes Series 3— Tugas dan Arsitektur Kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfMbP3hi2_oHDdLyfU7Ydw.png" /></figure><p>Tugas Kubernetes yang pertama adalah memastikan aplikasi berbasis container yang kita buat tidak mengalami downtime. Contohnya ketika kita ingin mengupdate versi dari aplikasi kita, tidak boleh ada downtime, Kalau ada lonjakan request juga tidak boleh ada downtime.</p><p>Kedua, kubernetes harus bisa melakukan scaling container aplikasi secara cepat (Scalability). kalau ada lonjakan request, maka jumlah container bertambah. Sebaliknya kalau request sepi, maka dapat menurunkan jumlah container untuk menghemat <em>billing system</em>.</p><h4><strong>Arsitektur Kubernetes</strong></h4><p>Kubernetes terdiri dari komponen berikut:</p><p><strong>Control Plane (Otak kubernetes)</strong></p><p>Komponen yang mengatur 1 atau lebih worker node. Tiap node dapat berupa Baremetal server/fisik VM ataupun Cloud.</p><p><strong>Worker node</strong></p><p>Masing-masing worker node berisi agent yaitu kubelet untuk dapat berkomunikasi dengan control-plane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hw6YvswWbfJH9yodnohMHw.png" /></figure><p>Jadi, aplikasi kita berjalan di worker-node dan sistem kubernetes jalan di control-plane.</p><h4><strong>Komponen di Control-plane</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nv6i2iROzN32KG8PU70WQ.png" /></figure><ol><li><strong>API-Server</strong></li></ol><p>jalan sebagai linux proses atau container. Sebagai gerbang masuk ke cluster kubernetes. Baik menerima Call dari CLI (Kubectl), UI (Kube8s dashboard), API dari sistem terkait lainnya baik kubelet, dari aplikasi atau dari scripting kita.</p><p><strong>2. Controller-Manager</strong></p><p>Bertugas untuk memanage berbagai state didalam cluster. Memastikan jumlah container sesuai dengan kebutuhan dan memastikan container bisa diakses dengan IP tertentu dan manage hal lainnya terkait state workload aplikasi container kita.</p><p><strong>3. Scheduler</strong></p><p>Bertugas Menempatkan pod yang isinya container kita ke Worker-node yang tepat. Jadi node punya kapasitas CPU dan Memory, maka Scheduler bakal mencari node mana yang masih kosong/available yang dapat menampung aplikasi kita.</p><p><strong>4. ETCD</strong><br>Bertugas menyimpan state atau stateful. Kalau komponen lain mati atau di restart tidak masalah, karena tidak menyimpan state apa-apa. Sementara pada ETCD kita harus hati-hati. Karena kalau data hilang di ETCD, Cluster kita bisa rusak dan aplikasi kita bisa mati (downtime).</p><p><strong>Pertanyaannya:</strong></p><blockquote>Bagaimana menghubungkan komponen yang ada di worker node dengan komponen yang ada di control-plane?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrghE0CcOIy3JFc-wL41tg.png" /></figure><p>Jawabannya, adalah Virtual network. yang menghubungkan antar container dan komponen yang lain yang tersebar diberbagai worker node, Membuat agent/kubelet di tiap worker node dapat berkomunikasi dengan komponen yang ada di control-plane.</p><p>Akibatnya, Mesin-mesin worker node dan control-plane yang terpisah ini seolah-olah bergabung menjadi satu mesin yang besar. Dengan kubernetes, kita punya cluster atau kumpulan mesin yang kecil-kecil spec-nya digabung seolah-olah menjadi satu super-computer. Misal: masing-masing mesing memiliki: 4 Core VCPU dan 16 GB RAM. <strong>kalau kita punya 100 cluster node, maka kita bakal punya 400 VCPU dan 1600 GB RAM.</strong></p><p><strong>Konsep Dasar Kubernetes</strong></p><ol><li>Pod merupakan unit terkecil yang bisa dideploy atau dijalankan didalam cluster.</li><li>Pod adalah wrapper dari container, tiap worker node bisa menjalankan 1 atau lebih Pod. Dan 1 pod bisa terdiri dari 1 atau lebih container. Biasanya, 1 pod 1 aplikasi/container.</li></ol><p><strong>Contohnya:</strong></p><p>Aplikasi database Postgre jalan sebagai 1 pod, aplikasi java jalan sebagai 1 pod, aplikasi golang jalan sebagai 1 pod. Kecuali beberapa aplikasi helper container yang coupled dengan aplikasinya bisa dibungkus menjadi 1 pod.</p><p>3. Semua worker node dihubungkan/dikomunikasikan oleh sebuah virtual network. Sehingga tiap Pod bisa punya IP adress lokal di dalam cluster bisa saling berkomunikasi lewat IP berikut. Jadi, setiap Pod bisa jadi merupakan server-server tersendiri. Bisa diakses oleh ip dan port dari masing-masing Pod.</p><p>4. Di kubernetes, kita tidak bisa menjalankan container secara langsung, tetapi harus melalui Pod nya. Dengan abstraksi Pod ini, kubernetes bisa restart container/aplikasi kita jika crash, dapat mengecek apakah aplikasi kita sehat atau tidak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTTcEuUGkpqEHdRN8UfOYQ.png" /></figure><p>5. Konsekuensi Design dari Kubernetes, Pod bersifat Ephemeral, artinya sementara. jadi, IP pod tersebut akan berganti-ganti setiap dibuat oleh kubernetes. jadi, kalau ada pod yang crash, atau dimatikan sengaja oleh kubernetes, terus dibikin ulang lagi/restart maka Pod akan mendapatkan IP baru. Jadi, Kita gak dapat mengandalkan IP pod untuk berkomunikasi.</p><blockquote>Solusi dari Point 5 adalah: <strong>Service</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sH2jm0jDtqfBDYwoBvjkpA.png" /></figure><p>Lewat IP si service, aplikasi kita bisa dapat 1 IP permanent yang bisa diakses dari node mana saja di dalam 1 cluster.</p><p>6. Service juga berfungsi sebagai load balancer, dan aplikasi kita yang berjalan sebagai Pod. Jika kita punya 3 pod, maka si service akan melakukan load balance secara Round Robin dan menggilir/mendistribusikan request ke 3 pod tersebut secara adil.</p><h4>Contoh File Konfigurasi kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKpa-URrF7uVQK8P8YtlIQ.png" /></figure><p>Client yang call kubernetes API-Server harus memberikan payload dalam format: JSON atau YAML. Berikut Contohnya file konfigurasi dalam format YAML. Dalam hal ini saya ingin membuat sebuah <strong>deployment</strong>. yang merupakan template yang disediakan untuk mebuat Pod dalam cluster kubernetes. Kita sedang membuat 3 pod (replica: 3), yang didalam nya menjalankan container dari image nginx. ini sebuah reverse proxy yang kita expose di port 80.</p><p>Kita bisa lihat, file konfigurasi YAML bersifat deklaratif. Artinya, kita bisa tulis definisi state akhir di file konfigurasi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9438f384288e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes]]></title>
            <link>https://jansutris10.medium.com/kubernetes-aad71a906d06?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/aad71a906d06</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Mon, 25 Jul 2022 04:06:40 GMT</pubDate>
            <atom:updated>2022-07-27T19:05:07.320Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial Kubernetes Series 4— Node</h4><h3>Apa itu Nodes?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*T_xCbr6HCQMpu79bz6S8IQ.png" /></figure><p>Node adalah worker machine di Kubernetes, sebelumnya ada yang menyebutnya Minion. Node bisa saja dalam bentuk VM atau Mesin Fisik. Di dalam Node selalu terdapat kubelet, kube-proxy dan container manager.</p><h3>Cara Melihat Node?</h3><p>anda dapat melihat daftar node kubernetes dengan menjalankan perintah berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*SkXntUH8-Ue3rLV6Es8LHQ.png" /></figure><p>Maka anda akan melihat sebuah node kubernetes yang bernama docker-desktop. Karena, kubernetes kita berjalan dalam sebuah container-manager bernama docker dengan tipe desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*38Xibm1Ka6H1cBF7irRjkw.png" /></figure><p>Anda juga dapat melihat detail dari sebuah node dengan mengetikkan perintah berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*gySQOIZDy4jauF1WjmnU7Q.png" /></figure><p>berikut contoh penerapannya:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjLdiB4n66roPcCgonRHkQ.png" /></figure><p>Disini akan tertera informasi terkait node seperti roles, labels, annotations, informasi disk pressure, memory pressure dan lainnya.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aad71a906d06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes]]></title>
            <link>https://jansutris10.medium.com/kubernetes-6ee7bb735497?source=rss-1cacdaf156e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ee7bb735497</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jansutris Apriten Purba]]></dc:creator>
            <pubDate>Mon, 30 May 2022 14:22:27 GMT</pubDate>
            <atom:updated>2022-05-30T14:22:27.439Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial Kubernetes Series 2 — Pengenalan Kubernetes</h4><h4>Apa itu Kubernetes (?)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CwDtMD8JJ7dhkIPk.png" /><figcaption>Source: Bytemark</figcaption></figure><p>Kubernetes adalah aplikasi untuk automation deployment, scaling dan manajemen aplikasi berbasis container. Aplikasi ini Open Source dan saat ini paling populer di jenis nya. Banyak perusahaan-perusahaan besar yang sudah menggunakan kubernetes, termasuk perusahaan Unicorn di Indonesia.</p><h4>Sejarah Kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yHyZtVG2jVqHTh36.jpg" /></figure><p>Bertahun-tahun Google membuat internal sistem yang bernama Borg (kemudian berganti nama menjadi Omega). Sistem ini digunakan untuk developer dan infa engineer untuk me-manage ribuan server yang ada di Google. Tahun 2014 Google memperkenalkan Kubernetes, Open Source System yang berasal dari pengalaman Bord, Omega dan internal system lainnya.</p><h4>Alur Kerja Menggunakan Kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxObzBy9Hd_JaJypD6AUsA.png" /><figcaption>Source: YouTube/PZN</figcaption></figure><p>Secara singkat ini alur kerja kita menggunakan kubernetes.</p><p><strong>Pertama</strong>, Developer/infra/devops engineer buat sebuah file konfigurasi (Configuration file) yang mendefinisikan aplikasi kita. contoh, image aplikasi yang ingin digunakan apa, container nya mau berapa banyak, konsumsi CPU nya berapa, konsumsi memori nya berapa, jika sudah mencapai threshold ingin scaling menjadi berapa node maksimum berapa node, minimumnya berapa node dan beberapa detail lainnya.</p><p>Contoh dari gambar ini, kita akan deploy 2 aplikasi. jadi dalam sebuah config file terdiri dari aplikasi A (kuning) dan aplikasi B (hijau). aplikasi kuning saya set jumlah node nya 3 dan aplikasi hijau saya set jumlah node nya 2.</p><p><strong>selanjutnya</strong>, konfigurasi file ini kita buat dalam ekstensi/format YAML atau JSON. Saat ini yang paling sering digunakan adalah format YAML.</p><p>Jika anda penasaran, berikut saya lampirkan contoh file konfigurasi kubernetes:</p><pre><strong>apiVersion</strong>: v1<br><strong>kind</strong>: Pod<br><strong>metadata</strong>:<br>  <strong>name</strong>: frontend<br><strong>spec</strong>:<br>  <strong>containers</strong>:<br>  - <strong>name</strong>: db<br>    <strong>image</strong>: mysql<br>    <strong>env</strong>:<br>    - <strong>name</strong>: MYSQL_ROOT_PASSWORD<br>      <strong>value</strong>: &quot;password&quot;<br>    <strong>resources</strong>:<br>      <strong>requests</strong>:<br>        <strong>memory</strong>: &quot;64Mi&quot;<br>        <strong>cpu</strong>: &quot;250m&quot;<br>      <strong>limits</strong>:<br>        <strong>memory</strong>: &quot;128Mi&quot;<br>        <strong>cpu</strong>: &quot;500m&quot;<br>  - <strong>name</strong>: wp<br>    <strong>image</strong>: wordpress<br>    <strong>resources</strong>:<br>      <strong>requests</strong>:<br>        <strong>memory</strong>: &quot;64Mi&quot;<br>        <strong>cpu</strong>: &quot;250m&quot;<br>      <strong>limits</strong>:<br>        <strong>memory</strong>: &quot;128Mi&quot;<br>        <strong>cpu</strong>: &quot;500m&quot;</pre><p><strong>Terakhir</strong>, kita cukup buat sebuah konfig file dan kita upload ke kubernetes master (seperti gerbang sistem kubernetes), nanti server kubernetes master ini yang akan me-manage ribuan kubernetes workers/nodes yang bisa dijalankan didalam cloud services maupun bare-metal server. dan kita tidak perlu mengetahui kompleksitas.</p><p>Kubernetes Master akan menyuruh kubernetes workers untuk menjalankan aplikasi-aplikasi mana saja yang mau di jalankan pada workers tersebut. Jadi, kita tidak perlu set-up VM berkali-kali. Dan kita hanya perlu defenisikan kebutuhan aplikasi kita pada konfig file tersebut dan submit/upload pada Kubernetes Master.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ee7bb735497" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>