<?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[randstad tech &amp; touch - Medium]]></title>
        <description><![CDATA[Randstad Groep Nederland’s internal IT department shares their projects, wins and learns. What goes on behind the scenes of the tech department that keeps the world’s largest HR service provider running? - Medium]]></description>
        <link>https://medium.com/rgn-it?source=rss----acc1d5dae10---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>randstad tech &amp;amp; touch - Medium</title>
            <link>https://medium.com/rgn-it?source=rss----acc1d5dae10---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:07:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/rgn-it" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Redesigning the global navigation: The case of the randstad.nl website]]></title>
            <link>https://medium.com/rgn-it/redesigning-the-global-navigation-the-case-of-the-randstad-nl-website-84d2fc7ba53f?source=rss----acc1d5dae10---4</link>
            <guid isPermaLink="false">https://medium.com/p/84d2fc7ba53f</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ux-case-study]]></category>
            <category><![CDATA[ux-design]]></category>
            <dc:creator><![CDATA[Randstad Groep Nederland IT]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 12:57:14 GMT</pubDate>
            <atom:updated>2023-06-01T12:57:08.587Z</atom:updated>
            <content:encoded><![CDATA[<p>by <a href="https://www.linkedin.com/in/annamessini/">Anna Messini</a>, senior UX designer at Randstad Groep Nederland</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vVRlB48gnQubrQyr" /></figure><p>It all started with this simple question: Can we add more links to the menu?</p><p>This came from the SEO manager that wanted to experiment with more links in the menu to achieve better search engine ranking.</p><p>It sounds like a straightforward request but it is an excellent example of a simple question that can trigger an extensive redesign that impacts how users experience a website. It can also lead to many discussions requiring business decisions so brace yourself for the ride.</p><p>In this article, I will explain what are the steps you can follow to redesign an existing feature and how I ended up choosing a design direction that does not look at first glance as the user’s first choice but makes sense as a business decision.</p><p>More specifically I am going to lay out:</p><ul><li>What is global navigation, aka the main menu, and why it is important.</li><li>What is the failsafe process you can follow to redesign an existing feature and what were my challenges on each step.</li><li>What is information architecture, how it is connected to global navigation and how we redesigned it.</li><li>What you can do as next steps once a new feature is released.</li></ul><h3><strong>Global navigation</strong></h3><p>But first things first, what is global navigation?</p><p>A global navigation is a region of the user interface that appears consistently on all the pages and is reserved for buttons, links, search bars, or any other design element affording movement from one set of content to another.[1] It is the main way to tell your users what the site is about– no matter where they came from, and can provide a glimpse of the site information hierarchy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t2Tef65rdpQVvzww" /><figcaption><em>Randstad.nl global navigation</em></figcaption></figure><p>It is well established that users are so impatient on the internet that they don’t take time to learn about any individual website and its information hierarchy. They are incredibly task-driven and get frustrated fast if they don’t find what they are looking for. These frustrations often result in them proceeding to the next site. [2]</p><p>This highlights the importance of striving for a well-designed global navigation with an information hierarchy that makes sense to the user.</p><h3><strong>The process</strong></h3><p>The global navigation was redesigned following the double diamond approach. This widely known framework takes you from a problem to a solution following the steps of <strong>discovery</strong>, <strong>definition</strong>, <strong>exploration</strong> and <strong>execution</strong>. [3]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lpps90oXkVBroQGP" /></figure><h3><strong>Discovery: Why are we doing this?</strong></h3><p>The first step was to build a shared understanding on the why of this initiative and scope it. I did this by speaking with the stakeholders and gathering their thoughts and wishes. I spoke with stakeholders from all the teams that would be affected representing business tech and design. I also reviewed past user research we had done on navigation in both web and mobile apps to get the user’s perspective.</p><p>Challenge:</p><p>This part of the road is tricky, you need to gather all the information impartially and not give more weight to one opinion over another. Be critical of the input. In the end you need to filter out the important bits you will focus on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HPBM2vnnsoJCBrfK" /></figure><p>I continued with a deconstruction of the current menu, which was a legacy design from our last rebranding. I examined how it worked, the design decisions behind it and compared it with navigations from both competitors as well as the other labels within the Randstad company.</p><h3><strong>Definition: what is wrong with our current global navigation</strong></h3><p>The key pain points and opportunities for improvement I discovered came down to: scalability, usability and accessibility, mobile navigation, inconsistency and inefficiency. But let me elaborate on these to give some clarity.</p><h4><strong>Scalability &amp; SEO optimisation</strong></h4><p>We needed to <strong>improve our search engine ranking</strong> and get more page visits.</p><p>The global navigation was not scalable. There was a finite amount of menu items that fit under the primary sections in the top navigation bar.</p><p><em>Opportunity</em><strong><br></strong>We can create a <strong>scalable design</strong> with more space for links</p><h4><strong>Usability and accessibility</strong></h4><p>We had interaction problems like accidentally triggering the hover effect of the section next to the one you were exploring and thus challenging the user’s motor skills. Moreover, the global navigation changes colour to match the header colour of the page and this presents some accessibility issues due to the fact that the colour contrast between text and background was not always strong enough.</p><p><em>Opportunity</em><strong><em><br></em></strong>We can <strong>improve the usabilit</strong>y by having more space the user can navigate in and <strong>introducing delays</strong> so that the user does not accidentally trigger hover effects without wanting to. We can improve legibility by presenting all the navigation options on a light background with dark blue typography regardless of the page header background, thus <strong>increasing the colour contrast.</strong></p><h4><strong>Mobile navigation</strong></h4><p>The mobile navigation design was a list of collapsible links that the user needed to click through to discover the second layer of navigation. We already knew that the users preferred to see what their options were in one glance even though it meant scrolling more on mobile. On top of that the logged in environment navigation worked differently than the public one.</p><p><em>Opportunity<br></em>We can create a design that gives a better overview of the options available and is consistent in both logged in and public environments.</p><h4><strong>Non consistent user experience</strong></h4><p>Not all links from the public environment were available in the logged-in environment.</p><p><em>Opportunity</em><br>We can improve the information architecture and introduce more links in the logged in environment that are relevant to the users which they could not access before unless they logged out.</p><h4><strong>Efficiency</strong></h4><p>We had two different implementations of the global navigation and two teams maintaining it.</p><p><em>Opportunity</em><strong><br></strong>We can build one solution that is going to be used for both public and logged in domains. This way we will not need two product teams maintaining it and we can have more control of the feature and the content displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S4UfPj_TJ93O14Eo" /></figure><p><strong><em>Challenge: </em></strong>At this point of the journey you have your foot firmly on the gas and want to tackle all the pain points. Take a step back and evaluate, what is the value versus effort for these. Be transparent by sharing the information you gathered with your stakeholders. Decide together on priorities. What is a must have and what is nice to have?</p><h3><strong>Explore: Design exploration and testing time</strong></h3><p>After several office-chair yoga sessions, cups of coffee and creativity-inducing lunch walks where I contemplated what I knew up to this point, I started sketching and settled on two directions: a split navigation solution and an all-inclusive top navigation solution. The first solution groups the logged-in environment links in a sidebar while placing public content links in the top bar. The sidebar was only visible once the user accessed the logged-in environment. In the second version both logged-in and public domain content was placed in the top navigation and was accessible through a big drop down. Both solutions answered the set of requirements so it was up to the users to decide which worked best for them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xgSia1btsycqjoLW" /><figcaption><em>Split top and side navigation</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mZjc9CMu2x4KkzHJ" /><figcaption><em>Top navigation only</em></figcaption></figure><p><em>Challenge</em>: It is easy to get carried away with experimental designs and solutions at this stage. Try to not reinvent the wheel. A global navigation is a very specific thing that utilises established UI patterns, use that to your advantage. The important thing is to come up with something that ticks your requirement boxes even if it does not feel super shiny and new.</p><h4><strong>Testing:</strong></h4><p>Brace for humility check: it is testing with users time.</p><p>For this project we did two consecutive user tests: One to define the design direction (split navigation versus only a top navigation) and another one to focus on the menu content structure.</p><p>During the tests, we asked participants to find where they could do a specific action such as filling in hours, finding interesting vacancies, finding a local Randstad office, updating their CV or finding the status of their applications.</p><p><strong>1st user test: Design direction key insights:</strong></p><ul><li>Users with an account expect to be logged in and see a difference between the logged-in environment and the public website</li><li>Speed and accuracy are most important when navigating</li><li>The consistency of the menu between app and web is important, because it creates a sense of familiarity.</li><li>The split menu received more positive feedback, and should be considered as the most favourable of the two menu options; important aspects being: clarity, speed and accuracy and similarity with the menu in the app</li></ul><p><em>Challenge:</em> From this test the conclusion at first glance was that the split menu was the users choice. What is interesting to note is that we did not choose to go that way rather we continued with the top navigation only design direction. And here is why:</p><p>Our user sample during the test consisted mostly of people who had a randstad account and some of them were using the mobile app for their administration. Their first action was to log in, hinting that they may only be interested in personalised content. Having a clear separation between logged in and logged out content, provided them with a list of navigational links that was relevant to them as logged in users. Which left us with the question, did the participants prefer the split menu because of the overview, or the separation of logged in and logged out information? On top of that the side menu resembled that app flyout menu look and feel which was familiar to them and they tended to prefer what they were used to.</p><p>Another aspect that led us to pursue the top navigation only solution was the value versus effort argument. Building a sidebar meant we needed to change the grid of the whole website which would have a huge impact on individual components and pages. This meant a lot of work which translates to cost in resources. The value we would get by this choice was not that great since both solutions seemed to work for the users and ticked the requirement boxes.</p><p><strong>2nd User test: menu content structure</strong></p><p>In this test the most notable differences between the two prototypes was the position of the ‘Mijn Randstad’ menu, and the account information. The key insights from this test were that:</p><ul><li>Some users could navigate the menu more easily than others, however, there was no reason to believe that the prototype menu would cause significant issues navigating for those who were not as proficient.</li><li>Users expected that they could log out in the first level</li><li>Users expected personalised content when logged in and they preferred to find it on top of the list in the global navigation.</li></ul><p><strong>Mobile navigation test</strong></p><p>The tests focused mostly on solving the desktop navigation. However, we did test the existing mobile navigation just to identify if there were any pain points.</p><p>We used a hamburger menu on mobile. The main advantage of the hamburger menu on mobile is that it can contain a fairly large number of navigation options in a tiny space and can also easily support submenus if needed; the disadvantage is that it is less discoverable, since, as the old adage says, “out of sight is out of mind.” [4] This has not been a problem that we have observed up to this point and users had no problem discovering and clicking the hamburger icon during research sessions.</p><h3><strong>The solution:</strong></h3><h4><strong>Desktop</strong></h4><p>The final solution is a big dropdown displaying the title of the section with big bold typography befitting the house style and a vertical list of links that can be clicked when a chevron is next to them and expand horizontally in the next column. This menu can potentially go four layers deep though we will constrain it to three lest it becomes too much of a maze for users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yD50xL21SUIW-frr" /></figure><p><em>Desktop navigation redesign</em></p><h4><strong>Mobile</strong></h4><p>We used insights from past research done on the Tempo-Team website to make some improvements in the mobile navigation. We observed that users preferred to have a better overview of what is available while scrolling a list instead of having to click through cascading links to reach the content they were looking for. Guided by this insight we chose to have the links visible up to the 2nd layer of navigation. If there is a third layer under the parent link then a chevron is displayed and the user needs to click on it to reveal the content of that layer.. We also chose to add a bottom sheet to help the users access the settings and account menu on mobile devices easier and save some scrolling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ra24CtpGuadobOF4" /></figure><p><em>Mobile navigation redesign</em></p><h4><strong>Information hierarchy</strong></h4><p>It should be evident by now that a significant aspect of improving your website’s navigation is the information you display and the order in which you display it. Information hierarchy and navigation are interconnected because it determines whether or not users are successful in finding desired information and completing tasks. You can build the perfect global navigation feature, with intuitive interaction and the cleanest code ever but if the information presented there is not structured in a way that makes sense to your users, they will ignore it and go elsewhere. Maybe even at your competitor’s website.</p><p><strong><em>Challenge</em></strong><em>: </em>There is a risk when defining the information hierarchy that can lead to a result that does not mirror the way users think. These problems with site information hierarchy can be tied to organisational structure or a company’s internal politics.[6]</p><ul><li>Content issues arise when different departments create content without being aware of each other and without following an overarching content strategy. This was one of our challenges as well.</li><li>Poor search results may stem from poor content-management systems, flawed or missing tagging of content, or a poor search tool.</li></ul><p>So in our case, once the layout and interaction was solved I set out to tackle the information hierarchy. The new menu has more space, it gives us the ability to go up to 3 or even 4 layers deep grouping links under different sections. We were now faced with the challenge of figuring out how to present all the information we have and how to group it under the primary and secondary sections.</p><p>I had a lot of talks and interactive sessions to address the best way to get more SEO value from our menu, take all stakeholder’s wishes under consideration and at the same time try not to compromise the user experience.</p><p>We did not base our final decisions only on gut feelings, requirements, and business wishes. There was already some past user research to start from. More specific past card sorting research sessions for the logged-in environment content and insights from the latest user tests of the new design. This combined with the collective knowledge and needs of the stakeholders involved led to the redesign of the information hierarchy for both logged-in and public environments.</p><h3><strong>Next steps: And now?</strong></h3><p>The new menu MVP is now live on the public and logged-in website and improvements are scheduled for the next sprints. We now have a global navigation where the hierarchy of the pages is visible. This menu reveals the content of our website and is scalable. The answer to the initial question has been given. We have gone above and beyond adding extra space for links to the menu. But is this the end of the ride?</p><p>The answer is no, we have released this new design but we now need to see how it performs. We are getting together with the experts to devise a plan on how to measure the performance from both SEO and usability perspectives.</p><p>We already see that people are clicking on the top navigation links and expect a landing page that is not there anymore so our next step is to design a solution for that. Any other red flags will be addressed in the future as we monitor the features performance through analytics and the improvement cycle will continue.</p><h3><strong>Concluding thoughts</strong></h3><p>We are now at the end of the ride and like every journey it left me with memories and learnings. It was a bumpy ride at times and took longer than I expected and here is what I learned.</p><ul><li>Take your time to do the whole process of discovery, definition, exploration and execution.</li><li>Don’t skip the discovery phase. Do not rush to the drawing board even if you feel pressure to deliver. When working on an impactful feature you need to make sure you are doing it right.</li><li>Be transparent with your stakeholders. Share the information and take them along with you by way of regular updates. Ask for their opinions and be critical of their feedback.</li><li>Ask the user what they think they are the ones who will use the feature.</li><li>There might come a time when you need to balance user needs with business requirements. This is the world we live in. Try to make the best of it by not compromising on the must haves you have defined.</li><li>Enjoy the process and learn from it.</li></ul><p><strong>Sources</strong></p><p><a href="https://www.interaction-design.org/literature/article/implement-global-navigation-to-improve-website-usability">https://www.interaction-design.org/literature/article/implement-global-navigation-to-improve-website-usability</a></p><p><a href="https://www.nngroup.com/articles/is-navigation-useful/">https://www.nngroup.com/articles/is-navigation-useful/</a></p><p><a href="https://en.wikipedia.org/wiki/Double_Diamond_(design_process_model)">https://en.wikipedia.org/wiki/Double_Diamond_(design_process_model)</a></p><p><a href="https://www.nngroup.com/articles/hamburger-menus/">https://www.nngroup.com/articles/hamburger-menus/</a></p><p><a href="https://www.nngroup.com/articles/mobile-navigation-patterns/">https://www.nngroup.com/articles/mobile-navigation-patterns/</a></p><p><a href="https://www.nngroup.com/articles/top-10-ia-mistakes/">https://www.nngroup.com/articles/top-10-ia-mistakes/</a></p><p><a href="https://uxdesign.cc/how-to-redesign-step-by-step-guide-869379604734">https://uxdesign.cc/how-to-redesign-step-by-step-guide-869379604734</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84d2fc7ba53f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rgn-it/redesigning-the-global-navigation-the-case-of-the-randstad-nl-website-84d2fc7ba53f">Redesigning the global navigation: The case of the randstad.nl website</a> was originally published in <a href="https://medium.com/rgn-it">randstad tech &amp; touch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating to Iceberg for a more efficient Data Lake]]></title>
            <link>https://medium.com/rgn-it/migrating-to-iceberg-for-a-more-efficient-data-lake-3ab4b07d31cd?source=rss----acc1d5dae10---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ab4b07d31cd</guid>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[trinos]]></category>
            <category><![CDATA[apache-hive]]></category>
            <category><![CDATA[apache-iceberg]]></category>
            <dc:creator><![CDATA[Kostas Pappas]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 13:28:34 GMT</pubDate>
            <atom:updated>2023-04-04T13:28:34.290Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*YwZOBccpQuTUduqZBFd_6A.png" /></figure><p>The popularity and adoption of open table formats, such as Iceberg, Delta Lake, and Hudi continue to rise, due to their advanced features and capabilities. The Data and Analytics Platform team within Randstad Groep Nederland has migrated the Data Lake from Apache Hive Metastore managed parquet files into the Apache Iceberg table format.</p><p>This blog explains the motivation behind the migration. The shortcomings of the past and the benefits of the present setup are also described.</p><h3><strong>Past — Hive</strong></h3><p>The data lake was previously based on parquet files stored on S3 and the Apache Hive compatible AWS Glue Data Catalog. The setup relied on the Hive folder-like directory structure, as shown in Figure 1. However, our experience with this format revealed several drawbacks, namely:</p><ul><li>Trino is the data lake query engine. In order for a Trino query to discover the files required, the partitions need to be listed at runtime. Especially for tables with many partitions, this is not only <strong>time consuming (</strong>O(n)<strong>)</strong>, but also costly, due to the cost introduced by the S3 API calls required to list the objects.</li><li>The table metadata is stored in the Hive compatible AWS Glue Data Catalog metastore. To track the partitions and keep the metastore up-to-date, we were using <strong>AWS Glue Crawlers</strong>, which is an extra component in the data pipelines, that also incurs costs and introduces a delay in the ingestion process due to runtime.</li><li>The current zone of the Data Lake stores the up-to-date state of the data, for example the last Update of the records. To build it in the Hive structure, the previous snapshot gets loaded in memory, the current state gets computed and the snapshot is written back on S3. This led to <strong>significant S3 I/O </strong>and increased <strong>load on the EMR cluster </strong>where we run our Spark jobs.</li><li><strong>Hive tables do not support ACID transactions</strong>, which can lead to data inconsistencies or even data loss if multiple writers attempt to update the data concurrently.</li><li>Modifying the<strong> partition granularity </strong>requires a full data migration. For example, if the existing partition is /year/month/day/hour/minute, modifying it to /year/month/day requires a full rewrite of the data, which is resource-intensive and time consuming.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N-UGq6KTbLdVfh7Z.png" /><figcaption>Figure 1. Hive table structure [1]</figcaption></figure><h3><strong>Present — Iceberg to the rescue</strong></h3><p>Due to the aforementioned reasons we decided to look into Apache Iceberg,<strong> </strong>an open table format created by Netflix to address many of the Apache Hive shortcomings. In a nutshell, the magic of the Iceberg architecture (see Figure 2) relies on the metadata layer, which holds metadata for all the table files, but also information about each individual file, as well as column-level metadata.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zkX-K8v-iK2Kof6Y.png" /><figcaption>Figure 2. Iceberg Architecture [2]</figcaption></figure><p>Most importantly, Iceberg improves user experience and leads to cost reductions. Some of the major advantages identified are listed below:</p><ul><li>Full directory scanning is not needed, therefore S3 API costs are lower and query planning is faster. We noticed an average <strong>35% improvement in Trino query runtimes</strong>.</li><li>Iceberg uses <strong>ACID transactions</strong>. Many processes can update the data at the same time and we can rest assured that all transactions are atomic, consistent and isolated.</li><li>An expressive <strong>Spark SQL MERGE INTO </strong>statement can be used to do an <strong>UPSERT </strong>and create the current snapshot of the data. Less I/O is required, which translates into cost reduction.</li><li>Users can easily <strong>time-travel </strong>and examine the data at an earlier point in time.</li><li>Table <strong>rollback </strong>can be done to revert the table state, for example in case of an erroneous data ingestion.</li><li><strong>Schema evolution </strong>is seamless, “HIVE PARTITION SCHEMA MISMATCH ERROR” anyone?</li><li>There is <strong>no need to run Glue Crawlers </strong>or to create Hive views that point to the current state of the data.</li><li><strong>Partition evolution</strong> can be used to modify the partition layout on-the-fly, avoiding a costly operation.</li></ul><h3><strong>Conclusion</strong></h3><p>Apache Iceberg is a great tool for managing large data sets in a data lake. It has greatly improved consistency, scalability, performance, and maintainability in our Data Platform. If your data lake is currently based on Hive, consider adopting Iceberg!</p><p><strong><em>References:</em></strong></p><p>[1]<a href="https://www.dremio.com/resources/guides/apache-iceberg-an-architectural-look-under-the-covers/">https://www.dremio.com/resources/guides/apache-iceberg-an-architectural-look-under-the-covers/</a></p><p>[2]<a href="https://iceberg.apache.org/spec/">https://iceberg.apache.org/spec/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ab4b07d31cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rgn-it/migrating-to-iceberg-for-a-more-efficient-data-lake-3ab4b07d31cd">Migrating to Iceberg for a more efficient Data Lake</a> was originally published in <a href="https://medium.com/rgn-it">randstad tech &amp; touch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Labeling comments with unsupervised topic modeling methods]]></title>
            <link>https://medium.com/rgn-it/labeling-comments-with-unsupervised-topic-modeling-methods-8937863039d6?source=rss----acc1d5dae10---4</link>
            <guid isPermaLink="false">https://medium.com/p/8937863039d6</guid>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <category><![CDATA[text-mining]]></category>
            <dc:creator><![CDATA[Bob Tourne]]></dc:creator>
            <pubDate>Thu, 15 Sep 2022 09:54:49 GMT</pubDate>
            <atom:updated>2022-09-15T09:54:49.081Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This blogpost is concerned with an exploratory method that we developed to automatically label text data with interpretable topics. The examples that we show originate from a monthly employee survey from which we collected 180000 open answers over time.</em></p><p>Text data gathered through surveys (e.g., answers on open-ended questions) can be richer in information than closed-form answers (e.g., Likert scales), yet are often used to a far lesser extent. This is because analyzing unstructured text data often implies manually reading comments and labeling each of them for later use in quantitative analysis. A tedious task if the number of answers run in the hundreds, but a practically impossible task if the number of answers run in the tens- or hundreds of thousands. Luckily we have computers to assist us with this task.</p><p>An issue with text data is that computers cannot understand the semantic meaning of words in the same way that humans do. More traditional text mining approaches use <strong>word counts</strong> to compare different bodies of text with each other. Methods such as TF-IDF or LDA use these word counts to assess which words uniquely describe an answer and may therefore be regarded as the topic of that answer. However, word count methods do not work well for corpora with short texts and a large number of topics.</p><p>State-of-the-art techniques utilize methods which infer the relationships between words by looking at which words often appear next to each other. With these techniques we can represent the semantic relationships between words or entire documents through <strong>embeddings</strong> (i.e., vectors in a semantic space). The fact that the relationship among words and documents can be numerically represented make embeddings useful for a wider range of ML techniques.</p><p>Embeddings for words and complete answers can be generated jointly. This implies that we can assess which words are most closely related to a certain answer. In the example below, the idea of joint word and document embeddings is visually represented on a two-dimensional axis. We can see that two general topics appear in the data (<em>deep learning</em> and <em>statistics</em>) and that words as well as larger bodies of text with the same semantic meaning cluster together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*cWNJIyIz6eyxWWxD" /><figcaption><em>Image reprinted from </em><a href="https://github.com/ddangelov/Top2Vec"><em>https://github.com/ddangelov/Top2Vec</em></a></figcaption></figure><p>Note that by default these embeddings are 300-dimensional, which is not only impossible to visualize as nicely as the example above, but also causes <strong>sparsity</strong> (i.e., when the majority of the data does not convey any information) in the data. Therefore, it is advisable to perform <strong>dimensionality reduction</strong> with methods such as UMAP on your embeddings.</p><p><strong>Finding topics in the embedding space</strong></p><p>After creating the joint embeddings and performing dimensionality reduction, we could take two approaches.</p><ol><li><em>Unsupervised approach:</em> in this approach we would use the answers as a starting point and infer topics for each answer based on the individual words that show high similarity to the answer</li><li><em>Domain expertise approach:</em> in this approach we would first use domain expertise to pre-define a list of frequently occurring topics in the data. Subsequently, we would use these topics as a starting point and match them with answers by searching the embeddings space</li></ol><p>The unsupervised approach would be suitable for situations when: (i) we would want to avoid any (subjective) human interventions, (ii) pre-defining a list of topics is impractical or (iii) where there is a stream of data that might contain new and unforeseen topics. However, the downside to this approach is that the resulting topics will be more ambiguous, as they would merely be a collection of single words that show similarity with the text and need to be manually interpreted and processed in a later stage to be useful for further analysis.</p><p>The below example is a randomly sampled answer from our dataset with the 15 most similar words. As you can see, the words show similarity to the answer but are still ambiguous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/0*DR0WFPtdp1xwuLB2" /></figure><p>For our project, we chose to go for the second approach; use domain expertise to pre-define a list of frequently occurring topics and match answers by searching the embeddings space with these topics. We found the following topics to frequently occur in our dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/0*lDOQkPTzD5EX8Dr5" /></figure><p>Matching answers with topics was done by measuring the <strong>cosine similarity</strong> between the embedding vectors of our topics and the embedding vectors of each of our answers. One problem that we encountered was that not all topics that we searched for yielded similarity scores within the same range, so a hard-coded threshold would be too strict for some topics and too liberal for others (to give some intuition for this, the maximum cosine similarity scores varied between 0.24 and 0.47).</p><p>The solution that we came up with was to rank all similarity scores between a topic and all answers and locate the knee point (i.e., the point at which the rate of change starts decreasing) on the resulting line, as presented in the image below. All scores above this point have a distinguishable higher score compared to the rest of the data, and can therefore be safely labeled with the topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/0*m3DE7qbMfET1cD0G" /></figure><p>With this approach (and conservative settings to locate the knee point) we were able to label roughly 15% of our dataset with an accuracy score between 90% and 100% (estimated by face value). This may not seem impressive, but in essence we have just created labeled training data which we can use to train a classifier to further label topics of unlabeled answers.</p><p><strong>Text classification for labeling unlabeled answers</strong></p><p>With these labeled instances a classifier can be trained to predict the yet unlabeled comments. In our experiment, we used a Naive Bayes classifier which we trained on the labeled data for each of our predefined topics. Each classifier was trained to predict the probability of a yet unlabeled comment belonging to a respective topic or not. The topic with the highest predicted probability with a threshold &gt; 0.95, if any, would be assigned to the comment.</p><p>The table below shows the accuracy scores, derived from a 10-fold cross validation check per topic. Note that these scores might not be fully representative for the model accuracy on the yet unlabeled data due to the fact that only a small proportion of the total dataset could be used at this stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/0*lIDGASNtsnaoMVgY" /></figure><p>With this second iteration we were able to successfully label roughly 50% of our comments with a total accuracy of roughly 80% — 90% (again, estimated by face value). Keeping in mind that a significant proportion of the comments (around 25%) is not of interest to label at all and that the predefined list of topics may not be exhaustive, these results are adequate enough to bring this model further into production. Below are some examples of labeled answers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/0*QOkH22KeZ10fcToz" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8937863039d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rgn-it/labeling-comments-with-unsupervised-topic-modeling-methods-8937863039d6">Labeling comments with unsupervised topic modeling methods</a> was originally published in <a href="https://medium.com/rgn-it">randstad tech &amp; touch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fine-tuned transformers for multi-lingual job to job seeker matching]]></title>
            <link>https://medium.com/rgn-it/fine-tuned-transformers-for-multi-lingual-job-to-job-seeker-matching-645ccd1ce58f?source=rss----acc1d5dae10---4</link>
            <guid isPermaLink="false">https://medium.com/p/645ccd1ce58f</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[recommender-systems]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Randstad Groep Nederland IT]]></dc:creator>
            <pubDate>Tue, 21 Jun 2022 14:47:41 GMT</pubDate>
            <atom:updated>2022-06-21T14:34:55.898Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fine-tuned transformers for multilingual job to job seeker matching</h3><h4>Constructing useful embeddings of textual information in vacancies and resumes for industry-scale recommender systems</h4><p>By <a href="https://www.linkedin.com/in/dor-lavi-25030b97/">Dor Lavi</a>, Senior Data Scientist at Randstad Groep Nederland</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXNwXOww3nGPUPszuuB7Xw.png" /></figure><p>Each day, at Randstad, we employ industry-scale recommender systems to recommend thousands of job seekers to our clients, and the other way around; vacancies to job seekers. Our job recommender system is based on a heterogeneous collection of input data: curriculum vitaes (resumes) of job seekers, vacancy texts (job descriptions), and structured data (e.g., the location of a job seeker or vacancy).</p><p>The goal of our system is to recommend the best job seekers to each open vacancy.</p><p>In a recently published paper we explore and describe methods for constructing useful embeddings of textual information in vacancies and resumes.</p><h3>Challenges</h3><p>Several challenges arise when matching jobs to job seekers through textual resume and vacancy data.</p><h4>Noisy Data</h4><figure><img alt="a small blue megaphone icon" src="https://cdn-images-1.medium.com/max/188/1*BHZiTZ6GPium5t8wm2_l_Q.png" /></figure><p>First, the data we work with is inherently noisy. On the one hand, resumes are user-generated data, usually (but not always) in PDF format. It goes without saying that parsing those files to plain text can be a challenge in itself, and was therefore considered out of scope. On the other hand, in our case vacancies are composed of structured formatted text.</p><h4>Complementary Data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*g0qyaPyABSlENQHtlRdVEA.png" /></figure><p>Second, the nature of the data differs. Most NLP research in text similarity is based on the assumption that two pieces of information are the same but written differently. However, in our case the two documents do not express the same information, but complement each other like pieces of a puzzle. Our goal is to match two complementary pieces of textual information, that may not exhibit direct overlap/similarity.</p><h4>Multilinguality</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*GqQFcC77pj_iCcV6DPGscw.png" /></figure><p>Third, as a multinational corporation that operates all across the globe, developing separate models for each market and language does not scale. Therefore, a desired property of our system is multilinguality; a system that will support as many languages as possible.</p><p>In addition, as it is common to have English resumes in non-English countries (e.g., in the Dutch market around 10% of resumes are in English), cross-linguality is another desired property, e.g., being able to match English resumes to Dutch vacancies.</p><h3>Dataset Creation</h3><p>We have a rich history of interaction between consultants (recruiters) and job seekers (candidates). We define a positive signal as any point of contact between a job seeker and consultant (e.g., a phone call, interview, job offer, etc.). Negative signals are defined by job seekers who submit their profile, but get rejected by a consultant without any interaction (i.e., consultant looks at the job seeker’s profile, and rejects).</p><p>In addition, since we have an unbalanced dataset, for each vacancy we add random negative samples, which we draw randomly from our job seeker pool. This is done in spirit with other works, which also complement historical data with random negative pairs.</p><h3>Baseline</h3><h4>Unsupervised</h4><p>Our first baselines rely on unsupervised feature representations. More specifically, we represent both our vacancies and resumes as either</p><p>(i) TF-IDF weighted vectors</p><p>(ii) pre-trained BERT embeddings</p><p>We then compute cosine similarities between pairs of resumes and vacancies, and consider the cosine similarity as the predicted ``<em>matching score</em>’’.</p><p>Our TF-IDF vectors have 768 dimensions, which is equal to the dimensionality of BERT embeddings. We fitted our TF-IDF weights on the training set, comprising both vacancy and resume data. As for BERT models we use the pre-trained on Wikipedia from the HuggingFace library.</p><p>These unsupervised baselines help us to assess the extent to which the vocabulary gap is problematic, i.e., if vacancies and resumes use completely different words, both bag of words-based approaches such as TF-IDF weighting and embedding representations of these different words will likely show low similarity. Formulated differently, if word overlap or proximity between vacancies and resumes is meaningful, these baselines would be able to perform decently.</p><h4>Supervised</h4><p>Next, we present our two supervised baselines, where we employ a random forest classifier that is trained on top of the feature representation described in the unsupervised section. These supervised baselines are trained on our 80% train split, using the default parameters given by the scikit-learn library.</p><p>We add these supervised methods and compare them to the previously described unsupervised baselines to further establish the extent of the aforementioned vocabulary gap, and the extent in which the heterogeneous nature of the two types of documents plays a role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*azAP12Fz0EfQAyUV" /></figure><h3>conSultantBERT</h3><p>Finally, we present our fine-tuned embedding model; conSultantBERT, which we fine-tune using the regression objective, as illustrated in figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/0*pRQYKJuORsa_46yh" /></figure><h3>Results</h3><p>In the figure below we see a few examples for sentences that a candidate might write <em>“I worked …”</em> and few examples for vacancy <em>“We are looking for …”</em>. In order to demonstrate cross lingual and multilingual the same examples are written in both English and Dutch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/0*NqUFSjPgXo1QtGkl" /></figure><h4>TF-IDF</h4><p>With TFIDF we can see that there is no match at all. This is due to the vocabulary gap, so by definition TFIDF can not match between <em>“warehouse” </em>and <em>“logistic worker”</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*Xxo6H7NyBxja8ub6" /></figure><h4>BERT</h4><p>To solve the vocabulary gap we introduced BERT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-V0XUySxwB3AFbcC" /></figure><p>Which we see does find similarity between candidate and vacancy sentences. However, it also hardly separates between the positive and negative pairs.</p><p>Moreover, we can see a slight clustering around languages, so Dutch sentences have comparatively higher similarity to Dutch sentences, and likewise English sentences are more similar to each other.</p><h4>conSultantBERTRegressor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pM0dZSysi14uilK8" /></figure><p>On the Figure above we observe that the vocabulary gap is bridged, cross-lingual sentences are paired properly (e.g “<em>I worked in a warehouse for 10 years”</em> and <em>“We zijn op zoek naar een getalenteerde logistiek medewerker”</em> have high score), and finally, both Dutch to Dutch and English to English sentences are properly scored, too, thus achieving our desired property of multilinguality.</p><h3>Final Notes</h3><p>In this work we experimented with various ways to construct embeddings of resume and vacancy texts. We propose to fine-tune the BERT model using the Siamese SBERT framework on our large real-world dataset with high quality labels for resume-vacancy matches derived from our consultants’ decisions. We show our model beat our unsupervised and supervised baselines based on TF-IDF features and pre-trained BERT embeddings.</p><p>Furthermore, we show it can be applied for multilingual (e.g., English-to-English alongside Dutch-to-Dutch) and cross-lingual matching (e.g., English-to-Dutch and vice versa).</p><p>Finally, we show that using a regression objective to optimize for cosine similarity yields more useful embeddings in our scenario, where we aim to apply the learned embeddings as feature representation in a broader job recommender system.</p><p><a href="https://www.werkenbijrandstad.nl/it-en?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=fine-tuned+transformers">See all of our stories and more about working at RGN IT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=645ccd1ce58f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rgn-it/fine-tuned-transformers-for-multi-lingual-job-to-job-seeker-matching-645ccd1ce58f">Fine-tuned transformers for multi-lingual job to job seeker matching</a> was originally published in <a href="https://medium.com/rgn-it">randstad tech &amp; touch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloudformation isn’t perfect — but custom resources can get you closer]]></title>
            <link>https://medium.com/rgn-it/cloudformation-isnt-perfect-but-custom-resources-can-get-you-closer-fd20386db387?source=rss----acc1d5dae10---4</link>
            <guid isPermaLink="false">https://medium.com/p/fd20386db387</guid>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[aws-custom-resources]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Randstad Groep Nederland IT]]></dc:creator>
            <pubDate>Tue, 21 Jun 2022 14:47:18 GMT</pubDate>
            <atom:updated>2022-06-21T14:40:48.309Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloudformation isn’t perfect — but custom resources can get you closer</h3><p>How we use custom resources to deal with unsupported resources, circular dependency and more.</p><p>by <a href="https://www.linkedin.com/in/saswat-sahoo-7b6340105/">Saswat Sahoo</a>, Senior Data Engineer at Randstad Groep Nederland</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucMdsksbYO9-JW6tgDXdww.png" /></figure><h3>Cloudformation Custom Resource</h3><p>Cloudformation(Cfn) is a commonly used IaC tool for deploying resources into AWS. It has been out there for a long time now and is a quite popular choice among engineers to set up AWS infrastructure using it. However, there are certain limitations with Cfn as listed below.</p><p><em>This is not a complete list, but only specific in the context of this article.</em></p><p>1. All AWS resources are not covered under Cfn. A few AWS services are not supported in Cfn (e.g. AWS S3 batch) or sometimes a part of the service is not included (e.g. tagging of AWS event rule). In such a situation, you use AWS APIs to fill the gap.</p><p>2. There are certain scenarios where you end up in an egg-chicken situation i.e. <strong>circular dependency</strong> in Cfn terms. A very common example is setting up an S3 bucket with Lambda as a target for event notification. Such cases can be handled by a 2-step deployment approach or use APIs outside of Cfn stack. However, it is not desirable and requires human intervention.</p><p>3. Cfn can only provision AWS resources. If your application has a dependency on an external non-AWS service, you can not make it part of the Cfn lifecycle. In such cases, you might use Terraform which has support for multi-cloud.</p><p>Cfn Custom Resources is the solution to all these limitations. AWS also released a new feature named “Cloudformation Registry” and it is the successor of custom resources with more advanced capabilities. For this blog, we will only focus on custom resources. In the next section we will take a deeper look at what it is and how we can use it to extend cloudformation beyond its regular offerings.</p><h4>What is Cfn Custom Resources?</h4><p>Custom resources allow you to execute a custom script/logic within the Cfn lifecycle. When you create, update or delete a Cfn stack, the custom script also runs during the template deployment phase. This way you can embed any programmable functionalities into your stack; such as calling an AWS/Non-AWS API, seeding your dynamo table, or uploading a file in an S3 bucket. There are certain rules you need to remember while developing a custom resource. It is very important to adhere to these rules, else it can lead to a situation where your stack execution stucks for hours.</p><h4>How to Get Started?</h4><p>There are 3 simple steps for using a custom resource</p><ol><li>Write an AWS lambda function with the logic you want to execute during Cfn stack deployment</li><li>Deploy the lambda function or make it part of the stack. The latter is advisable as all the IaC code can reside in the same stack and follow the same lifecycle</li><li>Invoke the lambda function by referring to it in the script with a resource type “AWS::CloudFormation::CustomResource”. Here is a complete example:</li></ol><pre>Resources:<br> MyCustomResource:<br>  Type: &#39;AWS::CloudFormation::CustomResource&#39;<br>  Properties:<br>   ServiceToken: arn:aws:lambda:us-east-1:12345:function:fnName<br>   key_1: value_1</pre><p>“<strong>ServiceToken</strong>” is the most important part i.e. this is how you refer to a lambda function. You can also pass some contextual data as a JSON payload to the lambda function ({“key_1”: “value_1” } in this example)</p><p><strong>Note</strong> — You can also use SNS topic instead of a lambda function. To keep it simple we will only use the lambda function in the latter part of this blog.</p><h4>Under The Hood</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*oEpjsjzj_9zc9ofV" /></figure><p>Before implementing let’s see how the custom resource works under the hood. This will set up the foundation before we dive into the programming model.</p><p>Custom resource lambda function is a webhook for cloudformation’s lifecycle events i.e. create, update and delete. When you deploy the stack for the first time, Cfn will trigger the lambda function with the “Create” event. All your custom logic will be executed in lambda. The lambda is also expected to write the output to an AWS-managed S3 bucket in a specific format that Cfn understands. While the Lambda function runs, Cfn keeps on polling the S3 bucket for the result. Once it receives the result the stack deployment continues with the subsequent steps.</p><h4>Programming the Custom Resource</h4><p>Now comes the tricky part — coding the lambda function. This is where most first-time users of custom resources tend to make mistakes. The custom resource lambda function follows a strict programming model and we need to stick to certain guidelines. Below are a few points to keep in mind —</p><ol><li>When Cfn triggers the lambda, it receives a payload in this format —</li></ol><pre>{<br>“RequestType” : “Create”,<br>“ResponseURL” : “<a href="http://pre-signed-s3-url-for-response/">http://pre-signed-S3-url-for-response</a>&quot;,<br>“StackId” : “arn:aws:cloudformation:region:1:stack/stack-name/guid”,<br>“RequestId” : “unique id for this create request”,<br>“ResourceType” : “Custom::MyCustomResource”,<br>“LogicalResourceId” : “MyCustomResource”,<br>“ResourceProperties” : {<br>“key_1” : “value_1”<br>}<br>}</pre><p>The important attributes are:</p><p><strong>RequestType</strong> — It will either Create, Update, or Delete. When you deploy the Cfn stack for the first time, lambda will receive the RequestType as “Create”, While deleting the stack it will receive “Delete” and while updating it will receive “Update”</p><p><strong>ResponseURL</strong> — This is a pre-signed S3 URL where the lambda function writes the output i.e. SUCCESS/FAILED, and some other metadata for Cfn</p><p><strong>ResourceProperties</strong> — This is the payload you define in the Cfn stack’s custom resource</p><p>2. After you execute the logic in your lambda function, it should write output to the S3 signed URL with this payload —</p><pre>{<br> &quot;Status&quot; : &quot;SUCCESS&quot;,<br> &quot;RequestId&quot; : &quot;unique id for this create request&quot;,<br> &quot;LogicalResourceId&quot; : &quot;MyCustomResource&quot;,<br> &quot;StackId&quot; : &quot;arn:aws:cloudformation:region:1:stack/stack-name/guid&quot;,<br>  &quot;PhysicalResourceId&quot; : &quot;MyCustomResourcePhysicalId&quot;,<br>  &quot;Data&quot; : {<br>   &quot;output_key_1&quot; : &quot;output_value_1&quot;<br>  }<br>}</pre><p>The two most important attributes are</p><p><strong>Status</strong>: SUCCESS/FAILURE — This tells Cfn whether your custom resource was successfully created/updated/deleted. This also decides the overall status of the Cfn stack. If the lambda function sends a failure signal, the entire stack will rollback which is the default behaviour of Cfn</p><p><strong>Data: </strong>With this key, you can send some useful information back to Cfn and make use of it in other parts of the stack using <strong>Fn::GetAtt</strong> intrinsic function</p><p>3. The key differentiator of programming lambda function in general and a “custom resource” lambda function is that the latter must send a response to the signed URL before it terminates (and optionally returns an output).</p><p><strong>What happens if you forget to send the response to the signed URL?</strong></p><p>This is when things can get nasty. A custom resource is implemented in an asynchronous programming model i.e. Cfn expects a callback from the lambda function. It does not rely on what the lambda returned in the invocation result, rather it expects that the lambda should make an HTTP request to signed-URL and deliver the result. If you forget to code this in the function then Cfn stack will be stuck for hours until it times out.</p><p><strong>Can you delete the stack instead of waiting on a stuck stack?</strong></p><p>The answer is <strong>NO</strong>. This is because Cfn will again trigger the lambda with the “Delete” event and waits for a callback from the lambda. As you have not programmed to send a callback, you will see the stack stuck in “DELETE_IN_PROGRESS” state which again lasts up to hours.</p><p><strong>What if lambda errors out?</strong></p><p>The answer is the same i.e stack gets stuck. Let’s say you have implemented the callback logic, but the lambda failed due to an uncaught exception or timed-out and prevented the execution of the callback logic. In this scenario also, Cfn will keep waiting in anticipation of a callback from the function which it never gets.</p><p><strong>Is there an easy way?</strong></p><p>The good news is <strong>YES</strong>. The internal mechanics do not change though and all the above principles are still applicable. However, instead of you doing all the heavy lifting you can make use of a helper library. The helper library makes sure the function calls back with an appropriate response and handles any uncaught exception and edge cases. This leaves you only with handling the custom logic like any other Lambda function. There are quite a few open-source utility libraries in most of the lambda-supported programming languages. If you are using python,<a href="https://github.com/aws-cloudformation/custom-resource-helper"> crhelper</a> is a great choice. It’s very simple to start and eliminates all the above complexity we talked about. Additionally, it has the support for long-running processes exceeding lambda’s 15 min runtime by enabling a polling mechanism.</p><p>Here is the example code skeleton where you need to just fill the placeholders under the decorated functions.</p><pre>from crhelper import CfnResource<br>import logging</pre><pre>logger = logging.getLogger(__name__)</pre><pre>helper = CfnResource(json_logging=False, log_level=&#39;DEBUG&#39;, boto_level=&#39;CRITICAL&#39;, sleep_on_delete=120, ssl_verify=None)<br>try:<br>   ## Init code goes here<br>   pass<br>except Exception as e:<br>   helper.init_failure(e)<br><a href="http://twitter.com/helper">@helper</a>.create<br>def create(event, context):<br>   # Handle create event<br>   helper.Data.update({&quot;test&quot;: &quot;testdata&quot;})<br>   return &quot;MyCustomResourceId&quot;<br><a href="http://twitter.com/helper">@helper</a>.update<br>def update(event, context):<br>   #Handle update event<br><a href="http://twitter.com/helper">@helper</a>.delete<br>def delete(event, context):<br>   # Handle delete event<br>def handler(event, context):<br>   helper(event, context)</pre><h3>Conclusion</h3><p>We learned quite a few important mechanics of custom resources and built the foundation knowledge required to get started with it. And most importantly the “gotchas” — use it in a proper way to eliminate undesired behaviour.</p><p>Custom resources are a great way to fill the shortcomings cloud formation has at the moment. It en-powers you to do anything and everything with Cfn.</p><p><a href="https://www.werkenbijrandstad.nl/it-en?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=custom-resources">Read more about RGN IT and our work here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd20386db387" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rgn-it/cloudformation-isnt-perfect-but-custom-resources-can-get-you-closer-fd20386db387">Cloudformation isn’t perfect — but custom resources can get you closer</a> was originally published in <a href="https://medium.com/rgn-it">randstad tech &amp; touch</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>