<?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[99.co - Medium]]></title>
        <description><![CDATA[We’re a team of thinkers, engineers, designers, researchers and marketers on a mission to becoming the simplest and most trusted property portal in Southeast Asia. Follow us to learn about our tech stack, team, processes and brand. - Medium]]></description>
        <link>https://medium.com/99dotco?source=rss----affe4d81af67---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>99.co - Medium</title>
            <link>https://medium.com/99dotco?source=rss----affe4d81af67---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 07:35:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/99dotco" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[UXR newsletter: An alternative way to share research insights | 99.co]]></title>
            <link>https://medium.com/99dotco/uxr-newsletter-an-alternative-way-to-share-research-insights-99-co-4315823e746c?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/4315823e746c</guid>
            <category><![CDATA[ux-research]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[user-experience]]></category>
            <dc:creator><![CDATA[Charlotte]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 05:04:49 GMT</pubDate>
            <atom:updated>2023-10-24T14:45:21.422Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As cliche as it sounds, it’s the start of something new! In 2023, I started a quarterly newsletter publication, with the goal of sharing valuable, interesting insights to the wider team @ </em><a href="http://99.co/"><em>99.co</em></a><em>. Here I document my process &amp; outcomes.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuUt91uSEc-WUJ1irMT1cA.png" /><figcaption>2023Q2’s Newsletter cover page</figcaption></figure><h3>How it all started</h3><p>It started with my user research sharing woes 😟</p><h4>1. Engaging the uninvolved</h4><p>I finished my research study, wrote my final report, and I’m finally ready to present my findings to the wider team. But alas, the challenge has just begun — engaging non-stakeholders with user research insights. On the day of the presentation, some people are on leave, others can’t attend the sharing because they have urgent work tasks. And some are just mentally clocked out after a long day of meetings.</p><p>🚩 It is still really important for non-stakeholders, (especially teams like engineering or data that don’t interact frequently with users) to be updated on user insights, because a lack of understanding of the user makes it difficult to critique the products and experiences we create.</p><h4>2. Lack of time to share all insights</h4><p>Being in a fast-paced start-up, I often find myself pressed for time. Presenting every single research study I complete to the entire team is time consuming and sometimes impractical. It’s much more efficient to focus on discussing the findings with key stakeholders, and move on to the next project. I do post my research reports, but it’s rare for a non-stakeholder to want to read a full research report, so it was difficult to get viewership when I shared it.</p><h4>3. Product gatekeeps user research insights</h4><p>One question that is asked often is: Why is product building this? Why not do something else? A lot of our decisions are actually influenced by user insights, but the problem is that these insights are often kept within product, specifically within the design and product manager teams.</p><p>🚩 The user’s experience doesn’t stop at the product level. It extends to the content users see on our blog or social media, the marketing material we send out, and the customer service we provide them. It’s valuable for everyone that serves the user, to learn more about our users. Because after all, how else are we going to create useful and delightful experiences for them?</p><h3>My solution: UX Research Newsletter 📰</h3><p>To bridge these gaps and help the rest of the team make sense of why we do what we do, I started the UXR newsletter! This is a curated quarterly publication aimed at (1) sharing valuable, interesting findings from the quarter (that I had no opportunity to share) to the entire organisation, (2) provide updates on user sentiments, and most importantly, (3) spark interest in understanding our users, so our products remains user-centred.</p><h3>The process of creating the newsletter 👩‍💻</h3><h4>1. Writing the copy</h4><p>To get people to read the newsletter, I knew it had to be:</p><ul><li><strong>Easy to read: </strong>simple, concise, and bite-sized language</li><li><strong>Engaging:</strong> a variety of visuals, infographics, and illustrations should be included, and the writing should be fun, yet professional. Different data types (e.g. heatmaps, user quotes, analytics), should also be used to paint a well-rounded picture.</li><li><strong>Short-formed: </strong>frankly, not many apart from UXRs themselves, wants to read a long-form research report. 😰 Striking a balance in the length of the newsletter turned out to be my biggest challenge: if it was too short, results could be misinterpreted. But too long, and viewership would be low. I ended up reducing the number of topics to write about, so I didn’t need to sacrifice the depth of each one.</li></ul><p>I brainstormed some topics to write about, such as:</p><ul><li>Everything wrong with our filters.</li><li>aha! moments for users on our portal</li><li>How does the experience between churned and retained users differ?</li><li>Why did [xx metric] decline in Q2?</li></ul><p>With my list, I asked others (from different teams!) around the office, which sounded the most interesting to them. I shortlisted 3 topics and finally kickstarted the writing and designing process.</p><h4>2. Creating a moodboard</h4><p>It was my first ever design project, and I had a bad case of <strong>choice paralysis</strong> 😰: There was way too many colours, fonts, layouts I could choose from.</p><p>To get past this, I screenshotted marketing emails, magazines, infographics, and ux design case study portfolios that I liked, and put it into a moodboard. This helped me identify the fonts and colours I naturally gravitated towards. These artefacts were also good references because they<strong> all involved organising large amounts of content in a digestible, visual manner.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbADeoKozB_20CRYwGSagQ.png" /><figcaption>My final moodboard!</figcaption></figure><h4>3. Designing the newsletter</h4><p>As a non-designer, I never had to use Figma for my work.<strong> </strong>I wanted to use this<strong> opportunity to challenge myself to design the newsletter with Figma.</strong></p><p>Thankfully, <a href="https://www.youtube.com/watch?v=dXQ7IHkTiMM&amp;list=PLXDU_eVOJTx7QHLShNqIXL1Cgbxj7HlN4&amp;index=2&amp;ab_channel=Figma">Figma’s youtube tutorials</a> made it really easy for beginners like me to learn the tool. I also downloaded a few <a href="https://www.figma.com/community/file/1241125633606791793">Figma community plug-ins</a> to use as components for the newsletter. The product designers also gave me lots of constructive critique, to improve the design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNdnXsAln72rkkZlC6ufgg.png" /><figcaption>My design board, components from Figma community, and comments from the other product designers 🥰</figcaption></figure><h4>4. Distributing the newsletter</h4><p>When I was finally done, I sent it on our company’s <strong>#announcements slack channel. </strong>To maximise readership, I also <strong>printed a physical copy </strong>and left it on the office <strong>pantry</strong>. It was the part of the office that everyone frequented, so people would literally see it on the table, and could pick it up and read while having a quick snack break. This move ended up being really effective for views 📌.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6SjnnTsSJKGdBwvl4RVPtg.png" /><figcaption>Sharing on the company #announcements channel</figcaption></figure><h3>Presenting 2023Q1’s issue! ✨</h3><p>The image below displays the key elements of the newsletter. The final newsletter was 11 pages long. (due to NDA, some parts are censored and not all pages are in here).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsHAyln60vmn6K4Zbfu1ug.png" /></figure><h3>Outcomes… was it worth it?</h3><p>The newsletter was quite successful at:</p><ul><li>✅ Increasing interest and engagement with user research</li><li>✅ Gathering product ideas from those in non-product teams</li><li>✅ Giving more more power and influence to design and user research teams. ⭐️ I realised that <strong>the more people I share user insights to, the more likely user research will get acted on. </strong>This is because people started asking more questions, and holding product accountable for addressing user pain-points and usability problems.</li><li>✅ Increasing accessibility to user research within the organisation. I linked the relevant documentation and final reports in the newsletter for others to read more if they were interested.</li></ul><h4><strong>Check out the team’s reactions 👇🏻</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z59I9OB700HOehI4ZRqK1A.png" /><figcaption>I was just thankful my efforts to make the newsletter short and digestible paid off, phew 😮‍💨</figcaption></figure><p>However, there were also downsides:</p><ul><li><strong>💔 It’s very high effort.</strong> Because I did the writing and design of the first newsletter solely by myself, it took a lot of time and labor. For the subsequent newsletters I involved the other designers, so we can co-produce and split the work.</li><li><strong>💔 The people who aren’t interested, still won’t be interested</strong>. The newsletter was good at making user research more accessible to those genuinely interested in user research. Unfortunately, it still did not engage those who didn’t really care about user research.</li><li>💔 <strong>Very technical or purely quantitative projects seems to be less interesting to some</strong>. This is because it takes more effort to understand, and even though there are charts and graphs, it’s still less visually engaging than heatmaps, journey maps and personas. (am still practicing my storytelling skills for numbers heavy studies 💪🏻)</li></ul><p>In retrospect, I feel that this initiative was a worthy endeavour to try out! It’s also provides a nice summary of the quarter’s most valuable and exciting insights. However, it’s important to monitor if the rest of the organisation is receptive, to avoid investing a large amount of effort on something which wouldn’t be read by the others.</p><h3>Final reflections ✍️</h3><ul><li><strong>A new found appreciation for design</strong>: There’s a lot of considerations I had to think of, like how to cater to the different types of readers in the organisation (product vs. non-product), and how to fit lots of information in a format that is readable and easy on the eyes.</li><li>I’ve been thinking of this newsletter idea for months before I actually started on it. I wasn’t sure if people was going to be receptive to it, and I spent a long time contemplating on whether it was even worth doing. Looking back, there was only one way to know if others would like it, <strong>i.e. worry less, and just start it!</strong></li></ul><p><em>Many thanks to </em><a href="https://windglide.medium.com/"><em>@Huiling</em></a><em> for your help in co-producing this project, and to </em><a href="https://medium.com/@curtiskoh"><em>@Curt</em></a><em>, Clarissa, Rupesh, Yan, </em><a href="https://medium.com/@zshaoz"><em>@Andy</em></a><em>, and Jolynn, for all your feedback on my newsletter drafts 💜</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4315823e746c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/uxr-newsletter-an-alternative-way-to-share-research-insights-99-co-4315823e746c">UXR newsletter: An alternative way to share research insights | 99.co</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learnings from my first year as a UX researcher]]></title>
            <link>https://medium.com/99dotco/learnings-from-my-first-year-as-a-ux-researcher-7d0d5b39c249?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/7d0d5b39c249</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[ux-research]]></category>
            <category><![CDATA[user-research]]></category>
            <dc:creator><![CDATA[Charlotte]]></dc:creator>
            <pubDate>Wed, 29 Mar 2023 10:03:21 GMT</pubDate>
            <atom:updated>2024-03-24T06:47:54.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XyznXBmH8NoTM8-d" /><figcaption>Photo by <a href="https://unsplash.com/@uxindo">UX Indonesia </a>on <a href="https://unsplash.com/photos/w00FkE6e8zE">Unsplash</a></figcaption></figure><p>Just 2 years ago I was mugging through my final year of college, ready to pursue a career in psychology, with no knowledge that UX/UI even existed. Life really finds a way to surprise you, because here I am celebrating my first anniversary of officially being a UX researcher! 🥳</p><p>To commemorate this milestone and reflect on my annual performance feedback, I wanted to pen down my learnings, to solidify them and ensure I don’t forget. So, here are some of my key takeaways from the past year:</p><h3><strong>#Lesson 1: Chesterton’s Fence</strong></h3><p>Chesterton’s fence is a concept by writer and philosopher G.K Chesterton that essentially states that <strong>if a fence exists, there’s likely a reason for it,</strong> <strong>even if it’s not apparent.</strong></p><p>The exact quote goes like this:</p><blockquote>“There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, “I don’t see the use of this; let us clear it away.” To which the more intelligent type of reformer will do well to answer: “If you don’t see the use of it, I certainly won’t let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it.”</blockquote><p>Chesterton’s fence has been most applicable when it comes to removing or simplifying product features. I’m often quick to conclude that we should remove features because it seems redundant. But I’ve been disproven countless times, because there’s often an <strong>underlying reason for why it was built in the first place, and removing it could’ve led to unforeseen consequences</strong>.</p><p>Additionally, as someone who is direct and who tends to hold strong opinions about products and processes, Chesterton’s fence has been a valuable learning for my communication style. It’s something I’m still working on, but spending the time to understand the history of a feature has been helpful for me to build empathy, and enabled me to give more sensitive and constructive feedback when proposing changes.</p><h3><strong>#Lesson 2: Users don’t know what they want until they see it</strong></h3><p>I first realised this a few months back when a friend asked for my thoughts on incorporating gamification in a budgeting app she was designing. I was initially opposed, because gamification seemed unsuitable for a serious matter like finances, and it could add unnecessary complexity. However, I ended up changing my mind when I saw her wireframes. Her app’s concept was super cute: Grow your money just as you would grow a plant.</p><figure><img alt="A wireframe my friend designed for a budgeting app. It has the log-in page, the homepage indicating the amount available for spending, and a page for inputting saving goals." src="https://cdn-images-1.medium.com/max/1024/1*CU11mVPF7_ADE2UzD0zQNA.png" /><figcaption><em>My friend’s wireframes for her budgeting app</em></figcaption></figure><p>My first thought when I saw her designs was that it could be a good motivator if users could grow a virtual plant each time they hit a finance goal. And they could look back at it a year later and be proud of having grown an entire garden. Which ironically is the gamification I initially thought was a bad idea.<strong> In other words, I didn’t think it was a good idea until I saw it for myself.</strong></p><p>The concept of users not knowing what they want until they see it, was first popularised by Apple’s cofounder Steve Jobs. He said:</p><blockquote>“Some people say, “Give the customers what they want.” But that’s not my approach. Our job is to figure out what they’re going to want before they do. I think Henry Ford once said, “If I’d asked customers what they wanted, they would have told me, ‘A faster horse!’” People don’t know what they want until you show it to them. That’s why I never rely on market research. Our task is to read things that are not yet on the page.”</blockquote><p><strong>In short, this mostly happens because users don’t always have the ability to imagine and articulate the most desirable solution before it exists.</strong></p><p>While this is so, it doesn’t mean that we shouldn’t listen to users because they don’t know what they are saying. Ultimately, research is still necessary to gain an accurate understanding of the problem space. But when ideating we evaluate user suggestions critically, and explore ideas beyond their expectations, instead of limiting ourselves to what users said they wanted.</p><h3><strong>#Lesson 3: A great idea is only great if it’s executed well</strong></h3><p>When uncovering user pain points, occasionally the solutions to address them are readily (and obviously) apparent.</p><p>In one of our previous studies on new launch (NL) property buyers, we found that discovery of NLs was painfully fragmented, because there wasn’t any platform that consolidated all NLs into one place for easy browsing. Instead, discovery was occurring by chance if an ad pops up on their social media feed, or if they happen to hear about it from friends.</p><p>The obvious solution, which many users also suggested is to consolidate all the new launches out there into a comprehensive list for browsing. <strong>However while the idea was good, the execution fell short. </strong>During testing, we found that even though users liked the list we created, they all felt that a table format was information heavy and overwhelming to look at. They preferred a grid view (which we ended up implementing, <a href="https://www.99.co/singapore/new-launches">here</a>), which was more visually relieving on the eyes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kcq8hqJ0yUMCPFHvRxFCAA.png" /><figcaption>The different presentation formats we tested (Photo by me)</figcaption></figure><p>Users always find a way to surprise you, because this is just one of <em>many</em> incidents where we thought a solution was good and almost shipped it out until user feedback came in. So this is an important reminder that <strong>even an obvious solution can fall short if the execution is not carefully considered and tested. A</strong>lways test as much as possible before implementation!</p><h3><strong>#Lesson 4: Triangulation of data is key</strong></h3><p>One of the most common feedback from stakeholders is that<strong> qualitative UXR insights cannot be trusted because sample sizes are too small. </strong>Especially because I work at a start-up, I don’t have the luxury of time to conduct big qualitative studies with a good sample size. And it’s extra frustrating because the stakeholders are right. Qualitative conclusions can only be taken sceptically because they cannot be statistically proven. Which is why triangulation of data is so important.</p><blockquote><strong>Triangulation</strong> is the practice of using multiple sources of data to verify your findings.</blockquote><p>With triangulation, you can check if qualitative findings are credible, by seeing if the same finding is replicated in another data source (e.g. heatmaps/ analytics data).</p><p>Triangulation is also important for <strong>quantitative data, because it doesn’t tell you the <em>whys. </em></strong>For instance, we may be able to see from analytics that users aren’t using the search bar even though it’s the centre stage of the screen. However, without the qualitative understanding of the reasons behind this behaviour, we wouldn’t know what next steps to take. It is possible that users on that page are in browsing mode, so they don’t know what to search for specifically. In this case, listing recommendations may be more appropriate, over a search bar.</p><h3><strong>#Lesson 5: You don’t have to do all the research in the team</strong></h3><p>The last learning I have is more personal rather than technical. Something I did a lot in the past year was to try to involve myself in as many (if not all) research projects as possible. I felt the need to gatekeep research related activities in the organisation, because afterall, this is supposed to be my specialty. <strong>If product designers can also do the research, then what is my role here for?</strong> It made my question what exactly do UX researchers (UXRs) do that contributes beyond what the UX designers (UXDs) could do.</p><p>After much self doubt and pondering, I’ve come to understand a few key ways the UXR role value-adds and differentiates themselves from the rest of the team:</p><ul><li><strong>UXRs tend to conduct strategic research </strong>(exploratory; identifies opportunities and behaviours in the broader journey), <strong>whereas UXDs conduct tactical research </strong>(design-focused; to assess designs and help with design decisions)</li><li><strong>UXRs work on all verticals of a product, whereas UXDs tend to focus on a specific aspect. </strong>E.g. in a marketplace, UXRs would do research on both seller and buyers, whereas a UXD may only focus on designing for sellers.</li><li>Because UXRs work across all verticals of the product, we can <strong>consolidate findings and provide more holistic recommendations that account for the product as a whole.</strong></li><li><strong>UXRs may also occasionally conduct market research, </strong>to develop a broader understanding of the market and the competitor landscape.</li><li>Lastly and importantly, UXRs are there to <strong>ensure scientific rigour of research within the organisation</strong> (as much as practicality allows), so that decisions are guided by accurate insights.</li></ul><p>Looking back, trying to be on every research project spreads you out too thin, and sets you on a path to eventual burnout. So yes, I’ve come to appreciate that <strong>everyone can contribute to the research process</strong>. In fact, some of the UXDs I’ve worked with have exceptional research skills and I regard them as UXRs in their own right. And while this is so, it doesn’t diminish the importance of UXRs to the team.</p><h3><strong>Final thoughts</strong></h3><p>I wanted to end this reflection with an observation I made over the past year, which is that interns often possess a spark of optimism and passion that many full-timers don’t have. Of course, its totally understandable that the daily grind of work can result in disillusionment over time. Which is precisely why I wanted to write about this, as a note-to-self to upkeep that same level of enthusiasm and drive that I am feeling now in the first year of my career.</p><p>Overall, all the learnings here are a work-in-progress, and i’m still trying to conquer them! The past year has been a valuable experience I couldn’t have gotten without my supportive team members (shoutout to the 99.co design team). Looking forward to yet another new year of growth, challenges and opportunities that lie ahead 🥂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d0d5b39c249" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/learnings-from-my-first-year-as-a-ux-researcher-7d0d5b39c249">Learnings from my first year as a UX researcher</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[(Airflow-Kubernetes) We attempt to simulate real-time data ingestion using high frequency batch…]]></title>
            <link>https://medium.com/99dotco/lessons-learnt-from-running-high-frequency-data-pipelines-on-an-airflow-kubernetes-setup-58546c411ad2?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/58546c411ad2</guid>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Andy Yan]]></dc:creator>
            <pubDate>Thu, 05 Jan 2023 11:23:04 GMT</pubDate>
            <atom:updated>2023-01-06T10:12:14.140Z</atom:updated>
            <content:encoded><![CDATA[<h3>(Airflow-Kubernetes) We attempt to simulate real-time data ingestion using high frequency batch ingestion. Here’s what happened…</h3><p><em>In this article, we will be sharing how we attempt to schedule our pipelines more frequently to achieve ‘pseudo real-time’ data ingestion and the issues that came along with it. For context, our Airflow instance is deployed on a Kubernetes Cluster, and we talked about it in detailed </em><a href="https://medium.com/99dotco/modernizing-the-data-engineering-stack-in-99-group-579aa5eb5246"><em>here</em></a><em>.</em></p><h3>The Problem</h3><p>As more of our stakeholders build their workflow around reports powered by our data, one of the common requests is to have the data ingested more frequently, so that they could have the data as up-to-date as possible. This is especially important for workflows that are time-sensitive in nature. However, our data engineering system is built for batch ingestion, which is not ideal the ideal technology here. As a workaround to meet this requirement, some of our pipelines are scheduled to ingest data at a 15-minute interval.</p><p>While we were on a search for an appropriate data streaming solution, the requests for these high frequency pipelines piled up. Eventually, the performance of these pipelines degraded, and they couldn’t finish the job within the 15-minute interval. Most of the time were spent by these tasks waiting for their turn to run. This has a cascading effect, affecting downstream tasks and failed subsequent runs. We deep dived into the system and observed the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7NqyReRGWKarv1I8ufdn8g.png" /><figcaption>Number of task instances running (i.e. pods running) over time. This graph includes task instances from both high and low frequency pipelines. At 06:30, most pipelines will attempt to run.</figcaption></figure><p>As of then, some of our key configurations and observations are as follows:</p><ul><li>Airflow’s paralellism is set to 64, while the graph shows that at any time, there’re less than 30 task instances running. Number of concurrent task instances allowed to run is not at its limit yet.</li><li>Maximum nodes in the node pool in the Kubernetes Cluster is set to 6, while at any time during this period, the number of active nodes are at 4 at most. This means that there are available resources to run any of the enqueued tasks, but they are not being utilised.</li><li>Most of the time are spent by the tasks waiting to run. Once they start running, their time taken to complete are the same as before. This means that resources provided for the tasks are also not an issue.</li><li>The Airflow’s Scheduler instance is also not maxing out the amount of resource allocated to it.</li></ul><p>From these observations, we can safely conclude that resources allocated to the system as a whole are not an issue. The Scheduler is likely the bottleneck here.</p><h3>The Configuration</h3><p>Upon further investigation, we realized one of our key KubernetesExecutor configuration — worker_pods_creation_batch_size is set to the default value of 1. According to the documentation, worker_pods_creation_batch_size is the <em>number of Kubernetes Worker Pod creation calls per scheduler loop.</em> This means that during any scheduler loop, there’s only one worker pod created to run an enqueued task instance. The throughput of the Scheduler passing the tasks to the KubernetesExecutor is too low, and this could be the key to resolving the bottleneck.</p><p>We adjusted the worker_pods_creation_batch_size to 2, and then 4 and observed the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*BlzeWmlZttrIjcrZZEpKng.png" /><figcaption>`worker_pods_creation_batch_size` is set to 2. Number of pods running concurrently goes up to 30+.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PjWOrSSiujTskuA8XN8rHw.png" /><figcaption>`worker_pods_creation_batch_size` is set to 4. Number of pods running concurrently goes up to 70+.</figcaption></figure><p>As we can see, at 06:30 when Airflow is attempting to run most of the tasks, the number of task instances running at any given time was able to go as high as 70. More nodes were spawned to meet the resource requirements, and the high frequency pipelines were able to complete in time. Everything seemed to be hunky-dory… and then, there’s this other issue.</p><h3>The Other Issue</h3><p>Right after the changes we made, the main Airflow deployment, which consists of both the Webserver and the Scheduler instances, started to have this odd behaviour of restarting itself every now and then (as frequent as every 15 to 30 minutes, especially during high workload period). While it didn’t break our system completely, it did introduce some disruptions to the team, since there’s always a lead time before the Webserver and Scheduler completely spins up. With our monitoring tools in place, we observed the following:</p><ul><li>There seemed to be a smooth transition during the restarting of the Webserver and Scheduler instances. The old instances will always wait for the new instances to be ready before being shut down.</li><li>Scheduler logs didn’t state anything except <em>“exiting gracefully upon receiving signal 15”</em>. The Scheduler was running fine and was likely terminated by an external agent.</li><li>The Webserver and Scheduler instances were restarted only when they are the only pods running in a node. The new instances are deployed onto another node.</li></ul><p>We suspected that it is likely the Cluster Autoscaler that is restarting our Airflow instance onto another existing nodes in order to utilize any existing nodes efficiently.</p><h3>The Cluster Autoscaler</h3><p>So this begged the question: Why did the Cluster Autoscaler so aggressively restart our Airflow instances onto other nodes? This hadn’t happen before. So why increasing the number of worker pods created per loop will result in this behaviour?</p><p>According to this <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-does-scale-down-work">FAQ</a>, the condition for the Cluster Autoscaler to scale down a particular node are as follow:</p><ul><li>The sum of CPU and memory requests of all pods running on this node is smaller than 50% of the node’s allocatable. Utilization threshold can be configured.</li><li>All pods running on the node can be moved to other nodes.</li><li>It doesn’t have scale-down disabled annotation.</li></ul><p>Furthermore, our Kubernetes Cluster is deployed using GKE with the following <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#autoscaling_profiles">autoscaling profile</a> — optimize-utilization<strong>.</strong> With this profile enabled, the Cluster Autoscaler <em>‘prioritize optimizing utilization over keeping spare resources in the cluster. When selected, the cluster autoscaler scales down the cluster more aggressively: it can remove more nodes, and remove nodes faster.’</em> This meant that Cluster Autoscaler constantly look out for opportunities to redeploy any pods in any underutilized nodes to those that are already sufficiently utilised, such that the total number of active nodes required to run the workload (considering the resources requested) can be kept to a minimum.</p><p><strong>Given the understanding above, our hypothesis of what had transpired can be summarized as follows:</strong></p><p>When worker_pods_creation_batch_size was set to 1, the rate of worker pods created on the cluster is low (low throughput). As a result, new nodes were spawning slower. The rate of worker pods completion was also slower, resources in the nodes freed up slower. There were little to no opportunities for Cluster Autoscaler to consider re-deploying pods to other nodes to maximize utilization of nodes.</p><p>When worker_pods_creation_batch_size was set to 4, the rate of worker pods created on the cluster is high (high throughput). As a result, new nodes were spun up quicker. When a batch of worker pods in a particular node completed at the same time, this leaves that particular node heavily under-utilized. If the Airflow instances are found in this same node, Cluster Autoscaler has to re-deploy them to other sufficiently utilised node. Hence, this caused the frequent redeployments, and therefore the restarts.</p><p>To further illustrate, let’s assume the following in this example:</p><ul><li>Only CPU resource requests are considered for scaling up and scaling down</li><li>Airflow pods request 1.5 CPU in total and worker pods request 1.0 CPU each</li><li>A node have a total allocatable CPU of 4.0</li><li>All worker pods have the same completion time</li></ul><p><strong>When </strong><strong>worker_pods_creation_batch_size was set to 1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tf5WhjVUSbkdA4DBePy13w.png" /></figure><p><strong>When </strong><strong>worker_pods_creation_batch_size was set to 4:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G7t9E_XrF15c1PLVgy1jFQ.png" /></figure><h3>The Anchor Tenant</h3><p>To resolve this constant redeployment of our Airflow instances, we would have to violate one of the scale-down conditions. Suggested from the same <a href="https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-does-scale-down-work">FAQ</a>, we have to annotate the pods of the Airflow instances with the following:</p><pre>&quot;cluster-autoscaler.kubernetes.io/safe-to-evict&quot;: &quot;false&quot;</pre><p>This violates the second condition of the aforementioned scale-down conditions. Whichever node the pods of the Airflow instances ended up in, there were not allowed to be re-deployed to other nodes by Cluster Autoscaler. It acts as an ‘anchor tenant’ that keeps the node from scaling down by the aggressive Cluster Autoscaler.</p><p>While this might mean a slightly less efficient utilization of our allocated nodes, having a stable state of our Airflow instances is well worth it.</p><h3>The Lessons Learnt</h3><p>In summary, here’s what we have learnt:</p><ul><li>The default value for worker_pods_creation_batch_size of 1 is insufficient to fully take advantage of the available resources allocated. The value should be slowly adjusted upwards to find the optimal point where it takes advantage of all resources available, while doesn’t overwhelm the Kubernetes Cluster.</li><li>Cluster Autoscaler is aggressive when it comes to optimizing the number of active nodes needed to handle all the workloads. It will attempt to keep the number of active nodes to a minimum.</li><li>High rate of worker pods deploying and completing at the same time results in some nodes being under-utilized, easily giving rise to the right conditions for Cluster Autoscaler to scale down said nodes. This results in frequent re-deployment of pods that are supposed to run indefinitely (i.e. Airflow instances).</li></ul><p>All the aforementioned issues came about when we tried to simulate real-time data ingestion using technologies built for batch ingestion. While these changes we made helped stabilize our system, we are still pursuing a proper real-time data streaming solution.</p><p><em>This was initially written as our post-mortem for internal discussion by Ridho Fadillah. The post-mortem was subsequently reviewed and edited into what became of this blog post.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58546c411ad2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/lessons-learnt-from-running-high-frequency-data-pipelines-on-an-airflow-kubernetes-setup-58546c411ad2">(Airflow-Kubernetes) We attempt to simulate real-time data ingestion using high frequency batch…</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Victoriametrics? Replace Prometheus?]]></title>
            <link>https://medium.com/99dotco/victoriametrics-replace-prometheus-8f17ad32cdf?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/8f17ad32cdf</guid>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[victoriametrics]]></category>
            <category><![CDATA[monitoring-software]]></category>
            <category><![CDATA[uptime-monitoring]]></category>
            <dc:creator><![CDATA[darrengomez]]></dc:creator>
            <pubDate>Thu, 05 Jan 2023 11:13:22 GMT</pubDate>
            <atom:updated>2023-01-05T11:13:22.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHJLuMyde2A34gUTv8_Vdg.png" /></figure><h3>The issue with Prometheus?</h3><p>You have your Kubernetes cluster setup, and now you&#39;re looking for some visibility on what&#39;s happening in my cluster you come across <a href="https://prometheus.io/">Prometheus</a> and <a href="https://prometheus.io/docs/guides/node-exporter/">Node Exporter</a>, and there you go, it opens a whole new world into monitoring by using <a href="https://grafana.com/">Grafana</a>. Everything seems to be perfect.</p><p>With time you feel like you need more visibility for the applications that run on your cluster. Just CPU, Memory and Hard disk metrics are not enough, teams need to debug more into applications running. Viola Prometheus has libraries for almost all languages, and dev teams integrate Prometheus into applications and expose application-level metrics, now you have set up dashboards for the application metrics and everything looks amazing since you have visibility that you&#39;ve never had before.</p><p>Let&#39;s say for example you have around 20 microservices ingesting data into Prometheus, one-day requests start increasing and you want to monitor how your services are performing and you notice gaps in your dashboards then you start checking has your pod had a restart and start debugging Prometheus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNxCqCHGuYLakdZbYVrOiA.png" /><figcaption>Grafana dashboards when Prometheus restarts</figcaption></figure><p>Then you start to notice that with time memory has been increasing on the Prometheus deployment. Memory usage in Prometheus is directly proportional to the number of time series stored, as your time series grows, you will have more OOM kills. Then the next thing is to increase resource quotas, but you cannot do this till it fills up your entire node. Prometheus which ingests millions of data points can easily grow to around 100GB of memory which will be an issue if running on Kubernetes.</p><p>The problem arises when the system loads increases and Prometheus goes down due to resource crunches. Now you do not have metrics to even check why the services have a huge surge of requests which leaves dev teams in the dark. Once Prometheus has occupied your node’s resources other pods cannot be scheduled as well, Yes, you can have dedicated nodes for Prometheus but it does not take away the fact that the resource usage is increasing daily.</p><h4>Why does Prometheus behave this way?</h4><p>The main reason why Prometheus behaves this way is because of the way it is designed. It single-handedly scrapes metrics from all the targets specified in the configurations, stores the data, and processes the requests received from Grafana to visualize, or even normal queries received. Prometheus is not designed to be horizontally scaled, so once you hit the bottleneck of vertical scaling you&#39;re done. This becomes a very serious problem since Developers and Stakeholders understand the power of custom metrics and business data.</p><h3>What&#39;s Next?</h3><p>We need to find a solution that has the amazing functionality that Prometheus offers, something that scales horizontally, a solution that can be implemented without making application changes.</p><h3>Victoriametrics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNBNpezVoHc6l3TYWo-oxw.png" /></figure><p>Here’s one solution for using Prometheus-like functionality at scale <strong>Victoriametrics (VM)</strong>. According to my personal experience, the reason why migrating from Prometheus to VM is easier is that no components change, and the same syntax used for PromQL can be used to query data from VM. Simply deploy it on infrastructure and configure it as a data source in Grafana; existing dashboards will continue to function as before because there is no difference in data storage.</p><h4><strong>What&#39;s different with VM?</strong></h4><p>Data insertion, selection/querying, and storage are all handled by a single Prometheus instance, which is why when it fails, all monitoring verticals fail. This is a dangerous environment for a mission-critical product that relies heavily on its monitoring and alerting stack. These three main functionalities are separated by VM. They are known as vminsert, vmstorage, and vmselect. Allow me to elaborate.</p><ul><li><strong>vmstorage: </strong>indexes and stores the raw data and returns when requests with any label filters if needed</li><li><strong>vminsert</strong>: accepts incoming data and sends it to corresponding vmstorage nodes with all the labels sent</li><li><strong>vmselect</strong>: accepts incoming queries to VM and requests data from the configured vmstorage nodes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U57htfiwVV_G5yj_qA62qQ.png" /><figcaption><a href="https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html">Victorimatrics Cluster Architecture</a></figcaption></figure><p>The three components listed above work together to provide an uninterrupted monitoring stack. Even if the insertion fails, the storage and querying functions continue to function normally, giving the team time to debug and fix.</p><h4>Performance comparison Prometheus vs VM</h4><p>A benchmark test <a href="https://valyala.medium.com/prometheus-vs-victoriametrics-benchmark-on-node-exporter-metrics-4ca29c75590f">article</a> was written for comparison purposes, with the below storage stats,</p><ul><li>Ingestion rate: 280K samples/sec</li><li>Active time series: 2.8 million</li><li>Samples scraped and stored: 24.5 billion</li></ul><p>Summarizing let&#39;s see the benchmark results obtained by the above test,</p><p><strong>Disk space usage:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_lFwIe7L3m__iFW1.png" /><figcaption>Disk space usage: VictoriaMetrics vs Prometheus</figcaption></figure><p><strong>Disk IO usage:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RzxpehhHSmEfW6CS.png" /><figcaption>Disk IO: bytes written per second: VictoriaMetrics vs Prometheus</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*b5AydNszPvX2ZM7e.png" /><figcaption>Disk IO: bytes read per second: VictoriaMetrics vs Prometheus</figcaption></figure><p><strong>CPU usage:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CVRXCuqF0V3_96lC.png" /><figcaption>CPU usage, vCPU cores: VictoriaMetrics vs Prometheus</figcaption></figure><p><strong>Memory usage:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*duBjqSmwNUOhN8Y4.png" /><figcaption>RSS Memory usage: VictoriaMetrics vs Prometheus</figcaption></figure><p>For more in-depth details on the specs used for the above test check out the <a href="https://valyala.medium.com/prometheus-vs-victoriametrics-benchmark-on-node-exporter-metrics-4ca29c75590f">article</a> mentioned.</p><h3><strong>VM for small-scale monitoring architectures</strong></h3><p>VM offers two options. Even if you only need a small amount of monitoring, you can use vmsingle for stacks that ingest less than 1 million data points per second. In comparison to Prometheus, vmsingle can be scaled and performs well.</p><p>The load on vmsingle can be reduced by using the vmagent service, which scrapes data and writes it to vmsingle, requiring vmsingle to only serve storage and retrieval requests. You can ingest data for vmagent using this method from any deployed infrastructure.</p><p><strong><em>Example scrape configs for vmagent</em></strong></p><pre>  global:<br>    scrape_interval: 20s<br>  # scrape self by default<br>  scrape_configs:<br>    - job_name: vmagent<br>      static_configs:<br>        - targets: [&quot;localhost:8429&quot;]<br>    - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token<br>      job_name: kubernetes-apiservers<br>      kubernetes_sd_configs:<br>        - role: endpoints<br>      relabel_configs:<br>        - action: keep<br>          regex: default;kubernetes;https<br>          source_labels:<br>            - __meta_kubernetes_namespace<br>            - __meta_kubernetes_service_name<br>            - __meta_kubernetes_endpoint_port_name<br>      scheme: https<br>      tls_config:<br>        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt<br>        insecure_skip_verify: true</pre><p>The above configs are similar to the Prometheus scrape configs, which makes it easier to migrate (No syntax changes)</p><p><strong><em>Example remote write configs:</em></strong></p><pre>remoteWriteUrls: [&quot;http://vmsingle-victoria-metrics-single-server.monitoring.svc.cluster.local:8428/api/v1/write&quot;]</pre><p>This basically points to the cluster DNS of the deployed vmsingle instance.</p><blockquote>Note:</blockquote><blockquote>You can use the Prometheus remote write API as well to write data to vmsingle, but <a href="https://prometheus.io/docs/prometheus/latest/storage/">Prometheus WAL</a> is heavily used for the remote write feature which in return brings the resource crunch problem back, so we easily replace Prom with vmagent.</blockquote><p>There are a few default limitations that VM has which can be parameters tweaked which can be passed as extra arguments for a Kubernetes deployment, for example:</p><ul><li><strong>maxLabelsPerTimeseries</strong>: labels to store when data is ingested, the default value is 30</li><li><strong>search.maxConcurrentRequests: </strong>search requests that hit the vmsingle node</li><li><strong>search.maxQueueDuration: </strong>VM handles all incoming search requests via an internal queue mechanism, this parameter decides how long to hold the queue for, the default value is 10s</li><li><strong>search.maxQueryDuration: </strong>time taken for a search query</li></ul><p>These are some parameters that I adjusted to ensure that the functionality remained consistent with Prom and that the dashboard visualized the same data. All warnings and errors will be thrown on the associated node and can be debugged; more common errors can be found <a href="https://docs.victoriametrics.com/Troubleshooting.html?highlight=troubleshooting">here</a>.</p><h4><strong>Conclusion</strong></h4><p>If you use Prometheus and rely on it for mission-critical alerts, it is highly recommended that you look into alternatives because it is not designed to scale horizontally, so developers will find themselves increasing resources and maxing out their nodes over time, which will in turn restart Prometheus, creating a never-ending cycle.</p><p>VM is both resource and performance efficient. Migration is simple because the same scraping configurations can be used; no syntax changes are required. It is advised to run VM alongside Prometheus and observe the differences before fine-tuning it to match the same functionality and performance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f17ad32cdf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/victoriametrics-replace-prometheus-8f17ad32cdf">Victoriametrics? Replace Prometheus?</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BigQuery’s schema auto-detection does not work perfectly like we want it to, so we build our own.]]></title>
            <link>https://medium.com/99dotco/bigquerys-schema-auto-detection-does-not-work-perfectly-like-we-want-it-to-so-we-build-our-own-93a5f1a1f67?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/93a5f1a1f67</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[schema-detection]]></category>
            <dc:creator><![CDATA[Andy Yan]]></dc:creator>
            <pubDate>Tue, 15 Nov 2022 15:50:31 GMT</pubDate>
            <atom:updated>2022-11-15T15:50:31.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2zj7fbvuvmhcO89foAooQ.jpeg" /><figcaption>Red Fort, New Delhi, 2018</figcaption></figure><h3>Introduction</h3><p>The story typically goes like this: You discover the BigQuery’s schema auto-detection functionality. Elated by the fact that you no longer need to define your BigQuery schema manually, you start migrating your workflow to use schema auto-detection. Everything works perfectly fine… until it doesn’t. New data that comes in are incompatible with existing tables. You re-read the documentation and realised that BigQuery only <a href="https://cloud.google.com/bigquery/docs/schema-detect#auto-detect"><em>selects a random file in the data source and scans up to the first 500 rows of data to use as a representative sample</em></a><em> </em>to infer the column type. Now you are wondering if you need to go back to specifying the schema manually to save yourself from reacting to such incidents that crops up unexpectedly.</p><p>If you are experiencing this, you are not alone. Our team has gone through the same motions during the initial days of using BigQuery. Due to design constraints, we don’t usually have the luxury of getting the schema of our source data directly. We normally work with microservices that serve us data in a JSON payload. Therefore, inferring the appropriate schema as we consume the data is the only way. Based on our requirements, we have created this handy library that generates a schema that is able to accommodate all data type present so that data could be loaded into the table without a hitch.</p><h3>Library in Action</h3><p>To illustrate the shortfall of BigQuery’s schema auto-detection, I have prepared this sample data:</p><pre><a href="https://gist.github.com/zshaoz/7894bdfce040a217a56300b00cf84b1c">https://gist.github.com/zshaoz/835741ad5de0dd0aae748133bfb47774</a></pre><p>The sample data consist of 49,999 records of whose columns have the same data type, with 1 record having a different data type (see last line).</p><p><strong>Using </strong><strong>bq load with autodetect enabled:</strong></p><pre>bq load --autodetect --source_format=NEWLINE_DELIMITED_JSON test_dataset.dummy_table sample_data_1.json</pre><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWlewCRbCDMYx92zQX4WLw.png" /><figcaption>Running `bq load` with ` — autodetect` enabled</figcaption></figure><p>The auto-detection mechanism fails to take into account that one record with a differing data type. So, the sample data fails to load.</p><p><strong>Using our own library, </strong><strong>bq-schema-generator:</strong></p><p>First, load the sample data, then generate the BigQuery schema:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75ccaa07713debe552f39571523ef636/href">https://medium.com/media/75ccaa07713debe552f39571523ef636/href</a></iframe><p>Inspect the generated schema file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66b8d9a397e074ad942156334a743168/href">https://medium.com/media/66b8d9a397e074ad942156334a743168/href</a></iframe><p>As you can see, the schema generator takes into account that one record that have a different data type and pick a column type that is able to handle both data types. For the column &quot;int_mix_float&quot; , column type FLOAT is chosen so that it can store both integer and float values.</p><p>Then, run bq load with the generated schema:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DYPyiXxaLrgT3zqGQJkWw.png" /></figure><p>Success!</p><p>On top of that, the library is able to recursively parse data that have deeply nested fields, e.g. data that has a list of dictionaries inside a list of dictionaries. This has really saved us the nightmare of manually specifying them one by one!</p><h3>Sharing is Caring</h3><p>We have made the <a href="https://github.com/team99/bq-schema-generator">library</a> public for everyone to use. Feel free to fork it or suggest any improvements.</p><p>Note: This library is still in its nascent stage. Since it is created according to our own requirements, there may still be some use cases that we might not cover. Here are some caveats:</p><ul><li>Columns with only integer values only are always defaulted to float since we are always anticipating future numeric values which could be a float</li><li>Columns with boolean and float values will be defaulted to boolean. Ideally, they should be defaulted to string.</li></ul><p><em>P.S. Credits also goes to Goh Jia Wei and Daryl Lim for contributing to this project.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a5f1a1f67" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/bigquerys-schema-auto-detection-does-not-work-perfectly-like-we-want-it-to-so-we-build-our-own-93a5f1a1f67">BigQuery’s schema auto-detection does not work perfectly like we want it to, so we build our own.</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why did we change our iOS rule to allow using Storyboard?]]></title>
            <link>https://medium.com/99dotco/why-did-we-change-our-ios-rule-to-allow-using-storyboard-45cb48d024?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/45cb48d024</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Sungwook (Shawn) Baek]]></dc:creator>
            <pubDate>Mon, 07 Nov 2022 06:31:40 GMT</pubDate>
            <atom:updated>2022-11-11T09:40:35.897Z</atom:updated>
            <content:encoded><![CDATA[<p>Our UI creation rule was creating a UI programmatically. But recently, we changed it.</p><p>Now our iOS team can create UI depending on their preferred approaches.</p><p>The reason is that there are really good things if you use Storyboard</p><ul><li>Less Code</li><li>Compile Time</li><li>Preview</li><li>Layout warnings</li></ul><p>Among them, the main reason for making a decision is <strong>Compile time</strong>.</p><h3>Compile Time: Swift vs Storyboard</h3><p>Imagine if you need to change the spacing in UIStackView.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePqFvQNf3TEP7fEMA-S-jA.png" /></figure><p>The left one is programmatic UI. If you change just one line of code then the swift compiler detects source file changes and will compile it. It may take more time if the source file dependent on other source files.</p><p>The right one is used Storyboard. If you change the spacing in StackView on Storyboard then ibtool compile a storyboard into the multiple nibs(stands for NextStep Interface Build file) at compile time.</p><p>Results: Storyboard compile-time <strong>6.5x faster</strong> than Swift</p><ul><li>Swift: 46.8 seconds</li><li>Storyboard: 7.2 seconds</li></ul><p>As you can see from the results, compile-time when using the storyboard is much faster than swift file changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4dwt-feEX5Kcczlqg904g.png" /><figcaption>WWDC2018, Behind the Scenes of the Xcode Build Process</figcaption></figure><p>If you want to know ibtool’s compile options then check <strong>man ibtool</strong> in <strong>/Applications/Xcode.app/Contents/Developer/usr/bin</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K8SEX-gBCwEKXD36yoI_rQ.png" /><figcaption>/Applications/Xcode.app/Contents/Developer/usr/bin/</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iwRVmsXSf12bvCneYenIPg.png" /><figcaption>You can check the Interface Builder document.</figcaption></figure><p>Although there were pros we’ve had some concerns about using Storyboard like below</p><ul><li>PR Review</li><li>Conflicts Storyboard/Xib files</li></ul><p>To address these concerns, we need to know about the xib(stands for XML Interface Builder) format.</p><h3>xib format</h3><p>Storyboard/Xib is a XML format. It means that <strong>Human Readable format</strong>. I sometimes heard that from iOS Engineers Storyboard/Xib files are hard to review. It’s true compared to reviewing swift code.</p><p>But once familiar with that format You may feel It is easy to review it. Because It looks like HTML format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoMijYn5Pp69XifThUechA.png" /><figcaption>The storyboard is an XML document.</figcaption></figure><p>The numbers above the image mean like below</p><ol><li>toolVersion</li></ol><p>It means Interface builder tool’s version. It may be changed when you update Xcode. I highly recommend all team members use the latest Xcode version to avoid merge conflicts.</p><p>2. initialViewController</p><p>It indicates the initial view controller’s object id in Storyboard. So If you called an <a href="https://developer.apple.com/documentation/uikit/uistoryboard/1616213-instantiateinitialviewcontroller">instantiateInitialViewController()</a> then It returns that viewController.</p><p>3. device</p><p>You can use it to preview the layout on Storyboard. Anyone can change it but after checking the layout then I recommend resetting it as your team’s default device (e.g. iPhone X) to avoid merge conflicts.</p><p>4. scenes</p><p>A storyboard can have multiple scenes. A Scene has a ViewController.</p><p>5. segue</p><p>segue is a connection between ViewControllers. It has an id and a destination’s id. If the destination’s id has changed then we need to review it carefully. If there is no ViewController that has the destination’s id then It might be caused a crash at runtime.</p><h3>PR review</h3><p>I’ll show two examples.</p><ul><li>Minor changes</li><li>Major changes (e.g. Layout, objectId, segue, etc)</li></ul><p><strong>Minor Changes</strong></p><p>These changes normally don’t affect your UI. So You can easily review and approve it. It should be fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIqK9ieJNzpUi4zzgrmcAA.png" /></figure><ul><li>toolsVersion / plugin version can be changed automatically when you use a different Xcode version and edited the Interface Builder.</li><li>rect can be changed when you change the device or move a subview. These small changes should be fine because It uses autolayout.</li><li>propertyAccessControl(Locking View) is controlled by the developer. I’ll explain it next section.</li></ul><p><strong>Major Changes</strong></p><p>Major Changes will affect layout issues. I’ll show you some examples below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*79YhtHON9cB1Dh9zNAqNnQ.png" /><figcaption>Embedded in UIStackView</figcaption></figure><p>If you embedded labels in UIStackView then you have to double-check label’s id is in stackView or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8qKFsDfTr5tp_DHp_wlyw.png" /><figcaption>Layout Constraint Issue</figcaption></figure><p>An <strong>ambiguous=”YES”</strong> indicates us there is <strong>Layout Issue!</strong> So It should be fixed.</p><p><strong>Pull Request Template</strong></p><p>I highly recommend adding a screenshot of the layout in PR. To encourage your teammate to add a screenshot, set a <a href="https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository">Pull Request Template</a>.</p><p>It is our team’s template.</p><pre>Description<br>===<br><br>Screens<br>---<br><br>Links (JIRA / Confluence)<br>---<br><br>Related PR<br>---<br><br>Check Lists<br>---<br>- [x] multiple devices<br>- [x] confirmed by developer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JD7ixIiQ7WiqNLugnUVvQ.png" /><figcaption>Add a pull_request_template.md in .github/ path</figcaption></figure><h3>How to avoid merge conflicts?</h3><p>File changes cause merge conflicts. You can avoid it by dealing with file changes carefully.</p><p>By following this rule, merge conflicts are avoided as much as possible.</p><ul><li>use the latest Xcode.</li><li>don’t commit the changes if you are not working on that View</li><li>locking Views in Storyboard and XIB Files you are working on</li></ul><p>If your team is working on the same Storyboard, I highly recommend locking views to prevent unwanted changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GtIWZhrJ9LyUlTMkK_LuQ.png" /><figcaption>Show the Identity Inspector -&gt; Lock</figcaption></figure><p>You can set a lock on any UI Components(Whole Storyboard, UIViewController, UIView, Segue, any UI-related objects like a Constraint) you will be working on. As I mentioned above, <strong>propertyAccessControl</strong> will be added to the storyboard/xib file when you set a lock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZkY1LDnxtILJRUs-FXTLw.png" /><figcaption>UIViewController is locked</figcaption></figure><p>Lock Image will be shown when you try to change on Locking View.</p><h3>Conclusion</h3><p>There are cons and pros to using Storyboard/Xib. Productivity is also different depending on the iOS developer&#39;s preferred UI creation approach. But We made a decision to use both. Because we can save compile-time and found a good solution to resolve concerns for using it.</p><p>Also, It is a first-party tool. <a href="https://en.wikipedia.org/wiki/Interface_Builder">Apple has developed the IB tool over 34 years.</a> And <a href="https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes">It is being actively updated come with Xcode</a>.</p><ul><li>34 Years Ago<strong> </strong>In 1988, Interface Builder was released by Apple</li><li>15 Years Ago<strong> </strong>In 2007, XML Interface Builder was released by Apple</li><li>11 Years Ago<strong> </strong>In 2011, Storyboard was introduced at WWDC 2011</li></ul><p>I hope our decision helps you decide to use Storyboard/Xib in your team!</p><h3>References</h3><p><a href="https://developer.apple.com/documentation/xcode/locking-views-in-storyboard-and-xib-files">Locking Views in Storyboard and XIB Files</a></p><p><a href="https://developer.apple.com/videos/play/wwdc2015/215/">What’s New in Storyboards</a></p><p><a href="https://developer.apple.com/videos/play/wwdc2021/10196">Build interfaces with style</a></p><p><a href="https://developer.apple.com/videos/play/wwdc2015/407/">Implementing UI Designs in Interface Builder</a></p><p><a href="https://developer.apple.com/videos/play/wwdc2017/412/">Auto Layout Techniques in Interface Builder</a></p><p><a href="https://developer.apple.com/videos/play/wwdc2018/415/">Behind the Scenes of the Xcode Build Process</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45cb48d024" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/why-did-we-change-our-ios-rule-to-allow-using-storyboard-45cb48d024">Why did we change our iOS rule to allow using Storyboard?</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mobile App Development: Kotlin Multiplatform Mobile]]></title>
            <link>https://medium.com/99dotco/mobile-app-development-kotlin-multiplatform-mobile-4e76c7f7a9e7?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/4e76c7f7a9e7</guid>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Akqeel]]></dc:creator>
            <pubDate>Mon, 31 Oct 2022 05:30:20 GMT</pubDate>
            <atom:updated>2022-10-31T05:30:20.491Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Kotlin Multiplatform Mobile (KMM) is a technology developed by JetBrains (<a href="https://www.jetbrains.com/">https://www.jetbrains.com/</a>) that enables mobile application developers to share business logic between iOS and Android apps from a single codebase. One of the key differences KMM brings to the cross-platform development world is its ability to compile to native code.</p><p>This has several advantages:</p><ul><li>Developers can expect native level performance while leveraging cross-platform capabilities.</li><li>It allows developers to extend on the frameworks and libraries that they know and love without having to move or learn a new framework.</li><li>Current teams with existing large scale projects can do a gradual migration without having to worry about rewriting their entire codebase.</li></ul><p>These benefits in turn can result in faster development cycles since teams can just write and test a single codebase. It can also help free up some of the team resources to focus more on improving user experience, writing documentation, writing unit tests and so on.</p><p>KMM recently went into Beta (<a href="https://blog.jetbrains.com/kotlin/2022/10/kmm-beta/">https://blog.jetbrains.com/kotlin/2022/10/kmm-beta/</a>) and I spent a couple of hours giving it a try! In this article I thought of sharing my learnings. If you are interested in trying out KMM or curious to know how it works, I hope this article can be of use to you.</p><h3>Getting started</h3><p>The getting started guide for KMM from JetBrains can be found here: <a href="https://kotlinlang.org/docs/multiplatform-mobile-getting-started.html">https://kotlinlang.org/docs/multiplatform-mobile-getting-started.html</a></p><h4><strong>Steps</strong></h4><ol><li>Installing Android Studio and Xcode</li><li>Install the Kotlin Multiplatform Mobile plugin on Android Studio</li><li>Install kdoctor(<a href="https://github.com/Kotlin/kdoctor">https://github.com/Kotlin/kdoctor</a>)</li><li>Run kdoctor and resolve any errors. I was running an unsupported version of Ruby on my machine. To update my Ruby version I used rbenv(<a href="https://github.com/rbenv/rbenv">https://github.com/rbenv/rbenv</a>)</li></ol><p>Once your environment is setup correctly, you should see the below status when you run `kdoctor` from your command line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqZJ47cuFLY541kz" /></figure><h3>Creating the cross-platform app</h3><p>The next step is to create our cross platform project. The guide for creating a new KMM project can be found here: <a href="https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html#create-the-project-from-a-template">https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html#create-the-project-from-a-template</a></p><p>Once the project is setup, you would see three modules under the Project view on Android Studio:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRatQOQO6TuV6jNvE7mchw.png" /></figure><ul><li><strong>androidApp</strong>: This is the Android application module and contains the entry point to your android application.</li><li><strong>iosApp</strong>: This is the iOS project and can be opened from Xcode.</li><li><strong>shared</strong>: This module contains the shared code. The code in this module compiles to an android library (which is declared in the androidApp/build.gradle dependencies) and an iOS framework dependency which is imported into the iOS project.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSSIUIqsp4-mT3tj" /><figcaption><em>Source: </em><a href="https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html#examine-the-project-structure"><em>https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html#examine-the-project-structure</em></a></figcaption></figure><h3>Running the application</h3><p>Now that you have your base project setup, you can go ahead and run your iOS and android applications. <a href="https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html#run-your-application">https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html#run-your-application</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*taJ5tNtrYafaWy2rkhtkMw.png" /></figure><h3>Implementation Details</h3><p>The shared module contains three Gradle source sets (excluding the test source sets)</p><ol><li>androidMain</li><li>iosMain</li><li>commonMain</li></ol><ul><li>The commonMain source set defines two classes: Platform and Greeting.</li><li>The Platform class in this source set defines one expect function: getPlatform.</li><li>The expect keyword is used to declare functions that require platform specific implementation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cWJqCcpMzADaOV6R" /><figcaption>commonMain/Platform.kt</figcaption></figure><p>The androidMain and iosMain source sets extend the Platform class from the commonMain source set and implement the getPlatform function as actual functions with platform specific details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L4sGy9WY33WAdhw8" /><figcaption>androidMain/Platform.kt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6ZlhQLlpvsr1FBdN" /><figcaption>iosMain/Platform.kt</figcaption></figure><h3>User interfaces</h3><p>The user interface for Android is written in Jetpack Compose (<a href="https://developer.android.com/jetpack/compose">https://developer.android.com/jetpack/compose</a>) and for iOS in Swift UI (<a href="https://developer.apple.com/xcode/swiftui/">https://developer.apple.com/xcode/swiftui/</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hPUUPqYk0uv1NojH" /><figcaption>androidApp/MainActivity.kt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yXs7rlBTVpWD867m" /><figcaption>iosApp/ContentView.swift</figcaption></figure><p>That’s it! It only took me a couple of hours to understand and set up this KMM project. If you are interested to learn more about the implementation details, you can find the repository for this project here: <a href="https://github.com/akqeel/KMM-Tutorial">https://github.com/akqeel/KMM-Tutorial</a></p><p>I hope you found this article useful. If you have any suggestions please do share in the comments section below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e76c7f7a9e7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/mobile-app-development-kotlin-multiplatform-mobile-4e76c7f7a9e7">Mobile App Development: Kotlin Multiplatform Mobile</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Evolution of Transformation Layer Architecture in 99 Group (DBT, Airflow and Kubernetes)]]></title>
            <link>https://medium.com/99dotco/the-evolution-of-transformation-layer-architecture-in-99-group-dbt-airflow-and-kubernetes-cb46900f3662?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/cb46900f3662</guid>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Andy Yan]]></dc:creator>
            <pubDate>Fri, 22 Jul 2022 10:10:20 GMT</pubDate>
            <atom:updated>2022-07-23T10:21:46.642Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Requires some basic understanding on Airflow, DBT (data build tool) and Kubernetes. If you are deploying Airflow on a Kubernetes cluster, and are looking for ways to integrate DBT into Airflow, this article might provide you with some inspirations.</em></p><p>In our last <a href="https://medium.com/99dotco/modernizing-the-data-engineering-stack-in-99-group-579aa5eb5246">article</a>, it was briefly shared how we have integrated DBT into Airflow, which is deployed through a Kubernetes engine. Our transformation layer has since evolved to be one that is more robust and scalable. This article will be documenting the journey of how we initially arrived at the first design, one that is based on a <strong>RPC Server </strong>set-up<strong>,</strong> to the current one, which is based on using <strong>KubernetesPodOperators.</strong></p><h3>Part 1 — The RPC Server Set-Up</h3><p>The folks from Astronomer gave us some pretty good ideas on how can we go about setting up the integration between DBT and Airflow. Our initial design was heavily inspired from this <a href="https://www.astronomer.io/blog/airflow-dbt-1">article</a> by them. Like what was recommended in the article, we have a CI/CD process set up that generates a new manifest.json file upon each new commit on the main branch. The Airflow instance then subsequently reads the manifest.json file, creating a DAG per model, which also takes care of running the upstream models. However, there are a few things that we think could be improved on:</p><ul><li>The DBT models might have to sit together with the Airflow instance for Airflow to access them and perform dbt run on them. Assuming that an Airflow repository already exist, the DBT related files might have to sit in the same repository. This might make the repository bloated, and analytics engineers might find it difficult to maintain the DBT related components.</li><li>It’s technically possible to create a different repository for storing the DBT models, and have the Airflow instance to simply just read from the directory where the DBT models are stored. In a Kubernetes set up, this could mean additional complexities in the form of setting up a shared volume, and have all the DBT models copied over for every new updates.</li><li>Furthermore, with the variety workload we are deploying on Airflow, there are just more and more libraries being installed in the same Airflow instance. We wanted to keep the libraries lean to avoid conflicts and messy dependency issues.</li></ul><p>While seeking solutions to address the concerns, we discovered that DBT provides us with a plugin to run a RPC Server right out of the box that could help. According to DBT, “<em>this server compiles and runs queries in the context of a dbt project. Additionally, the RPC server provides methods that enable you to list and terminate running processes.”. </em>Essentially, this means that once we have the server set up, instead of having the DBT models sit with the Airflow repository, we could just:</p><ul><li>Submit a request to the RPC server (which already has the project’s context) to run a DBT command</li><li>Poll the status of the submitted job</li><li>When the job is done, parse the response and decide what to do based on the final status</li></ul><p>So, for every task node generated from parsing manifest.json, instead of using a BashOperator to execute dbt run , we would use a PythonOperator that executes a function that fulfils these basic steps.</p><p>With the DBT repository being decoupled from the Airflow repository, now the overall deployment looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*vPjgbZ3UZEb3xfk6IF0Q8g.png" /></figure><p>And for every DBT task, the PythonOperator runs the following function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9594fa7f999a1f61675be4a913f3e98/href">https://medium.com/media/d9594fa7f999a1f61675be4a913f3e98/href</a></iframe><p>The following chart further breaks down what happens when Airflow runs a DBT task for a particular model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kQzVS_CErq4Rm2xegU3Ejg.png" /></figure><ol><li>Airflow scheduler spawns a pod to run a DBT task</li><li>The pod makes a request to the RPC server, specifying the command that it wants to run</li><li>RPC server receives the request, then starts a job to run the command</li><li>The pod receives a response with a job ID</li><li>The pod use the job ID to make requests to the RPC Server continuously to check on the status of the job</li><li>The job is still running</li><li>RPC Server responded that the job is still running</li><li>The pod makes another request to check on the status of the job</li><li>Eventually, job is done or failed</li><li>The pod will receive a response saying the job is done or failed. The Airflow task will be marked successful or failed accordingly.</li></ol><p>With this design, we managed to decouple our DBT repository from the Airflow repository. Analytics Engineers can work the DBT repository without concerning themselves on how to run these models on production. Data Engineers can work with a leaner repository and avoid any potential issues of conflicting libraries.</p><h3>Part 2 — The KubernetesPodOperator Set-Up</h3><p>The RPC server was able to serve its purpose for a while. However, when we added more models and ran them more frequently, the weakness of this set up was starting to show. Since the RPC server was deployed with fixed resources, it was not able to scale itself up when there were more requests coming in. To make matters worse, there were no queue system built into the RPC server to handle the incoming load of requests. Tasks took longer to complete. Tasks that took too long to respond was marked as ‘failed’, and Airflow triggered a retry, which piled onto the existing jobs. The overall performance of this transformation system degraded significantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*NeCc18-lbl_egFfLb0DkfA.png" /></figure><p>As we can see, the RPC server set-up is actually an <strong>anti-pattern</strong> to the rest of the system built in the Kubernetes cluster. When Airflow was running more and more tasks, more pods were being spawned, and the cluster was able to scale up the resources to meet the demands from these pods. Conversely, the RPC server had to work with its fixed resources and try to run all of the models being requested. We tried to work around the problem by giving the RPC server more resources, but it was not scalable. The added resources often could not keep up with the increasing number of DBT models that were added overtime. During downtime, the RPC server just hoards the resources without running any jobs, which translates into higher server costs.</p><p>It is technically possible to try to scale up the number of instances of RPC server during period of high demands. However, since the pod that triggers the job in the RPC server has to poll from the same RPC server instance with the given ‘request_token’, a mechanism to route the requests back to the same RPC server had to be implemented. With this added complexity, our team decided that it was not worthwhile to further pursue this design.</p><p>At this juncture, the team has been experimenting with KubernetesPodOperator for pipelines that cannot be readily built with the default operators. We found that one advantage of using the KubernetesPodOperator is that the libraries specific to the workload is only contained within the image, and Airflow is simply the orchestrator that triggers the job, which in turn spawn the Pod to run the workload on the cluster. We could specify the resources we want for that Pod, along with any variables and configurations. It is an elegant abstraction that allows us to run any jobs we want.</p><p>So, we figured we could use the KubernetesPodOperator to run the DBT tasks instead. For each model node from parsing the manifest.json file, instead of a PythonOperator that makes requests to the RPC Server and waits for a response, it could be a KubernetesPodOperator that pulls the DBT repository image, and specify a custom command to run that specific model.</p><p>Here’s the code snippet that illustrates the task created on every node from parsing the manifest.json file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65a4579388d9d4759c4cca545b3c5337/href">https://medium.com/media/65a4579388d9d4759c4cca545b3c5337/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*q65atnlLUqAdkZuO497Zng.png" /><figcaption>Using KubernetesPodOperator to run DBT tasks</figcaption></figure><ol><li>Scheduler spawns a pod to run the DBT task (simplified)</li><li>The task pulls the latest DBT repository image</li><li>The task then runs a custom command specific to a model</li></ol><p>In this case, if sufficient nodes are allocated to the cluster, when there is a high number active DBT tasks, the cluster will just scale up the number of nodes to handle the incoming workload. Unlike the previous iteration, resources are now dynamically provisioned.</p><h3>Conclusion</h3><p>The current set-up meets all our requirements that we intended for our transformation layer. It is highly scalable and stable. Teams can work on smaller codebases and they are easier to be maintained. We have since increase our workload multiple fold and the system could handle them without a hitch.</p><p><em>At 99 Group, we are always looking out for improvements and suggestions. If you share similar objectives or have done similar setup, please reach out to share your experiences!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb46900f3662" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/the-evolution-of-transformation-layer-architecture-in-99-group-dbt-airflow-and-kubernetes-cb46900f3662">The Evolution of Transformation Layer Architecture in 99 Group (DBT, Airflow and Kubernetes)</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adaptive to responsive in 1 React Hook!]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/99dotco/adaptive-to-responsive-in-1-react-hook-4d1ce93e1488?source=rss----affe4d81af67---4"><img src="https://cdn-images-1.medium.com/max/1884/1*Rpa-kfNoxjm9fS9MuodBjg.png" width="1884"></a></p><p class="medium-feed-snippet">Using a performance-optimized React Hook to convert legacy adaptive layouts to modern responsive ones.</p><p class="medium-feed-link"><a href="https://medium.com/99dotco/adaptive-to-responsive-in-1-react-hook-4d1ce93e1488?source=rss----affe4d81af67---4">Continue reading on 99.co »</a></p></div>]]></description>
            <link>https://medium.com/99dotco/adaptive-to-responsive-in-1-react-hook-4d1ce93e1488?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/4d1ce93e1488</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[99co]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Loh Jian Rong]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 02:43:52 GMT</pubDate>
            <atom:updated>2022-07-20T02:43:51.991Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How we setup an A/B test to study the best user experience for our users]]></title>
            <link>https://medium.com/99dotco/how-we-setup-an-a-b-test-to-study-the-best-user-experience-for-our-users-fa6411c59ba5?source=rss----affe4d81af67---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa6411c59ba5</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ab-testing-software]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Akqeel]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 02:42:24 GMT</pubDate>
            <atom:updated>2022-07-20T02:42:24.572Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide on how to setup A/B tests on Android to help improve user experience</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3BZyj1BTCmjpdbwJWlUbQ.jpeg" /></figure><h4><strong>Background</strong></h4><p>Our team was tasked with improving the shortlist experience for our users in the app’s listing details page. This feature is similar to the “Favourites” function we would generally find on e-commerce applications. The existing shortlisting function on the app had a few problems and user behaviours our team had discovered via user research, and this was an opportunity to help address these issues. One of these problems was the visibility of the shortlist CTA in the listing details page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xr3SH-3X0XCnL4ry78TApg.png" /><figcaption>Listing Details Page</figcaption></figure><p>As seen in the screenshot above, there is a possibility of the shortlist CTA “blending” in with the listing photo, thus reducing its visibility. The hypothesis our team wanted to test out for this experiment was whether the lack of visibility of the current shortlist CTA prevented users from being able to shortlist their favourite listings — and would increasing this CTA visibility help improve the shortlisting experience.</p><h4><strong>Processes and Team Structure</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUAJrPYbO1s_lUAzLi6vnQ.png" /></figure><p>With the interest of time in mind, our team took the approach of implementing the test on one mobile platform (Android) and implementing the result on the other platforms (iOS). However, one drawback of this approach is that the user behaviour on iOS can differ from Android, but in this case it works out because we don’t see a big difference in iOS vs Android users’ behaviour. But this is something we would need to be mindful of when conducting future experiments.</p><p>In this guide I will walk through our team’s approach on setting up and running the experiment on Android, but the approach for setting up and conducting experiments on iOS would be very much similar. For this project we had help from our PM, designer, user researcher, data analyst, android engineer and QA on the team with setting up and conducting the experiment.</p><h4><strong>Tooling 🛠</strong></h4><p>For our experiments our team decided to use the <a href="https://firebase.google.com/docs/remote-config">Remote Config</a> and <a href="https://firebase.google.com/docs/ab-testing">A/B Testing</a> tools available on Firebase, and <a href="https://segment.com/">Segment</a> for tracking the shortlist CTA usage.</p><h4><strong>Implementation 💻</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H16toGLosWuC6_v0x3ysjA.png" /><figcaption>Shortlist CTA variants</figcaption></figure><p>For our shortlist experiment, our team came up with 3 different variants. The Control (or Baseline) variant is our existing shortlist CTA implementation, while version B and version C are new designs to be implemented. The approach we took to implement this feature was to:</p><ol><li>First define the metrics for this experiment.</li><li>Implement the two new variants on android.</li><li>Setup firebase remote config to control the visibility for the three different variants.</li><li>And finally setup the A/B testing experiment on firebase.</li></ol><p>For each step we had a subprocess which I will go through next.</p><p><strong>1. Defining the metrics</strong></p><p>Before setting up the experiment, our team first needed to identify the metrics we’d need in order to accurately measure the performance of this experiment. Our team identified two metrics, one primary and one secondary. The primary metric we identified was the shortlist CTA usage, and the secondary metric was the number of enquiries on this page. The primary metric would help us to measure if the change in the shortlist CTA layout has been effective, while the secondary metric will help us to identify if the increase in the number of shortlists negatively impacts the number of enquiries. Once this was finalised, the next step was for us to begin work on implementing the new variants.</p><p><strong>2. Implementing the new variants</strong></p><p>Since the Baseline variant is the existing CTA implementation, only the two new variants (version B and version C) needed to be implemented. Before beginning the implementation for the new variant, I set up the high level functions which control the visibility of the different variants and the control flow. This helped me to better organise the codebase, simplify testing, as well as avoid the situation where multiple variants become visible simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WH7yqlmYJBvm-WJs2p089A.png" /><figcaption><strong><em>Default state</em></strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHEG7RqQhFHhgPtAMqHp2g.png" /><figcaption><strong>Scrolled state</strong></figcaption></figure><p>Once this was setup, I began the UI implementation for variant B and setting up the logic for the click events. We follow the MVVM architecture in our project, thus the business logic for all three variants can be reused with the only change needed on the UI. This helps us to cut down on implementation time by ~3 times, as well as simplifies testing and bug fixes.</p><p><strong>3. Setting up Firebase Remote Config</strong></p><p>To further speed up things, our team decided to test out the UI and business logic for version B while version C was in development. To achieve this, I added a new key-value pair on Firebase Remote Config which could be used to control the variant version for shortlist in the listing details page, and set the condition for this new key-value pair to be applicable only for the dev version of our application. Once this was setup, both the QA and designer on our team were able to test out this variant, and toggle between the Baseline and Version B variants by switching the values on Firebase Remote Config.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*rLAVGB42gNGSxfgevMk_bg.png" /><figcaption><strong>Firebase Remote Config</strong></figcaption></figure><p>After a few rounds of QA and with feedback from both our QA and designer, version B was ready to ship! We followed a similar approach for version C, and once it passed both design and functional QA our feature was ready to be rolled out to production 🚀</p><p><strong>4. Setting up the experiment on Firebase A/B Testing</strong></p><p>Once the android app update is submitted to Google Play Store, there is a review process which takes a few hours before the update is available for download. Meanwhile, we set up the experiment on Firebase A/B testing and switched our Remote Config key-value pair to the app’s production version. Now with all this setup, Firebase would deliver one of the three variant versions to our users on the new app update and Firebase A/B testing would start measuring the performance of the CTAs for each of these variants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIqQvIXQrvK8vOCYkc3yFQ.png" /><figcaption><strong>Setting up Firebase A/B Testing (Remote Config experiment)</strong></figcaption></figure><h4><strong>Experiment Duration and Results 🔬</strong></h4><p>Our team decided that around 1–2 weeks would be an acceptable duration to conduct this experiment, and we can use the results from the experiment once this duration has elapsed. Firebase A/B Testing would continuously measure and update the winning variant for this experiment for the duration passed up to that point in time. Once the total duration the team decided for this experiment has passed, or if Firebase A/B testing has found a clear winner (whichever comes first), our team could then rollout this winning variant to all our users (including our users on iOS!) 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*Oz719xDlAVPRoJSWyACRYA.png" /></figure><h4>Learnings and further improvements 📝</h4><p>This was the first A/B testing experiment our current team has conducted, and we had quite a few learnings ranging from how to set up the tooling, to coming up with the processes. We needed input and feedback from different stakeholders including our PM, designer, user researcher, data analyst, developer and QA and the processes we followed had been very helpful in making this a fun and valuable exercise. We hope to conduct more experiments in the near future with the aim of providing a seamless user experience to our users!</p><p><em>Thanks to Jessica Bodo, Curtis Koh, Charlotte Lee, Kevin Wee, Aldryn Deschara Putra and Tsu Myat Thandar Htike for helping setup and run this experiment!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa6411c59ba5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/99dotco/how-we-setup-an-a-b-test-to-study-the-best-user-experience-for-our-users-fa6411c59ba5">How we setup an A/B test to study the best user experience for our users</a> was originally published in <a href="https://medium.com/99dotco">99.co</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>