<?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: Erik Madsen</title>
    <description>The latest articles on DEV Community by Erik Madsen (@beatmadsen).</description>
    <link>https://dev.to/beatmadsen</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%2Fuser%2Fprofile_image%2F136231%2F5d2ea744-f0d8-42d0-a7eb-6e3f1faa3adf.png</url>
      <title>DEV Community: Erik Madsen</title>
      <link>https://dev.to/beatmadsen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/beatmadsen"/>
    <language>en</language>
    <item>
      <title>Microplatforms</title>
      <dc:creator>Erik Madsen</dc:creator>
      <pubDate>Mon, 25 Nov 2024 13:42:27 +0000</pubDate>
      <link>https://dev.to/beatmadsen/microplatforms-1pp4</link>
      <guid>https://dev.to/beatmadsen/microplatforms-1pp4</guid>
      <description>&lt;p&gt;Over the last 10-15 years we've seen the industry adopting microservices in order to achieve a number of benefits often related to scaling technology and organisations.&lt;/p&gt;

&lt;p&gt;The pattern has also been emulated for the frontend in what is known as microfrontends.&lt;/p&gt;

&lt;p&gt;To enable this evolution, many organisations have adopted DevOps practices to provide greater collaboration and leaner processes between developers and operations, because, quite simply, it's hard to maintain a larger number of deployable components if deployment cycles are slow and collaboration is inefficient.&lt;/p&gt;

&lt;p&gt;Part of this work has been providing developers with good self service tools and APIs so that they can carry out their deployment tasks with, ideally, ever increasing independence and efficiency.&lt;/p&gt;

&lt;p&gt;Many organisations have found value in providing standardised configuration patterns and middleware when general infrastructure-as-code tools turn out to be too low level of abstraction for their needs.&lt;/p&gt;

&lt;p&gt;Over time, in-house practices, tools and APIs have developed into what we refer to as internal developer platforms, and organisations opt to have dedicated platform teams to maintain and expand the platform in the hopes of improving automation and enabling better compliance and security.&lt;/p&gt;

&lt;p&gt;Despite the good intentions, &lt;a href="https://blog.alexewerlof.com/p/washing-machine-vs-laundry-room" rel="noopener noreferrer"&gt;more&lt;/a&gt; and &lt;a href="https://youtu.be/esvydx09PEA?si=cw_mZqVZ4_0ehiMV" rel="noopener noreferrer"&gt;more&lt;/a&gt; we're seeing that the platform and its corresponding organisation comes with a built-in temptation to centralise and pursue (fictitious) economies of scale, and I think it's fair to say that a lot of teams are realising that they have invited the ghost of the monolith back in to the house in a different shape.&lt;/p&gt;

&lt;p&gt;It's therefore prudent to start thinking about the next step in the evolution of the platform with a strong emphasis on its original DevOps aspirations. &lt;/p&gt;

&lt;p&gt;We might call this step &lt;em&gt;Microplatforms&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I believe they will have some of the following traits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deeply specialised to the needs of individual teams&lt;/li&gt;
&lt;li&gt;Organisationally decoupled&lt;/li&gt;
&lt;li&gt;Might reuse or further abstract components and policies from upstream platforms on an opt-in basis.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;NOT&lt;/em&gt; separated from the development teams by a ticketing system&lt;/li&gt;
&lt;li&gt;Well-suited for ownership by cross-functional teams&lt;/li&gt;
&lt;li&gt;Small&lt;/li&gt;
&lt;li&gt;Quickly iterated&lt;/li&gt;
&lt;li&gt;Easily replaceable &lt;/li&gt;
&lt;li&gt;Maintained and expanded with the primary emphasis on removing friction from developers in delivering value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We would do well to remember the hard earned lesson, that when it comes to software &lt;a href="https://youtu.be/ciUNwQMgZkY?si=SIBfr_LqzsZxDYpJ" rel="noopener noreferrer"&gt;all things are better when they're kept small&lt;/a&gt;. Micro, in fact.&lt;/p&gt;

</description>
      <category>platformengineering</category>
      <category>architecture</category>
      <category>devops</category>
      <category>idp</category>
    </item>
    <item>
      <title>Process-based parallel execution of plain Minitest tests</title>
      <dc:creator>Erik Madsen</dc:creator>
      <pubDate>Fri, 01 Nov 2024 12:49:57 +0000</pubDate>
      <link>https://dev.to/beatmadsen/process-based-parallel-execution-of-plain-minitest-tests-p4a</link>
      <guid>https://dev.to/beatmadsen/process-based-parallel-execution-of-plain-minitest-tests-p4a</guid>
      <description>&lt;p&gt;I started work on a new gem today. &lt;/p&gt;

&lt;p&gt;When I created my previous gem, &lt;a href="https://rubygems.org/gems/churn_vs_complexity" rel="noopener noreferrer"&gt;churn_vs_complexity&lt;/a&gt;, I decided to use the new and exciting test library &lt;a href="https://rubygems.org/gems/tldr" rel="noopener noreferrer"&gt;Tldr&lt;/a&gt; because of its philosophy of fast test suites. &lt;/p&gt;

&lt;p&gt;While the experience of using that tool was nice overall, there were times where I got a bit of friction from its slightly unpolished current state (in fairness, no version 1.0.0 has been released yet) and the fact that it's not extensively used by the community.&lt;/p&gt;

&lt;p&gt;In my new gem I wanted to see if I could use Minitest but keep the same, albeit less draconian, focus on speed of execution.&lt;/p&gt;

&lt;p&gt;One thing I wanted to keep from Tldr was process based parallel execution from the onset of building my test suite.&lt;/p&gt;

&lt;p&gt;My understanding is that Minitest has some built-in support for concurrently running tests, but it's thread based, so the Global Interpreter Lock (in runtimes that have one) will mean that the Ruby code will not be executing in parallel. It could still give you a performance boost &lt;a href="https://medium.com/@mykoweb/learn-how-to-achieve-parallelism-with-ruby-i-o-bound-threads-a29c92aff58c" rel="noopener noreferrer"&gt;if your tests perform I/O&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But I want the real deal. I need process-based concurrency so that my Ruby code can also execute in parallel. &lt;/p&gt;

&lt;p&gt;I had a chat with my AI about how I could go about this, and it gave me a lot completely wrong answers with the utmost confidence. So after a while I decided I had to go back to attempting to be competent myself.&lt;/p&gt;

&lt;p&gt;You might remember that Rails introduced built-in concurrent testing in version 7 for the Rails flavour of Minitest where test cases inherit from &lt;code&gt;ActiveSupport::TestCase&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That particular class has too many batteries included for my use case, but I wanted to see if I could reuse ActiveSupport's way of instrumenting Minitest for parallelism.&lt;/p&gt;

&lt;p&gt;After a bit of tinkering and reading the source code of &lt;code&gt;ActiveSupport::TestCase&lt;/code&gt;, I found the solution I was looking for. It obviously requires ActiveSupport as a test dependency, but configuration-wise it's nice and lightweight.&lt;/p&gt;

&lt;p&gt;I published the approach in the following GitHub Gist, and I'll likely reuse this pattern in other gems. Maybe it'll be useful for you as well.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Here's some example output of running &lt;code&gt;rake test&lt;/code&gt; where we can see the parallelism in effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Running 2 tests in parallel using 10 processes
Run options: --seed 46661

# Running:

..

Finished in 0.211560s, 9.4536 runs/s, 9.4536 assertions/s.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ruby</category>
      <category>testing</category>
      <category>concurrency</category>
    </item>
    <item>
      <title>Elapsed time in Ruby, leap second safe</title>
      <dc:creator>Erik Madsen</dc:creator>
      <pubDate>Sat, 28 Dec 2019 12:21:14 +0000</pubDate>
      <link>https://dev.to/beatmadsen/elapsed-time-in-ruby-leap-second-safe-12dj</link>
      <guid>https://dev.to/beatmadsen/elapsed-time-in-ruby-leap-second-safe-12dj</guid>
      <description>&lt;p&gt;I highly recommend this article if you're interested in robust and reliable ways to build business logic that includes the notion of elapsed time.&lt;/p&gt;

&lt;p&gt;"Elapsed time with Ruby, the right way" by Luca Guidi&lt;br&gt;
&lt;a href="https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/"&gt;https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>time</category>
      <category>leapsecond</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Article - Destructuring With Ruby</title>
      <dc:creator>Erik Madsen</dc:creator>
      <pubDate>Sun, 28 Jul 2019 10:14:18 +0000</pubDate>
      <link>https://dev.to/beatmadsen/article-destructuring-with-ruby-3foa</link>
      <guid>https://dev.to/beatmadsen/article-destructuring-with-ruby-3foa</guid>
      <description>&lt;p&gt;I was looking around to see if there was a nice way to use the splat operator or some other technique in Ruby to extract some values from my custom object. Found this nice article on the subject.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jsarbada.wordpress.com/2019/02/05/destructuring-with-ruby/" rel="noopener noreferrer"&gt;https://jsarbada.wordpress.com/2019/02/05/destructuring-with-ruby/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>destructuring</category>
    </item>
  </channel>
</rss>
