<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Catawiki</title>
    <description>The latest articles on DEV Community by Catawiki (@catawiki).</description>
    <link>https://dev.to/catawiki</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2558%2Fd0f03676-75fc-408f-a66d-f1d01ac0360c.jpg</url>
      <title>DEV Community: Catawiki</title>
      <link>https://dev.to/catawiki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/catawiki"/>
    <language>en</language>
    <item>
      <title>Migrating a static Hugo blog to AWS Amplify</title>
      <dc:creator>Aristide Bouix</dc:creator>
      <pubDate>Tue, 02 Nov 2021 08:43:17 +0000</pubDate>
      <link>https://dev.to/catawiki/migrating-a-static-hugo-blog-to-aws-amplify-2nnb</link>
      <guid>https://dev.to/catawiki/migrating-a-static-hugo-blog-to-aws-amplify-2nnb</guid>
      <description>&lt;p&gt;Fond of Cloud, Open Source and new technologies, Aristide leads the implementation of security controls on Catawiki’s Auction platform. In this publication he describes the historical technical considerations that applied to his personal website architecture built on AWS since its creation in 2016 to today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Blog’s Origins
&lt;/h2&gt;

&lt;p&gt;Back in 2016, I used to work as a Django developer, and as such, after starting working on AWS, I decided to host a personal website as a Django blog on AWS Elastic beanstalk.&lt;br&gt;
The blog was extremely minimalistic and configured to use two small AWS VMs, one for the application and another one for a Postgres database hosted in a private subnet. It also involved an S3 bucket to load some static content such as images.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8ktl6wengmxlto42bnq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8ktl6wengmxlto42bnq.png" alt="Diagram 1: An Elastic Beanstalk 2-Tiers Architecture"&gt;&lt;/a&gt;&lt;/p&gt;
Diagram 1: An Elastic Beanstalk 2-Tiers Architecture



&lt;p&gt;While this approach was convenient to start getting familiar with AWS and leveraging several of their based infrastructure services (VPC, CloudWatch, S3, RDS, Route53 ...), it had many drawbacks, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Django framework is heavy to maintain and update for a side-project&lt;/li&gt;
&lt;li&gt;Past the AWS free tiers, keeping two running VMs as small as they were wasn’t cheap &lt;sup id="fnref1"&gt;1&lt;/sup&gt;
&lt;/li&gt;
&lt;li&gt;It simply couldn’t scale for more than 10 simultaneous users without autoscaling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Going static
&lt;/h2&gt;

&lt;p&gt;A bit later in 2017, I started hearing about these magic websites that could be built almost instantly using a static site generator and found that S3 could be configured to host them in one click. Therefore, I’ve benchmarked the two most popular solutions at that time, the Ruby engine Jekyll and the Go version called Hugo. As you can deduct it from this post’s title, I’ve gone for the second one as it was lighter and faster to build.&lt;/p&gt;

&lt;p&gt;With a static website, I wasn’t required any longer to keep a dedicated database to host my blog posts, users and their comments. Instead, I’ve chosen to rely on external SaaS services such as Disqus for comments and Algolia for searching. Both solutions allow generous free-tiers usage for non-commercial use.&lt;/p&gt;

&lt;p&gt;As serving content outside AWS is expensive, I’ve also added a Cloudfront distribution in front of the S3 bucket and was able to add a Lambda@Edge function in my website’s HTTP request responses&lt;sup id="fnref2"&gt;2&lt;/sup&gt;. Lambda@Edge allowed me to add additional security to my website, such as preventing serving content from a non-explicitly allowed domain with a Content-Security-Policy (CSP) HTTP header. I also actively monitor the messages returned by these security headers through the excellent monitoring platform Report-URI from &lt;a href="https://twitter.com/Scott_Helme?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor" rel="noopener noreferrer"&gt;Scott Helm&lt;/a&gt;. The website architecture, therefore, was simplified as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb5afs6rm3cyza1g5cwb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb5afs6rm3cyza1g5cwb.png" alt="Diagram 2: Static website hosted on S3"&gt;&lt;/a&gt;&lt;/p&gt;
Diagram 2: Static website hosted on S3



&lt;p&gt;This structure is much cheaper and more scalable and can serve thousands of users for less than €5 per month.&lt;/p&gt;

&lt;p&gt;A remaining caveat was that it was difficult to restrict access to the S3 website from the CloudFront&lt;sup id="fnref3"&gt;3&lt;/sup&gt; service only. As described &lt;a href="https://abridge2devnull.com/posts/2018/01/restricting-access-to-a-cloudfront-s3-website-origin/" rel="noopener noreferrer"&gt;here&lt;/a&gt;, the usual AWS best practice of setting an Origin Access Identity (OAI) is incompatible with S3 website endpoints. The only workaround is to set a hardcoded “password” in an HTTP header supported as a condition in the S3 bucket policy. In addition, you need a few additional resources to get an automated CI/CD deployment from a Git repository (AWS CodePipeline) or some monitoring and alerting (Cloudwatch Alarms).&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving to Amplify
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/amplify/" rel="noopener noreferrer"&gt;AWS Amplify&lt;/a&gt; was initially a response from AWS to the popular simple web app hosting solution Firebase from Google&lt;sup id="fnref4"&gt;4&lt;/sup&gt;. It designates a toolset integrating many AWS services (CI/CD, Authentication, CDN, hosting, monitoring ...) in a single place.&lt;/p&gt;

&lt;p&gt;Let’s see how it works. First you create a new hosting and choose the appropriate versioning service where the Hugo website skeleton is stored, in my case GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8i9jzp6b1swx3zzysqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8i9jzp6b1swx3zzysqr.png" alt="Creating a new project on AWS Amplify"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then Amplify will automatically detect what framework it should use to build the project and propose an appropriate build configuration. Furthermore, in the advanced setting, you can configure Amplify build to use a custom docker image stored in ECR (Elastic Container Registry) and environment variables.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxgvyh7v7qr9wpeptj78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwxgvyh7v7qr9wpeptj78.png" alt="AWS Amplify project configuration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And voila! The website is now live on an &lt;a href="https://sandbox.amplifyapp.com/getting-started" rel="noopener noreferrer"&gt;amplifyapp.com&lt;/a&gt; provided URL.&lt;/p&gt;

&lt;p&gt;Another powerful feature of Amplify is that you can easily host different versions of your project based on different Git branches; this enables you to run a testing version of a new feature before rolling it out to your main website. However, you may not want to expose this staging branch to the outside world. The good news is that AWS Amplify permits to effortlessly set a Basic Authentication in front of any website’s version. The less good news is that for an AWS managed service, I would also have expected the possibility to log in a user based on their AWS IAM identity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdb76tvgawyjfs8pj88a3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdb76tvgawyjfs8pj88a3.png" alt="AWS Amplify Access Control"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I already own a Route53 hosted zone, let’s change the default amplifyapp.com provided URL to my usual custom domain&lt;sup id="fnref5"&gt;5&lt;/sup&gt;. This will create a new CloudFront distribution with a free wildcard SSL certificate for your root domain and subdomains.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwzpoi0t7rt82m6ffaol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwzpoi0t7rt82m6ffaol.png" alt="AWS Amplify Custom Domains"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you follow this step, you may find that the console only redirects the root domain to the www subdomain during creation. For further redirection options, there is an additional 'Rewrites and redirects' menu that you can configure as follow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzasejc4zdwmb2ckd2hb0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzasejc4zdwmb2ckd2hb0.png" alt="AWS Amplify Rewrites and Redirects"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The rationale in this configuration is that by default AWS Amplify Redirect unknown URLs to the main page, so if you wish to show your own ‘404 not found page’ , it is better to advertise it as a ‘404 (Rewrite)’ instead of a ‘404 (Redirect)’. &lt;/p&gt;

&lt;p&gt;Also, for SEO, it is better to replace the default ‘302 (Redirect - Temporary)’ HTTP return code to ‘301 (Redirect - Permanent)’. A 302 return code may confuse Search Engines that will continue to reference the wrong URL, as the redirection is supposed to be temporary, ending up slowing the initial loading time of visitors coming from the wrong URL.&lt;br&gt;
Personally, I highly recommend choosing either your root or www subdomain and redirecting all other site references to it. Indeed, Search Engines tend to get confused when they’re getting the same page at different URLs. Do the same for the HTTP version of your site to HTTPS as you enjoy a free AWS managed SSL certificate, that will also decrease your domain spread.&lt;/p&gt;

&lt;p&gt;The last screenshot is for the custom header editor that I’ve particularly enjoyed, there you can define your site HTTP headers in a yaml format&lt;sup id="fnref6"&gt;6&lt;/sup&gt;. It is much more convenient than maintaining a lambda@Edge function. My only catch on this menu concerns  the editor that I find quite basic. So I copy paste the code and edit it in a separate editor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2yp05rjf2ovs9x8q5jf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2yp05rjf2ovs9x8q5jf.png" alt="Adding custom headers in AWS Amplify"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a few additional power user functionalities that I don’t use for my relatively simple personal blog, so I won’t detail them here. These advanced functionalities include an Admin UI to configure team access to a serverless backend, direct CloudWatch monitoring and Alarm integration, and Pull Request system to merge changes between different branches and the master.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost Analysis
&lt;/h2&gt;

&lt;p&gt;This study wouldn’t be exhaustive without a full pricing comparison between the AWS Amplify and a custom Cloudfront+S3+Lambda integration. I will simplify it a little, since I’ve configured CloudFront, my S3 costs were very low,  and Lambda@Edge costs have remained within the Lambda Free Tiers. Below is a breakdown of the different potential costs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;CloudFront+S3+CodePipeline&lt;/th&gt;
&lt;th&gt;Amplify&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Build&lt;/td&gt;
&lt;td&gt;$1.00 per active pipeline per month&lt;br&gt;$0.005 per build minute (Frankfurt using general1.small)&lt;/td&gt;
&lt;td&gt;$0.01 per build minute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;$0.0043 per 10,000 GET and all other requests (Frankfurt)&lt;br&gt;$0.0245 per GB - first 50 TB / month of storage used (Frankfurt)&lt;/td&gt;
&lt;td&gt;$0.023 per GB stored per month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Egress&lt;/td&gt;
&lt;td&gt;$0.020 per GB - All data transfer out to Origin (Europe)&lt;br&gt;$0.085 per GB - first 10 TB / month data transfer out&lt;br&gt;$0.0120 per 10,000 HTTPS Requests&lt;/td&gt;
&lt;td&gt;$0.15 per GB served&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One of the strengths of AWS Amplify is that costs are fixed for any region you operate in. This can prove more beneficial in certain geographic areas such as Asia Pacific, Australia or South America, where outbound traffic varies between $0.11 to $0.12.&lt;sup id="fnref7"&gt;7&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Here is a more literal comparison based on my website costs for July 2021:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Consumption&lt;/th&gt;
&lt;th&gt;CloudFront+S3 costs&lt;/th&gt;
&lt;th&gt;Amplify theoretical costs&lt;/th&gt;
&lt;th&gt;Theoretical savings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Build&lt;/td&gt;
&lt;td&gt;1 active pipeline&lt;br&gt; 3 build minutes&lt;/td&gt;
&lt;td&gt;$1 + $0.015&lt;/td&gt;
&lt;td&gt;$0.03&lt;/td&gt;
&lt;td&gt;$0.97&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage&lt;/td&gt;
&lt;td&gt;10,000 GET and other requests&lt;br&gt; 0.15 GB of storage&lt;/td&gt;
&lt;td&gt;$0.0043 + $0&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;td&gt;$0.0043&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Egress&lt;/td&gt;
&lt;td&gt;300k HTTPS requests Europe&lt;br&gt; 2.5 GB served&lt;br&gt; 130k HTTPS requests US&lt;br&gt; 1.3 GB served&lt;/td&gt;
&lt;td&gt;$0.4+$0.2+ $0.15 + $0.15 = $0.9&lt;/td&gt;
&lt;td&gt;$0.6&lt;/td&gt;
&lt;td&gt;$0.3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Total&lt;/td&gt;
&lt;td&gt;$1.91&lt;/td&gt;
&lt;td&gt;$0.63&lt;/td&gt;
&lt;td&gt;$1.28&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;By using AWS Amplify, I got the same features for a third of the price while saving me from maintaining the underlying service components. This result is biased by the cost of keeping one running pipeline and relatively low traffic during summer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;AWS Amplify is a managed service shipped with CloudFront, S3, CloudWatch, CodePipeline, Cognito, API Gateway and even a serverless backend. Therefore, it perfectly fits smaller size projects based on static websites or frontend oriented frameworks such as React, Vue or Next.js. &lt;/p&gt;

&lt;p&gt;While using AWS Amplify is convenient, if you operate a high Annual Rate Return service with more than 500k users, I would consider it more profitable to spend the additional Engineering effort to finely configure the corresponding underlying services&lt;sup id="fnref8"&gt;8&lt;/sup&gt;. My conclusion to this blogpost is that, no matter how great a managed service such as Amplify, the Return On Investment decreases as consumption goes up. Therefore, the main target audience of AWS Amplify is individual developers to medium-sized applicative projects.&lt;/p&gt;




&lt;p&gt;Cover photo by &lt;a href="https://unsplash.com/@smajor15" rel="noopener noreferrer"&gt;Scott Major&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;I even considered at the beginning to reserve 2 instances for 3 years to decrease the cost and discovered that the smallest instance sizes (t2.micro and t2.nano) were not eligible. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;For the curious reader, I’ve detailed in &lt;a href="https://aristidebouix.cloud/en/2018/04/secure-your-site-with-lambdaedge/index.html/" rel="noopener noreferrer"&gt;a previous post&lt;/a&gt; how I achieved this result. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn3"&gt;
&lt;p&gt;AWS’ Content Delivery Network, used to locally cache static data and thus cut down egress costs. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn4"&gt;
&lt;p&gt;From which the pricing model has been largely inspired. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn5"&gt;
&lt;p&gt;&lt;em&gt;Beware&lt;/em&gt;: I got an error at this step because the main root domain (&lt;a href="https://aristidebouix.cloud/en/" rel="noopener noreferrer"&gt;aristidebouix.cloud&lt;/a&gt;) was still attached to the old CloudFront distribution. If you also migrate your website from a Cloudfront+S3 setup to Amplify you should first remember to remove the domain redirection in your old CloudFront distribution. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn6"&gt;
&lt;p&gt;See the &lt;a href="https://docs.aws.amazon.com/amplify/latest/userguide/custom-headers.html" rel="noopener noreferrer"&gt;service documentation&lt;/a&gt; for reference. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn7"&gt;
&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: the cost to serve HTTP requests is actually lower on CloudFront than for HTTPS requests probably due to a slightly lower impact on server CPUs. If as me you block or redirect HTTP requests then all your traffic will be billed as HTTPS requests. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn8"&gt;
&lt;p&gt;To the exception perhaps if your main market is located in expensive AWS regions such as South America, Australia or Asia Pacific. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>hugo</category>
    </item>
    <item>
      <title>How Catawiki Migrated SSO’s with Zero Trust and Zero Downtime</title>
      <dc:creator>Paul Moreno</dc:creator>
      <pubDate>Tue, 21 Sep 2021 11:28:47 +0000</pubDate>
      <link>https://dev.to/catawiki/how-catawiki-migrated-sso-s-with-zero-trust-and-zero-downtime-39p9</link>
      <guid>https://dev.to/catawiki/how-catawiki-migrated-sso-s-with-zero-trust-and-zero-downtime-39p9</guid>
      <description>&lt;p&gt;Co-authored by &lt;a href="https://dev.to/cwjthompson"&gt;James Thompson&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Catawiki is a fast-growing 700+ person company, and we’re super busy tackling the challenge of growing our teams across new countries around the world. &lt;/p&gt;

&lt;p&gt;Each month we onboard around 40 new employees working remotely throughout Europe and Asia. This is supported by a close working relationship between HR, IT and Information Security.&lt;/p&gt;

&lt;p&gt;To continue providing a smooth new-employee experience and minimise data risks, we decided to overhaul our SSO and Identity Provider (IdP). This post covers our journey.&lt;/p&gt;

&lt;p&gt;When we decided to migrate our IdP we had already been working with an IdP vendor for 3 years, and so most of our mission-critical apps were already accessible through an SSO portal. We also had our HR database connected to the IdP, and our employees were familiar with using MFA to secure their apps. However as we looked towards the coming years, especially with the explosion of remote-working, we saw lots of areas we could improve on:&lt;/p&gt;

&lt;h2&gt;
  
  
  Things we wanted from an IdP
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Zero Trust Security
&lt;/h4&gt;

&lt;p&gt;We can work from anywhere, so there’s no such thing as a trusted network. We need to be sure to validate the devices used to access Catawiki data; we can’t risk having someone use an unpatched public computer to check their email or access our customer data. And finally, because we &lt;a href="https://www.troyhunt.com/password-reuse-credential-stuffing-and-another-1-billion-records-in-have-i-been-pwned/"&gt;can’t trust passwords&lt;/a&gt;, we verify the user with MFA. You can learn more about Zero Trust in &lt;a href="https://www.centrify.com/blog/best-practices-zero-trust-security/"&gt;this article&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Zero-touch enrolment
&lt;/h4&gt;

&lt;p&gt;The IT team wanted the ability to drop-ship a brand new Macbook straight from the warehouse to a new employee. After enjoying the unboxing experience and connecting to wifi, the security policies should automatically be pushed to the device, authorizing access to Catawiki data and SaaS tooling with their IdP credentials and MFA.&lt;/p&gt;

&lt;h4&gt;
  
  
  Low effort onboarding and offboarding
&lt;/h4&gt;

&lt;p&gt;Our employee data is already stored in an HR database, so we needed to make use of this and automatically create a person’s accounts when they’re hired. Even better, we wanted to give them access to the onboarding platform before their first working day so that Day One isn’t as stressful. When someone leaves the company, we can use the same philosophy to close accounts at the right time.&lt;/p&gt;

&lt;h4&gt;
  
  
  A long term SSO/IdP partnership
&lt;/h4&gt;

&lt;p&gt;Changing your IdP is not a trivial task. We needed to choose a vendor who could grow with us and meet our headcount growth in a 5-year time frame.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing a vendor
&lt;/h2&gt;

&lt;p&gt;After researching the IdP market, we went ahead and engaged the IdP market leader &lt;strong&gt;Okta&lt;/strong&gt; for a PoC, checking in great detail that the tooling could meet our requirements from August to November 2020. After a successful PoC, we moved on to find an implementation partner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding a partner
&lt;/h2&gt;

&lt;p&gt;Having small IT and Security teams forces efficiency. This drove the decision to enlist professional services to help with the implementation from an external consultant. After shortlisting a few vendors, we chose a specialist with strong experience in migrating between different IdP’s. To minimise the risk of any service interruptions, we planned and thoroughly prepared the migration over several months with multiple checkpoints.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the switch
&lt;/h2&gt;

&lt;p&gt;The IdP portal is the ‘front door’ for access to Catawiki apps. So how did we handle replacing that door whilst people are constantly walking through it?&lt;/p&gt;

&lt;p&gt;There were two main technical challenges involved in migrating Catawiki from one IdP to another:&lt;/p&gt;

&lt;h4&gt;
  
  
  Setting up federation between the old and new IdP platforms
&lt;/h4&gt;

&lt;p&gt;By setting up an inbound federation from the old IdP to Okta, we were able to migrate our SaaS apps in 25 scheduled batches rather than at one time. From the user’s perspective, they continued using the old IdP portal as normal to access their SSO apps, but federation would be redirected to the new IdP only if the app was migrated.&lt;/p&gt;

&lt;p&gt;This massively reduced the risk of the project and ultimately allowed us to complete the project with &lt;strong&gt;zero downtime or outages&lt;/strong&gt;, even for apps with hundreds of users.&lt;/p&gt;

&lt;h4&gt;
  
  
  Migrating each SSO app
&lt;/h4&gt;

&lt;p&gt;After establishing inbound federation from January to March, we then moved each SSO app from the old IdP to Okta after thoroughly testing in a staging environment. This was tricky because each vendor uses different naming conventions for SAML configuration so there’s an element of detective work to find the correct settings for dozens of apps.&lt;/p&gt;

&lt;p&gt;Once an app was migrated to Okta, users were seamlessly redirected by the inbound federation setup when accessing from the old portal.&lt;/p&gt;

&lt;h4&gt;
  
  
  Securing the virtual perimeter
&lt;/h4&gt;

&lt;p&gt;Utilizing a customized mutual TLS implementation, we were able to establish a virtualized perimeter for our SSO integrated apps. This way, we were able to not only identify and authenticate users but also devices. We also have the flexibility to monitor attempts to use unauthorized devices, make app-specific exceptions for consultants or freelancers for projects, and gain additional telemetry for our threat detection solution. Once the migration was complete, we were confident in both “who” and “what” can access our data across our cloud applications. Going forward, we’re taking advantage of &lt;a href="https://developer.apple.com/documentation/security/certificate_key_and_trust_services/keys/generating_new_cryptographic_keys"&gt;Apple’s Secure Enclave&lt;/a&gt; to add another layer of security authorization for our trusted devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finalising the migration
&lt;/h2&gt;

&lt;p&gt;Once March rolled around, we successfully had all users federating into their apps through Okta. However, they were still accessing via the old IdP portal.&lt;/p&gt;

&lt;p&gt;The final step was to make sure all staff knew how to access their apps via the Okta portal instead of the old portal. With some outreach through Slack and our support channels, we had this covered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Deciding to swap out your IdP is not easy! A lot of work and patience is needed, along with an experienced migration team and open communication across your business. But it is possible to do so smoothly, giving you a solid foundation to build on as working outside of the office continues.&lt;/p&gt;

</description>
      <category>security</category>
      <category>catawiki</category>
      <category>sso</category>
    </item>
    <item>
      <title>Why you should join Catawiki now</title>
      <dc:creator>Ozgen Gungor</dc:creator>
      <pubDate>Fri, 07 May 2021 14:32:59 +0000</pubDate>
      <link>https://dev.to/catawiki/why-you-should-join-catawiki-now-1c7c</link>
      <guid>https://dev.to/catawiki/why-you-should-join-catawiki-now-1c7c</guid>
      <description>&lt;p&gt;Imagine you are on the racetrack, in the driver’s seat, with the engine humming. The crew are working rapidly to fill up the tank and check all the systems, to make sure you are ready to step on the gas and accelerate. &lt;/p&gt;

&lt;p&gt;That’s how it feels for me today when I look around (virtually) at Catawiki. There’s a certain sense of anticipation, a rush of excitement about where we are, and where we plan to be next year. Every conversation I have is making me more excited about the opportunities ahead for Catawiki.&lt;/p&gt;

&lt;p&gt;We are already in a great position to grow and become a world-class tech organisation. Nevertheless, we don’t take that lightly. We want to use every opportunity to improve our way of working, our tooling, our infrastructure and our organisation. &lt;/p&gt;

&lt;p&gt;Let me share a bit more context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Historical reasons
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dBh0Iry_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fk630u2crqvp4wlubo15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dBh0Iry_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fk630u2crqvp4wlubo15.png" alt="A closeup to the back lights of an old Ferrari"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Catawiki is an organisation that has found its product-market fit. We have gone through a few learning cycles so far that have helped us solidify our value proposition and product engineering methodology. In the past couple of years, we have proved our ability to scale up our business. &lt;/p&gt;

&lt;p&gt;Going back to the analogy from earlier; we have already built this car that is strong, fast, sustainable and has enough mileage on the odometer to show for it. &lt;/p&gt;

&lt;p&gt;What makes Catawiki different is that we are not just a successful business, but a great place to work as well. This is evidenced by more than 80% of our team telling us they would recommend Catawiki as an employer to their friends and family. We also have a great list of powerful values that help maintain our great culture. As I settled into my role, I got to know these company values and observed that they were embraced by everyone I met. Very briefly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Be Open&lt;/strong&gt;: Being open-minded and collaborative at all times, across roles and responsibilities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be Geeky&lt;/strong&gt;: Embracing technology and scalable solutions regardless of the nature of the task at hand&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be Passionate&lt;/strong&gt;: Helping people find objects around their passions and applying the same principle to our work &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delight our customers&lt;/strong&gt;: We help people find objects they love, customers’ experience goes beyond the object and every interaction is an opportunity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Move in sync&lt;/strong&gt;: Autonomy and alignment go hand in hand (see what I did there?)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Take ownership&lt;/strong&gt;: Drive end-to-end, see things through, realise value.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Furthermore, &lt;a href="https://www.permira.com/media-centre/news/permira-underlines-catawikis-growth-trajectory-with-150m-investment/"&gt;with the latest investment round of €150 Million&lt;/a&gt;, we are in a great position to invest further in our organisation.&lt;/p&gt;

&lt;h2&gt;
  
  
  An exciting future
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9gsFAGu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emvguwzma01d2odqlp1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9gsFAGu---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emvguwzma01d2odqlp1g.png" alt="A closeup to the front lights of an old Ferrari"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently we are working on paying our technical debt off and simultaneously building new tracks for faster product iterations. &lt;/p&gt;

&lt;p&gt;I have to admit, it is amazing to operate in an environment where the current technical debt level is taken so seriously. The necessity and urgency of clearing the tech debt is widely recognised and supported throughout the entire organisation.&lt;/p&gt;

&lt;p&gt;We deploy all the best practices and tooling in order to craft world class experiences for our customers. For example; we use customer journeys, dual-track product development practices, OKRs, research and data practices to align and direct our efforts for maximum impact. &lt;/p&gt;

&lt;p&gt;On the engineering side, we are well on our way to &lt;a href="https://dev.to/catawiki/where-did-our-monolith-go-2d12"&gt;moving towards a microservice-based architecture&lt;/a&gt; that will set us up for increased scalability and agility. We are designing our technology platform for where it should be, embracing maturing technologies like service mesh or event-driven architecture.&lt;/p&gt;

&lt;p&gt;Furthermore, our organisation is growing and we are addressing the much-needed growth framework and career ladders that will carry us into the future. &lt;/p&gt;

&lt;p&gt;Adding these all up, we have plenty of interesting and impactful challenges. This means all of us here have a great chance of making a significant impact and taking part in this growth journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  My personal why
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BABi9GF---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fujc97wojixkr3jknf8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BABi9GF---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fujc97wojixkr3jknf8.jpeg" alt="The steering wheel of an old Ferrari"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While I was drafting this post, &lt;a href="https://www.linkedin.com/in/iulia-nicolaie-00883b68/"&gt;Iulia&lt;/a&gt; —our Technology Recruiter— reminded me to share my own reasons for joining Catawiki. &lt;/p&gt;

&lt;p&gt;As I went through the interview process, a couple of parameters were important to me, so I tried to use the interviews to get a clear signal on what these looked like at Catawiki:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Potential&lt;/strong&gt;: What’s the organisation’s potential for growth and for the role?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visible Impact&lt;/strong&gt;: Does the role allow me to have a fast impact and feedback cycles?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Growth&lt;/strong&gt;: Will I have a manager I can learn from?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Balance&lt;/strong&gt;: Can I maintain a great work/life balance while I do all above?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The short answer to all of the above was a clear “Yes”. I had found an organisation that was successful, stable, yet ripe-for-growth. I could see that everyone here has a chance to make a difference and observe the results quickly. I am glad that I will be working with a great team and be able to learn a lot from their experience in building and growing product engineering organisations. Finally, everyone seemed happy to work here and I can confirm for me the experience has been the same so far!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;There’s no better time to join Catawiki. So jump on the driver’s seat with us as we continue to accelerate into the future.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kgs0l_9D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9igeiq9ve773vdwy3l5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kgs0l_9D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9igeiq9ve773vdwy3l5.png" alt="The open door of an old Ferrari"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/jobs/companies/catawiki"&gt;Follow this link to join our community!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>catawiki</category>
      <category>career</category>
    </item>
    <item>
      <title>The iOS journey</title>
      <dc:creator>Maarten van der Velden</dc:creator>
      <pubDate>Fri, 30 Apr 2021 10:02:39 +0000</pubDate>
      <link>https://dev.to/catawiki/the-ios-journey-2lba</link>
      <guid>https://dev.to/catawiki/the-ios-journey-2lba</guid>
      <description>&lt;p&gt;Co-authored by &lt;a href="https://dev.to/steveleviathan"&gt;Steve Overmars&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Catawiki is more than a great website, we also develop and maintain native mobile apps for both Android and iOS. This post will cover the history of our iOS app and evolution of our technological stack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtkepicz50360ewff68h.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtkepicz50360ewff68h.jpeg" alt="Catawiki iOS app early days"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Early Days (2014-2016)
&lt;/h2&gt;

&lt;p&gt;When Catawiki was up-and-running as an &lt;a href="https://dev.to/catawiki/the-frontend-journey-ck"&gt;auction website&lt;/a&gt;, around 2013-2014, we started looking into new ways of reaching our customers and seeing opportunities in the world of smartphones. An external company was attracted to start work on native mobile apps for both Android and iOS and a dedicated API was set up to support this.Eventually the first internal iOS developers were hired to release and expand the app. Initially, this app only contained bidding and buying functionality.&lt;/p&gt;

&lt;p&gt;At that stage, the architecture of the app was pretty standard for its time: using Objective-C and an MVC architecture.The v1 generation of our app was only available on iPhone. In late 2015, we started working to make our app available on iPad, by making it universal. This means that we bundled iPhone and iPad screens in one app. It was released as our v2.0 in 2016, after testing this with external beta testers, for the first time. These testers were current app users and colleagues.&lt;/p&gt;

&lt;p&gt;In 2016, another team started building a separate app for Catawiki Sellers to submit lots for sale and to maintain an overview of these lots throughout the auction and sales process. With this change, we also slowly started introducing our first frameworks to be able to share code across the two apps.&lt;/p&gt;

&lt;p&gt;During this time, some pain points of the old approach became visible: having two separate apps made it harder to reuse the same code, having separate mobile teams and a dedicated mobile backend made it harder to keep feature parity with the backend and web teams, and increased the technical debt. It  was also confusing for users and hard to scale up the teams in a growing company.&lt;/p&gt;

&lt;p&gt;On a technical level, Swift was released and became a mature programming language and we started running into the issues with the MVC pattern: plenty of hard-to-maintain Massive View Controllers, lots of tight coupling which made maintenance difficult and new features that were hard to make.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifbizrssbouej7rjd0yl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fifbizrssbouej7rjd0yl.png" alt="Old Catawiki iOS iPad app version"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Towards a More Mature App (2017-2020)
&lt;/h2&gt;

&lt;p&gt;Around 2016-2017, a lot of big changes were about to happen to the Catawiki iOS app, both for users, for developers and for the code itself. After our first experiments with it in 2016, we decided to develop all new features in Swift from 2017 onwards.&lt;/p&gt;

&lt;p&gt;In 2017, we also integrated our seller app into our buyer app. We did this by extracting the seller code into an SDK, a separate Swift Framework, marking the start of modularisation of our code incrementally into separate frameworks. This became v3.0.&lt;/p&gt;

&lt;p&gt;To also start solving the maintenance issues involved with MVC, we started building new features in the &lt;a href="https://www.objc.io/issues/13-architecture/viper/" rel="noopener noreferrer"&gt;VIPER architecture&lt;/a&gt;. This has helped us a lot in giving our code more structure, making features and screens more reusable.&lt;/p&gt;

&lt;p&gt;Later in 2017, the development teams were reorganised and the mobile developers were integrated into full-stack feature teams. This helped us focus on getting rid of all the discrepancies between the mobile apps and web, including a push to use the same APIs for all three platforms.&lt;/p&gt;

&lt;p&gt;The combinations of all these changes, while still having a small team of around four iOS devs, meant that most of the transitions we started around this time weren’t completed overnight. Because there was also ongoing development for new features and fixes for our live app, we had to be very pragmatic in migrating to Swift, VIPER, Frameworks, and new APIs. We tried to do it all at once when a certain screen was scheduled for big features or changes, but in general the process required longer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesacge3ckv9aisfh0xv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesacge3ckv9aisfh0xv0.png" alt="Catawi iOS app home screen before rebranding"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A New Hope (&amp;amp; Brand) (2020-)
&lt;/h2&gt;

&lt;p&gt;We were heading in a good direction. We accelerated our evolution when we started work on the Catawiki 2.0 branding. Simultaneously, we grew our iOS platform team to nine developers. Because of this, we were able to focus on some of our oldest parts of the code, and bring them up to the latest standards. This is a good example of how we take managing our technical debt seriously. In September 2020, we were able to release the new brand (v4.0), and are continuing to migrate the last old parts of the app to make them Swift, VIPER and use up-to-date Microservice APIs, while also creating more Swift Frameworks. We expect this effort to be finally finished by the end of 2021.&lt;/p&gt;

&lt;p&gt;Will that mean iOS developers at Catawiki will be “done”? Besides our product and UX people coming up with ever new and improved features, we’re already looking towards the iOS tech stack of the future, like how SwiftUI could (or rather, will) replace UIKit in our app, and whether VIPER will still be a good architecture for us in that case.&lt;/p&gt;

&lt;p&gt;If you’d like to &lt;a href="https://stackoverflow.com/jobs/companies/catawiki" rel="noopener noreferrer"&gt;join us on our journey&lt;/a&gt; of continuously improving our apps and delighting our customers, give us a &lt;a href="//mailto:recruitment@catawiki.nl"&gt;shout&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkojjjmvavmc6ka3rsz2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkojjjmvavmc6ka3rsz2f.png" alt="Catawiki rebranded iOS app"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover photo by &lt;a href="https://unsplash.com/@ernestovdp" rel="noopener noreferrer"&gt;Ernesto Velázquez&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>catawiki</category>
      <category>history</category>
      <category>ios</category>
    </item>
    <item>
      <title>Where did our monolith go?</title>
      <dc:creator>Vladimir Bobrov</dc:creator>
      <pubDate>Thu, 01 Apr 2021 10:24:07 +0000</pubDate>
      <link>https://dev.to/catawiki/where-did-our-monolith-go-2d12</link>
      <guid>https://dev.to/catawiki/where-did-our-monolith-go-2d12</guid>
      <description>&lt;p&gt;There is a lot to be said on the pros and cons of a monolith vs microservice software design (just Google a few). To briefly sum things up; while monolith applications are often still the best choice, organisations are increasingly leaning toward microservices architecture. Many companies recognise the importance of increasing overall engineering efficiency through team/unit autonomy and access to a wider labour market. And most are facing similar challenges in their journey to microservices.&lt;/p&gt;

&lt;p&gt;Starting a transformation without a plan imposes significant risks. Many challenges must be tackled beforehand which play a foundational role in the success of adopting a monolith system. These include data input, output, processing, error handling, and the UI, which are usually written once and reused across the whole monolith.&lt;/p&gt;

&lt;p&gt;Now, imagine multiplying these entities by the amount of stacks or a number of services we envision to expand into. Missing a common layer and principles across services will harm engineering efficiency by a lot. After all, if engineers are to produce tangible value. we must address common problems before we can put a foot in new water on a scale of 50+ people.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get ready
&lt;/h2&gt;

&lt;p&gt;At Catawiki, we’ve built a foundation with an app skeleton repo, automation and guidelines to enable teams to consistently deliver new services. Besides that, we've built libraries with the most essential tools helping us to streamline integration. This simple 2-step plan is for many adopters often  just the tip of the iceberg. And the hidden part is bigger, further away we are from Cloud Native toolchain.&lt;/p&gt;

&lt;p&gt;Organisational-wide standards are vital for the success of the microservices journey. It is best to start early with an internal SDK, OpenAPI specification and infrastructure as code. Nowadays, these problems are solved with a myriad of services, tools and well-established standards. Some monolith code will likely come in handy or become a blueprint for a common library that each app may depend on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Focus on Data
&lt;/h2&gt;

&lt;p&gt;Most applications are dealing with data and underlying storage. While an application layer is usually scaled by simply multiplying compute workload, a data layer eventually becomes a bottleneck.&lt;/p&gt;

&lt;p&gt;Inefficient data structures and data-querying algorithms are the biggest problems we'll have to deal with when scaling an application. Frederick Brooks, the author of &lt;a href="https://en.wikipedia.org/wiki/The_Mythical_Man-Month" rel="noopener noreferrer"&gt;The Mythical Man-Month&lt;/a&gt;, says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The programmer's primary weapon in the never-ending battle against slow systems is to change the intramodular structure. Our first response should be to reorganize the modules' data structures.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Microservices can bring in significant costs if the data design is not addressed properly. Replacing in-process code execution with cross-host API calls via extra virtual and physical processes costs user time and is more expensive for businesses to operate. In fact, the efficiency of any service depends on how data is stored and exchanged among services.&lt;/p&gt;

&lt;p&gt;As the data architecture becomes so important, we'll have to be smart about how we denormalise and exchange it. Categorise data and its usage, establish data exchange rules and apply the right tools for specific use cases. It is always difficult to change data structures at a later stage, so best to ensure storage scales x10-x100 times and return the right value for the years ahead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Realising the effort
&lt;/h2&gt;

&lt;p&gt;When everything is moving fast in a growing business, it’s not easy to change overnight. To create a system developed from scratch by five people over five years, a quick estimate suggests the time needed amounts to at least 50.000 hours of engineering work. Of course, rebuilding a monolith into microservices might be less expensive than the original investment, as we may borrow from the old system some code and established business logic.&lt;/p&gt;

&lt;p&gt;However, for an established business, a rapid rebuild from scratch is usually not an option as it requires us to stop feature development in the old system to avoid ending up a never-ending cycle of catching up with updates. This means that we have to build a new system and features working alongside the old one, exchanging and duplicating data and features, in order to provide clients with a gradual transition away from the original system..&lt;/p&gt;

&lt;p&gt;It's true that an effort like this can cost any company a huge amount of time and resources. Nevertheless, organisational and innovation benefits of modern Service Oriented Architecture (and Microservices specifically) will easily outweigh any benefits of a Monolith system in the long run. To make a transition successful and get buy-in from the company at large, it is important to plan things ,with a clear rationale as to why you’re doing this and an understanding of the goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Be organised
&lt;/h2&gt;

&lt;p&gt;An organisation with hundreds of people is a complex structure. After years of slow progress in our journey to Microservices, we've realised a lot of things. Perhaps the most important one is that this challenge is purely in the hands of engineers and as such must be driven by engineers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zxfb6jb3mwuttx70x8j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zxfb6jb3mwuttx70x8j.jpg" alt="Software engineers planning on a task board"&gt;&lt;/a&gt;&lt;/p&gt;
Photo by &lt;a href="https://unsplash.com/@airfocus" rel="noopener noreferrer"&gt;airfocus&lt;/a&gt; on &lt;a href="https://unsplash.com/" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;


  

&lt;p&gt;To better organise ourselves, we've built a company-wide Engineering Roadmap reflecting all steps of migration, accounting for people we have and/or will be hired this year. And with a clear vision of what this is going to bring us, we've committed to making a huge leap this year toward a better, more efficient and scalable foundation of our unique platform for passionate enthusiasts all around the world.&lt;/p&gt;

&lt;p&gt;A few months later down the road, we're extremely satisfied with the results and the progress we've made so far. Although this year has just started, we are already planning for exciting engineering challenges in 2022 and beyond!&lt;/p&gt;




&lt;p&gt;Cover photo by &lt;a href="https://unsplash.com/@bobajaglicic" rel="noopener noreferrer"&gt;Boba Jaglicic&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>microservices</category>
      <category>monolith</category>
    </item>
    <item>
      <title>The Frontend journey</title>
      <dc:creator>Srgjan Dimitrijevikj</dc:creator>
      <pubDate>Wed, 17 Feb 2021 16:18:09 +0000</pubDate>
      <link>https://dev.to/catawiki/the-frontend-journey-ck</link>
      <guid>https://dev.to/catawiki/the-frontend-journey-ck</guid>
      <description>&lt;p&gt;In this post, we will briefly go through how the frontend adapted with the changes of our platform. Catawiki has a rich history and because of that, developers have had to be creative. In follow-up posts, we’ll be diving deeper on what the impact of those changes has been on the tech side, but first – the overview!&lt;/p&gt;

&lt;h3&gt;
  
  
  From the beginnings till the first major investment - (2008-2014)
&lt;/h3&gt;

&lt;p&gt;As you might have already read on our blog, &lt;a href="https://dev.to/catawiki/so-how-did-we-begin-gfl"&gt;Catawiki started out&lt;/a&gt; as a catalogue for stamps and comic books.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspal7s3qdaxwssvs1v8o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspal7s3qdaxwssvs1v8o.png" alt="Catawiki home page in it's early days" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the time of Catawiki’s release in 2008, the popular framework was &lt;strong&gt;Ruby on Rails&lt;/strong&gt;. Rails was the natural choice for the type of content that the founders wanted to share with the public and it turned out to be the right one for the job. The content was static, the admin panel was simple and the work on the site was efficient. “Frontend” was not really a thing back then as most people worked on full stack development. The more dynamic parts of the site were made with the help of jQuery. And for the needs of our platform, jQuery was the perfect tool for the job; alongside Ruby on Rails, jQuery enabled development to move fast and efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Catawiki gets serious (2014-2020)
&lt;/h3&gt;

&lt;p&gt;For Frontend, this was the most interesting period. In 2014 and 2015, Catawiki received big rounds of investment. There was confidence in the company’s business model and to accommodate the growth planned,  a solid technical foundation was needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm9km9gsa3vu5d4ab9sz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm9km9gsa3vu5d4ab9sz.png" alt="Catawiki home page early 2020" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With more people working on the platform and more needs, it was clear that we needed to introduce some new tooling to accommodate these changes. After having a look at the technology landscape at the time we have given some thought of what fits best for our platform, the expertise of the engineering team at Catawiki and the level of support from the open source community.&lt;/p&gt;

&lt;p&gt;So here is the shortlist of important technologies:&lt;/p&gt;

&lt;h4&gt;
  
  
  React
&lt;/h4&gt;

&lt;p&gt;It was the up-and-coming library at the time, with the backing of a big company which made us confident in introducing it to Catawiki. It enabled us to write reusable UI components at scale with a very nice unidirectional data flow way of thinking. The support of the open source community has improved our velocity with tackling difficult problems with ready made solutions. The simplicity of the tool has also enabled the wider engineering team (Backend) to be able to contribute to our codebase with the same quality and efficiency.&lt;/p&gt;

&lt;p&gt;After almost 5 years of writing React at Catawiki, we can say with confidence that it was the right choice. It remains the most popular library, it stays true to what it is, and the popularity and ease of use has made hiring easy.&lt;/p&gt;

&lt;h4&gt;
  
  
  TypeScript
&lt;/h4&gt;

&lt;p&gt;At some point our codebase and contributor count started growing rapidly. One of the ideas was to introduce typing to our frontend codebase. We initially introduced Flow from Facebook, but after some playing around with Typescript and the initial experience with Flow, we decided to go with Typescript. The major reasons were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better error messages in Typescript&lt;/li&gt;
&lt;li&gt;No need to version the type definitions like Flow (~20k lines)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It has proven useful when rewriting bigger code chunks and making the code more explicit, which in turn has helped people unfamiliar with the code learn faster.&lt;/p&gt;

&lt;h4&gt;
  
  
  Webpack
&lt;/h4&gt;

&lt;p&gt;Finally, Webpack has been a rock-solid choice at Catawiki, especially since the introduction of the &lt;strong&gt;Webpacker&lt;/strong&gt; gem that seamlessly integrates Webpack into the Rails framework assets pipeline. We have briefly considered tools like Rollup but the ecosystem around Webpack has proven to be good enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Catawiki 2.0 2021
&lt;/h3&gt;

&lt;p&gt;We have just rebranded the look of Catawiki across all of our platforms.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpmbpt74f0fwahojqr7j0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpmbpt74f0fwahojqr7j0.png" alt="The new look of the Catawiki home page" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While we’re still happy with our current tools, looking at where we are now, we want to further integrate those tools to keep on improving the development and user experience.&lt;/p&gt;

&lt;p&gt;To accommodate for that we are working on the following:&lt;/p&gt;

&lt;h4&gt;
  
  
  NextJS
&lt;/h4&gt;

&lt;p&gt;Rails has been a blast so far but we want to go a step further and unify the technologies from the server to the client. Using NodeJS to serve our markup has been the natural choice but NextJS will bring that experience to the next level (pun intended). Right now, we are working on our first frontend specific microservice written with NextJS.&lt;/p&gt;

&lt;h4&gt;
  
  
  fp-ts/io-ts
&lt;/h4&gt;

&lt;p&gt;To bring typing to the next level at Catawiki, we have introduced io-ts, which enables runtime typing checking for IO bound operations like API calls. io-ts is part of the fp-ts ecosystem and brought in a dash of functional programming flavour to our code base, for a more declarative way of solving problems.&lt;/p&gt;




&lt;p&gt;Cover photo by &lt;a href="https://twitter.com/kaleidico" rel="noopener noreferrer"&gt;@kaleidico&lt;/a&gt; from &lt;a href="https://unsplash.com/photos/26MJGnCM0Wc" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>catawiki</category>
      <category>history</category>
      <category>frontend</category>
      <category>react</category>
    </item>
    <item>
      <title>Changing the rails</title>
      <dc:creator>Vladimir Bobrov</dc:creator>
      <pubDate>Mon, 30 Nov 2020 17:23:32 +0000</pubDate>
      <link>https://dev.to/catawiki/changing-the-rails-1ich</link>
      <guid>https://dev.to/catawiki/changing-the-rails-1ich</guid>
      <description>&lt;p&gt;When an online business takes off, there is always an imminent desire to be at the forefront of technology. An increasing belief that the business is on the right track fuels a fear of falling behind competitors — a feeling that can help push a company to success as much as it can hold it back. In the very beginning of our journey, Catawiki made a few technological choices it owes a large part of its success to. &lt;/p&gt;

&lt;p&gt;Back in 2008, it was hard to find a more prominent web-development framework than Ruby on Rails. Even though Ruby as a programming language was never the most popular one, the shift of paradigm in web-development introduced by the Rails core team predetermined the success of the framework. As for many emerging Web 2.0 businesses, it was the obvious choice that helped us to focus on things that matter — continuous innovation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges faced
&lt;/h2&gt;

&lt;p&gt;Six years after Catawiki was founded, the moment to make a bigger technological leap to support expansive growth arrived, facilitated by the company’s global recognition&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. By the end of 2014, we at Catawiki faced the inevitable question: “how can we best support our business growth with our current technology while keeping the promises we’ve made to our customers?”.&lt;/p&gt;

&lt;p&gt;What is a simple question at first glance became more complicated when we look at what challenges we had already been facing and what that meant  for scaling our platform 10 100 times. Some of the challenges included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regular outages and “Friday’s on fire” caused by the increase of visitors and bidders&lt;/li&gt;
&lt;li&gt;On-premises infrastructure with a high degree of manual system management&lt;/li&gt;
&lt;li&gt;Lack of development and staging automation constraining engineering team growth&lt;/li&gt;
&lt;li&gt;Monolith service combining practically two different businesses — auctioneering and collectors platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tackling the issues
&lt;/h2&gt;

&lt;p&gt;Even though these challenges looked frightening, we had a great team of engineers who recognised the issues and acted on opportunities to improve every day. The most significant challenge that popped up on the radar was not just to double or triple the engineering team to cope with increased amounts of issues and support business objectives, but to rethink the way we build things for the future.&lt;/p&gt;

&lt;p&gt;One of the first things we tried to do was to move away from the monolith service by building new features (or rebuilding old ones) in a standalone application. This approach, which at first seemed promising, proved to be unsuccessful in the end, yet it brought us lots of learnings.&lt;/p&gt;

&lt;p&gt;Monolith systems can be successful and in the early stages of business development this is the only way forward. Many businesses wouldn’t reach their success if the only thing they cared about was pure engineering excellence. In the end what makes great products successful is actually trying, failing a few times before finally succeeding in what you believe could work for many people. This in turn creates a large amount of technical debt a successful company should solve sooner or later when the business takes off.&lt;/p&gt;

&lt;p&gt;By the beginning of 2015, we were a few months away from doubling our engineering team to about 25 engineers and we realised we needed to make our own shift in how we were going to shape our technological future.&lt;/p&gt;

&lt;p&gt;Stay tuned to find out more about Catawiki's journey and what led us to success!&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://www2.deloitte.com/gr/en/pages/technology-media-and-telecommunications/articles/fastest-growing-tech-companies-emea.html"&gt;https://www2.deloitte.com/gr/en/pages/technology-media-and-telecommunications/articles/fastest-growing-tech-companies-emea.html&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>catawiki0</category>
      <category>rails</category>
      <category>monolith</category>
      <category>history</category>
    </item>
    <item>
      <title>Meet the Catawikians: Bozhidar</title>
      <dc:creator>Iulia Nicolaie</dc:creator>
      <pubDate>Thu, 12 Nov 2020 16:40:37 +0000</pubDate>
      <link>https://dev.to/catawiki/meet-the-catawikians-bozhidar-1pjo</link>
      <guid>https://dev.to/catawiki/meet-the-catawikians-bozhidar-1pjo</guid>
      <description>&lt;p&gt;Hi, I’m Iulia. I’m part of Catawiki’s recruiting team. We’re responsible for bringing high-quality humans to Catawiki across our offices.&lt;/p&gt;

&lt;p&gt;During my time here, I’ve talked to a lot of developers who are curious about working for Catawiki. So I thought that it would be nice to start sharing what it’s like to work here by having some quick coffee chats with our engineers.&lt;/p&gt;

&lt;p&gt;Today, I would like to introduce you to Bozhidar, our software engineer from the payments team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hi Bozhidar! Would you mind telling us a little bit about yourself?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hello! I am Bozhidar and I’ve worked as a software engineer for about 4 years already. I’ve been working full time at Catawiki as a software engineer while also pursuing a part-time International Business bachelor. My interests gravitate towards tech, leadership, and psychology, wildlife, and sustainability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What attracted you to Catawiki in the first place?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think the first thing is the marketplace approach. Coming from Uber and looking at other companies like Amazon, Google, Valve, etc. I strongly believe the marketplace model is a strong one in this digital world. During my interview process, I was impressed both by the technology that Catawiki is using as well as the kind of people that work here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s wonderful to have you here. Since a lot of our audience probably isn’t familiar with Catawiki, could you talk about the company and the work that you do there?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Catawiki is not the place you go to in order to satisfy your “musts” and “needs”. It’s the place you go to when you want to satisfy your “wants”. Or as I like to say, it’s the place you visit when you want to treat yourself to something special. It is a curated marketplace for all kinds of special objects you can’t find elsewhere. Whether that’s an ancient gold coin, another post stamp for your stamp collection, or a Porsche 911 from the 70s, Catawiki is where you will be able to find these special items and many more. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Could you tell us a little bit about your role and a little bit about what this Payments team is at Catawiki?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My role as a software engineer in the Payments domain and the team’s role, in general, is to keep the quality bar for money movements as high as possible. There are three main pillars that play a role here - reliability, speed, and safety/security. There are teams inside Catawiki that work solely on the supply side or on the demand side, but in payments, we are at the cross-section of the two. &lt;br&gt;
On the demand side, we are responsible for processing payments from our buyers while offering as many options of payment types as possible. On the supply side, we are responsible for verifying that our sellers are compliant (to prevent fraudsters) and also for making sure the ones that are verified and sell objects receive their money. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is special and particular about software engineering at Catawiki?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I would say the special and surprising part for me was to see how much infrastructure and tooling exists behind the scenes that are ready to serve the developer. There is an entire platform engineering team whose sole job is to optimise, automate and provide tooling so that their client (the other engineers) can focus on what’s really important, which in most cases would be the end-user business logic. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Could you share any advice for software engineers who would like to join Catawiki?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I think whether you’re a senior engineer or not, one thing that is very important in this ever-changing world is to stay open-minded. Being in an organisation with people from more than 50 nationalities plays a huge role in collaboration. At the end of the day, no matter how senior someone is, a person can move very fast alone, but they can go further together as a team. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finally, are there any books or blogs or other resources that you’ve found helpful recently?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, there is one book, which I actually read quite some time ago, but I often think about it especially as a software engineer. It’s by Cal Newport (who is actually a computer science professor at Georgetown University) and the book is Deep Work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So inspiring. Thank you for your time Bozhidar!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thank you as well Iulia, looking forward to the next coffee chat.&lt;/p&gt;

</description>
      <category>coffee</category>
      <category>ourteam</category>
      <category>interview</category>
      <category>catawikians</category>
    </item>
    <item>
      <title>So how did we begin?</title>
      <dc:creator>Vladimir Bobrov</dc:creator>
      <pubDate>Thu, 05 Nov 2020 11:34:17 +0000</pubDate>
      <link>https://dev.to/catawiki/so-how-did-we-begin-gfl</link>
      <guid>https://dev.to/catawiki/so-how-did-we-begin-gfl</guid>
      <description>&lt;p&gt;Perhaps it would be good to take a tour far back to 2008 and give our audience a picture of where, we as a business, came from.&lt;/p&gt;

&lt;p&gt;Originally Catawiki was built by two Dutch gentlemen (René and Marco) with the idea to help collectors around the world organise and exchange their items. As it usually happens, one of the founders (René) thought the idea could actually work as he was himself a passionate Tintin comic strips collector. And the other founder (Marco) knew how to build it.&lt;/p&gt;

&lt;p&gt;Catawiki went live in 2008 and was designed as a catalog system with detailed information about items as if it were a wiki. Hence where the Catawiki name comes from!&lt;/p&gt;

&lt;p&gt;Thanks to WaybackMachine we can even show you how it looked like back then&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1rt0t7tkzv7w3438g1ej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1rt0t7tkzv7w3438g1ej.png" alt="catawiki website in 2008"&gt;&lt;/a&gt;&lt;/p&gt;
via: &lt;a href="https://web.archive.org/web/20080914004650/http://www.catawiki.nl/" rel="noopener noreferrer"&gt;web.archive.org/web/20080914004650/http://www.catawiki.nl&lt;/a&gt;



&lt;p&gt;Just a few years after, in the mid-November of 2011, Catawiki hosted its very first auction. Since then the Catawiki business as we know it today started taking off.&lt;/p&gt;

&lt;p&gt;You can even find how the advertisement campaign of this exciting moment looked like (on the right side of this screenshot)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx2938loqypwg02fq1ht1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx2938loqypwg02fq1ht1.png" alt="catawiki website in November 2011"&gt;&lt;/a&gt;&lt;/p&gt;
via: &lt;a href="https://web.archive.org/web/20111215035153/http://www.catawiki.nl/" rel="noopener noreferrer"&gt;web.archive.org/web/20111215035153/http://www.catawiki.nl&lt;/a&gt;



&lt;p&gt;And if you are curious about what was the very first lot that was auctioned and successfully sold on Catawiki, here you go&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz1g96qu3wek4xr4avnrv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz1g96qu3wek4xr4avnrv.jpg" alt="Storm 1 comic cover"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.catawiki.com/l/29" rel="noopener noreferrer"&gt;“Storm 1 - De diepe wereld, Hardcover, 1e Druk 1978”&lt;/a&gt; was our very first lot sold in Comics Auction (Dutch). Starting with the initial bid of just €5 the price rose x17 times and it went for an impressive €85!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Storm_(Don_Lawrence)" rel="noopener noreferrer"&gt;Storm is a soft science fiction/fantasy comic book series&lt;/a&gt;, just one of many others you can find on Catawiki platform among many-many other objects. Stamps, coins, paintings, jewelry, cars are just some of the dozens of object categories. Whether you are a passionate enthusiast or a collector seeking for a missing piece, you have a pretty high chance to find what you’re looking for!&lt;/p&gt;

&lt;p&gt;Wow, what a “selling” detour we’ve just made! 😊&lt;/p&gt;

&lt;p&gt;Let's think for a moment about the tools we employed back then to bring Catawiki online:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rails&lt;/strong&gt; - the most modern and powerful web development framework the world has ever seen by that time!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt; - Internet as we know it wouldn’t exist without.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS&lt;/strong&gt; - without it Catawiki website would look like from ‘90s.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;jQuery&lt;/strong&gt; - breaking through DHTML technology, still used by 73% of the 10 million most popular websites by mid-’19 (according to Wikipedia).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Solr&lt;/strong&gt; - enterprise-search platform using Lucene search engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MySQL&lt;/strong&gt; - “the World’s Most Popular Open Source Database” which was hard to argue about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux&lt;/strong&gt; - to run all of the above on the Internet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Throughout the years we’ve changed quite a few things: half of the stack was replaced with more modern tools and another half has changed so much that you can hardly find a similarity. And of course, we have added a few dozens of newer tools and technologies! 😅&lt;/p&gt;

&lt;p&gt;What stayed the same was continuous change. That thing which is not always easy and many times compared with “changing the tires of a car which is running at full speed, staying on top of it”.&lt;/p&gt;

&lt;p&gt;And this is exactly what we will be talking about in our next blog posts!&lt;/p&gt;

</description>
      <category>catawiki0</category>
      <category>auctions</category>
      <category>history</category>
    </item>
    <item>
      <title>Hello World!</title>
      <dc:creator>Vladimir Bobrov</dc:creator>
      <pubDate>Thu, 15 Oct 2020 07:49:35 +0000</pubDate>
      <link>https://dev.to/catawiki/hello-world-34nc</link>
      <guid>https://dev.to/catawiki/hello-world-34nc</guid>
      <description>&lt;p&gt;Perhaps any Engineer remembers the excitement of seeing this very first message when their first program or webpage comes to life! And so here we are at Catawiki, excited about the launch of our Engineering Blog&lt;/p&gt;

&lt;p&gt;The idea behind having a Catawiki Engineering blog didn’t come overnight and was rather hanging in the air for a few years. We’ve put a good amount of diligence to embark on this journey, being completely sure we will provide useful content for our visitors and engage with our audience in a meaningful way.&lt;/p&gt;

&lt;p&gt;At Catawiki, we’re building our amazing product with the help of incredible engineering concepts and tools like Cloud, Kubernetes, Microservices and BigData. It is not a secret that those can be used and built in many different ways, and despite our struggle to find the best solution for a specific purpose, we cannot claim that our way is the only true way to build things right.&lt;/p&gt;

&lt;p&gt;Nevertheless, we believe that sharing the Catawiki Engineering stories will help many of our peers. Especially those who may be looking for examples of the same or similar problems they are faced with as part of an emerging tech organisation.&lt;/p&gt;

&lt;p&gt;We are aiming to share our stories of successes and failures. Although you may find more of the former ones and less of the later ones, we will make sure to share the essential learnings we went through on the way to success. We believe we can achieve greater success if we help our readers avoid falling into traps, as those might be easy to overlook in the landscape of the current technology environment.&lt;/p&gt;

&lt;p&gt;We also think it is important to share our stories in a structured form. We will post stories on different topics: Frontend, Backend, Mobile, Systems, Data, Security, Reliability, etc. Any post will be tagged with a corresponding topic name. And that’s not all!&lt;/p&gt;

&lt;p&gt;Many companies during their growth from a small startup to a unicorn follow very similar phases. Especially during the migration to Microservices! Thus we would like to present our readers with some content which clearly pertains to different phases of our development. To make the posts stand out, our authors will tag them by corresponding phase names.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Years&lt;/th&gt;
&lt;th&gt;What is this phase about?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Catawiki 0.0&lt;/td&gt;
&lt;td&gt;2011-2014&lt;/td&gt;
&lt;td&gt;Ancient times, before the expansive growth of Catawiki.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catawiki 1.0&lt;/td&gt;
&lt;td&gt;2015-2017&lt;/td&gt;
&lt;td&gt;Our journey to Service Oriented Architecture (Microservices) begins, we can even call it the Great Expansion. Phase when we’ve focused on building facades around our Monolith system.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catawiki 2.0&lt;/td&gt;
&lt;td&gt;2018-2020&lt;/td&gt;
&lt;td&gt;Phase when our Microservices Universe cooled down and we started departing from Monolith. We also call it Independence from Monolith.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catawiki 3.0&lt;/td&gt;
&lt;td&gt;2021+&lt;/td&gt;
&lt;td&gt;Time when we’ll finally say “Farewell Monolith...” and open the door to the new world!&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We hope you will find our posts as useful and interesting as we’ve found it challenging to wade through the building of modern Engineering at Catawiki!&lt;/p&gt;

</description>
      <category>helloworld</category>
    </item>
    <item>
      <title>What are Web Standards and how does Web Browser work?</title>
      <dc:creator>Ilya Lyamkin</dc:creator>
      <pubDate>Wed, 27 May 2020 13:10:38 +0000</pubDate>
      <link>https://dev.to/catawiki/what-are-web-standards-and-how-does-web-browser-work-3a1k</link>
      <guid>https://dev.to/catawiki/what-are-web-standards-and-how-does-web-browser-work-3a1k</guid>
      <description>&lt;p&gt;Let me tell you a story. Once I was building yet another date picker component for our design system. It consists of text input and pop-up with a calendar that shows by clicking on it. Then pop-up can be closed on click outside or if the date was selected.&lt;/p&gt;

&lt;p&gt;Most implementations of the click outside logic made with actual click listeners attached to the DOM. However, I wanted to build our date picker accessible, so you could open a calendar with tabs and close the same way. Additionally, click listeners may conflict with each other if you put several date pickers on the page.&lt;/p&gt;

&lt;p&gt;What if you could just rely on native focus and blur events instead of detecting clicks outside? They naturally support tabs, touch and click events, and already implemented in the browser. The only problem you need to solve in this case is when you click on the pop-up but without date selection: focus shifts to the calendar, triggering blur event on the text input and eventually closing the pop-up.&lt;/p&gt;

&lt;p&gt;At this point, I started wondering if there is a way to click but do not shift a focus. After quick googling, I found a way to do it: prevent the default action of the &lt;code&gt;mouseDown&lt;/code&gt; event for the pop-up. Just like that in one line, all clicks worked but the focus was still on the text input.&lt;/p&gt;

&lt;p&gt;It seemed like that's the solution, let's move forward, but something inside of me was stopping me from that. Why specifically &lt;code&gt;mouseDown&lt;/code&gt; and not &lt;code&gt;mouseUp&lt;/code&gt; prevents focus but propagates click? Is it some part of the living standards? Can we rely on that? Does it work cross-browser? React Testing Library that we used to do integration tests also didn't support it and I'd have to change simulation function.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Web Standard?
&lt;/h2&gt;

&lt;p&gt;Alright, since the Stack Overflow answer wasn't enough for me, so what could be a better place to learn about browser behavior than the web standards?&lt;/p&gt;

&lt;p&gt;You probably heard about &lt;a href="https://www.w3.org/"&gt;W3C&lt;/a&gt; or World Wide Web Consortium. It's an international community that develops open standards for the Web. W3C makes sure that everyone follows the same guidelines and we don't have to support dozens completely different environments. If you visit their website, you'll find the list of &lt;a href="https://www.w3.org/TR/"&gt;all standards&lt;/a&gt; they're working on.&lt;/p&gt;

&lt;p&gt;Let's have a look at the one document that might have an answer to our questions -  &lt;a href="https://www.w3.org/TR/2019/WD-uievents-20190530/"&gt;UI Events Standard&lt;/a&gt;. This document specifies the DOM event flow, defines a list of events and their execution order. If you thought that standards are boring, obscure, and hard-to-understand text blocks, then jump straight to &lt;a href="https://www.w3.org/TR/2019/WD-uievents-20190530/#dom-event-architecture"&gt;DOM Event Architecture&lt;/a&gt; section that explains event bubbling and capturing with nice pictures and still being very specific as standard supposed to be. You'd be surprised by the quality of it, it's really well-written with a lot of examples and recommendations.&lt;/p&gt;

&lt;p&gt;It also has a definition of our &lt;code&gt;mouseDown&lt;/code&gt; event and its default actions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Many implementations use the mousedown event to begin a variety of contextually dependent default actions. These default actions can be prevented if this event is canceled. Some of these default actions could include: beginning a drag/drop interaction with an image or link, starting text selection, etc. Additionally, some implementations provide a mouse-driven panning feature that is activated when the middle mouse button is pressed at the time the mousedown event is dispatched."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Alright, so our event has some default actions, but there is nothing specific about focus because it really depends on browser implementations. Let's check them out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to browser engines
&lt;/h2&gt;

&lt;p&gt;A modern browser is a quite complicated piece of software with the codebase around &lt;a href="https://www.openhub.net/p/chrome/analyses/latest/languages_summary"&gt;tens of millions of lines of code&lt;/a&gt;. So it's usually split into several parts.&lt;/p&gt;

&lt;p&gt;To find a place where focus events are defined, we need to get an overview of what each part is responsible for. Let's start with Chromium and its design documentation &lt;a href="https://www.chromium.org/developers/how-tos/getting-around-the-chrome-source-code"&gt;Getting Around The Chrome Source Code&lt;/a&gt;. As you can see there is a lot of modules responsible for different logic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rDRMqAv5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lyamkin.com/static/48fb9b01019e15ebc2175863dd8f03e6/669eb/chromium.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rDRMqAv5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lyamkin.com/static/48fb9b01019e15ebc2175863dd8f03e6/669eb/chromium.png" alt="A high-level overview of Chromium"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's briefly go over them to get the idea of how it works together.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;chrome&lt;/strong&gt;: it's a base app with startup logic, UI, and all windows. It contains the projects for &lt;code&gt;chrome.exe&lt;/code&gt; and &lt;code&gt;chrome.dll&lt;/code&gt;. Resources such as icons or cursors you can also find here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;content&lt;/strong&gt;: it's a backend of the app which handles communication with child processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;net&lt;/strong&gt;: this is the networking library that helps to make queries to websites.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;base&lt;/strong&gt;: a place for common code shared between all sub-projects. This could include things like string manipulation, generic utilities, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;blink&lt;/strong&gt;: it's a rendering engine that responsible for the whole rendering pipeline including DOM trees, styles, events, V8 integration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;v8&lt;/strong&gt;: a final big part of a browser - Javascript engine. Its job is to compile JavaScript to native machine code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see browser consist of several independent parts that talk to each other via API. The most interesting parts for developers are usually Blink and V8. Browser defined default actions are not part of V8, but Blink should have all of them defined and implemented. But before we jump into the Blink codebase, let's understand how web browsers work from a user point of view.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rendering pipeline
&lt;/h2&gt;

&lt;p&gt;Imagine you enter domain address in a browser, then it fetches and loads a bunch of assets: HTML, CSS, and JS files, images, icons. But what would happen next?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TVA88qTh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lyamkin.com/static/e41e7cf5396a09a2ffcf6cd64aa9b3f0/c83ae/rendering-pipeline.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TVA88qTh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lyamkin.com/static/e41e7cf5396a09a2ffcf6cd64aa9b3f0/c83ae/rendering-pipeline.png" alt="Web browser rendering pipeline"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a first step, HTML files would be parsed and turned into a &lt;strong&gt;DOM tree&lt;/strong&gt;. The DOM is not only the internal representation of the page but also an API exposed to Javascript for querying or modifying the rendering through a system called "bindings".&lt;/p&gt;

&lt;p&gt;After the DOM tree, the next step is to process the CSS styles. For that purpose browsers have a CSS parser that builds a model of the style rules. Having built a model for style rules, we can merge them together with a set of default styles supplied by the browser and compute the final value of every style property for every DOM element. This process is called &lt;strong&gt;style resolving (or recalc)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the next &lt;strong&gt;layout&lt;/strong&gt; part, we need to determine the visual geometry of all the elements. At this stage each element gets its coordinates (x and y), width, and height. The layout engine calculates and keeps records of all overflow areas - which part is visible and which is not.&lt;/p&gt;

&lt;p&gt;As we got all coordinates for all elements, it's time for &lt;strong&gt;painting&lt;/strong&gt;. For this operation, we use coordinates from the previous step and color from style rules and combine them into a list of painting instructions. It's important to paint elements in the right order so that they stack correctly when they overlap. You can modify order via &lt;code&gt;z-index&lt;/code&gt; style rule.&lt;/p&gt;

&lt;p&gt;Let's execute our list of painting instructions and convert them into a bitmap of color values. This stage is called &lt;strong&gt;raster&lt;/strong&gt;. At this moment we also take our images and decode them into bitmap as well.&lt;/p&gt;

&lt;p&gt;Later the rastered bitmap will be stored in &lt;strong&gt;GPU&lt;/strong&gt; memory. This stage includes libraries that abstract the hardware and issuing calls to OpenGL and DirectX on Windows. When GPU receives the instructions to display bitmap, it draws pixels on your screen.&lt;/p&gt;

&lt;p&gt;Now we have the most important parts of the rendering pipeline. But what would happen if you scroll the page, or some animation would be applied? In fact, rendering is not static. Change is represented via &lt;strong&gt;animation frames&lt;/strong&gt;. Each frame is a complete rendering of the state of the content at a particular point in time. The real challenge in this process is its performance. Smooth animations require generation at least 60 frames per second. It would almost impossible to complete a full pipeline 60 times in a second especially on slow devices.&lt;/p&gt;

&lt;p&gt;What if instead of always re-rendering everything, we provide a way to &lt;strong&gt;invalidate&lt;/strong&gt; an element at a specific stage. E.g. if you change the color of the button dynamically, the browser will mark this node as invalidated and it would be re-rerendered on the next animation frame. If nothing is changed we can reuse the old frame.&lt;/p&gt;

&lt;p&gt;That's a good way to optimize small dynamic changes in the content. Let's think about change in big regions of content. For example, if scroll the page, all pixels have to be different now. For that purpose a page is decomposed into layers that raster independently. A layer can be fairly small and represent only one DOM node. Those layers then will be combined together on another thread called &lt;strong&gt;the compositor thread&lt;/strong&gt;. With this optimization you don't need to re-raster everything, but rather do it for small layers and then correctly combine them together.&lt;/p&gt;

&lt;p&gt;Now we have a little overview of what Blink does and how rendering pipeline looks like. Let's dive into the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigating Blink codebase
&lt;/h2&gt;

&lt;p&gt;It seems like we are finally at the finish line. Let's open the &lt;a href="https://chromium.googlesource.com/chromium/blink/+/master/Source"&gt;Blink repository&lt;/a&gt; and look around.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S5u3M3Cv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lyamkin.com/static/4c7ba19c91567494a8cdf7a5a1ab420f/b17f8/root-folder.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S5u3M3Cv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lyamkin.com/static/4c7ba19c91567494a8cdf7a5a1ab420f/b17f8/root-folder.jpg" alt="The root folder of Blink repository"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can quickly realize that even though we narrowed down a lot from our original question, it's still too big to manually find a specific line of code responsible for preventing focus.&lt;/p&gt;

&lt;p&gt;Let's try to search by our event name in Google:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;mousedown site:https://chromium.googlesource.com/chromium/blink/+/master/Source
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It leads us to the &lt;a href="https://chromium.googlesource.com/chromium/blink/+/master/Source/core/input/EventHandler.cpp#972"&gt;EventHandler&lt;/a&gt; file where you can find implementation details for a lot of input events. Including the most important line for us:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;swallowEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;dispatchMouseEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EventTypeNames&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;mousedown&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;innerNode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;m_clickCount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mouseEvent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;dispatchMouseEvent&lt;/code&gt; return value means "continue default handling", so &lt;code&gt;swallowEvent&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; in case of &lt;code&gt;preventDefault&lt;/code&gt; usage.&lt;/p&gt;

&lt;p&gt;Just below there is a call for focus event which is triggered only if &lt;code&gt;swallowEvent == false&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;swallowEvent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;swallowEvent&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;handleMouseFocus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MouseEventWithHitTestResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mouseEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hitTestResult&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;sourceCapabilities&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Apart from focus handling, you can explore all default actions of the mouse down event including selection, drag-drop, and scrollbar cases. It also implements mouse release and double clicks events - everything is there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gecko and WebKit
&lt;/h2&gt;

&lt;p&gt;At this point, we already spent some time discovering browsers source code and have a pretty good understanding of their structure, so why not check Firefox and Safari altogether. Firefox's browser engine called Gecko and Safari's - WebKit.&lt;/p&gt;

&lt;p&gt;Gecko also has an &lt;a href="https://wiki.mozilla.org/Gecko:Overview"&gt;overview page&lt;/a&gt; for developers, so you'd get an idea of the main concepts of it. Based on the experience with Chrome, you can find a neat 6000 lines of code &lt;a href="https://github.com/mozilla/gecko-dev/blob/master/dom/events/EventStateManager.cpp#L3177"&gt;EventStateManager&lt;/a&gt; file with events default actions and behavior. I've included a specific line in the link, so you won't have to go through it all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://webkit.org/"&gt;WebKit&lt;/a&gt; is a browser engine from Apple used in Safari and other Apple products. Chrome's Blink was forked from WebKit, so they have a lot of things in common and it wasn't a problem to find events implementation in their version of &lt;a href="https://github.com/WebKit/webkit/blob/1321fa346ad792f6de3ace65ca98cbe3957a96c6/Source/WebCore/page/EventHandler.cpp#L1757"&gt;EventHandler&lt;/a&gt; file.&lt;/p&gt;

&lt;p&gt;Now since we made sure we can prevent &lt;code&gt;mousedown&lt;/code&gt; event safely, I can step back and finish the PR with the date picker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Together we went a journey from a simple problem to the introduction of Web Standards and browser implementation details.&lt;/p&gt;

&lt;p&gt;Don't be scared by the hidden complexity of existing modules even if it's a browser or compiler. It will be a fun journey in the end. The chances are you can easily find things to improve, and more importantly, get unique insights into how things actually work. I've learned a ton of stuff during this deep dive and encourage everyone to do the same. Browsers will provide excellent documentation along the way at the point that I'm not sure why I need anything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relevant links for further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Do you know what DOM is? How it's represented internally? What's the purpose of events? I'd highly recommend &lt;a href="https://dom.spec.whatwg.org/"&gt;DOM Standard&lt;/a&gt; to everyone from beginners to more experienced developers. &lt;a href="https://dom.spec.whatwg.org/#action-versus-occurance"&gt;"An event signifies an occurrence, not an action."&lt;/a&gt; - my favorite part of it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Official website of the &lt;a href="https://www.w3.org/"&gt;W3C&lt;/a&gt; community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.chromium.org/developers/how-tos/getting-around-the-chrome-source-code"&gt;Getting around Chromium codebase&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.chromium.org/developers/design-documents"&gt;Design documents&lt;/a&gt; published by Chromium developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.google.com/presentation/d/1boPxbgNrTU0ddsc144rcXayGA_WF53k96imRH8Mp34Y/edit"&gt;Life of a pixel&lt;/a&gt; - introduction into rendering pipeline of Chrome.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>performance</category>
      <category>webstandards</category>
    </item>
  </channel>
</rss>
