<?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: Mark Lopez</title>
    <description>The latest articles on DEV Community by Mark Lopez (@xmarkclx).</description>
    <link>https://dev.to/xmarkclx</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%2F601622%2Faeb835e1-95ff-4ee8-b959-144a7ea98936.jpeg</url>
      <title>DEV Community: Mark Lopez</title>
      <link>https://dev.to/xmarkclx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xmarkclx"/>
    <language>en</language>
    <item>
      <title>Lambda API Gateways Are Dangerous</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Fri, 13 Oct 2023 06:29:06 +0000</pubDate>
      <link>https://dev.to/xmarkclx/lambda-api-gateways-are-dangerous-lin</link>
      <guid>https://dev.to/xmarkclx/lambda-api-gateways-are-dangerous-lin</guid>
      <description>&lt;p&gt;There is a &lt;strong&gt;30 second timeout limit&lt;/strong&gt; for AWS API Gateway.&lt;/p&gt;

&lt;p&gt;Meaning, your code will stop running after 30s. If it is doing a longish calculation by that time, it will &lt;strong&gt;stop running immediately, without running any cleanup code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n75C7dvC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4em013jwoyl16ymyd2gb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n75C7dvC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4em013jwoyl16ymyd2gb.png" alt="Image description" width="800" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is really bad&lt;/strong&gt;, especially since NextJS popularized running lambda APIs so they are becoming more common nowadays.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>I hate Ramda.</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Thu, 12 Oct 2023 08:56:33 +0000</pubDate>
      <link>https://dev.to/xmarkclx/i-hate-ramda-2m3i</link>
      <guid>https://dev.to/xmarkclx/i-hate-ramda-2m3i</guid>
      <description>&lt;p&gt;Why would anyone code like this?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;compose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ifElse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isNil&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;always&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;identity&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;order&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])),&lt;/span&gt;
    &lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="nx"&gt;ordersCreateData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's also slower than normal JS, and is so hard to understand.&lt;/p&gt;

&lt;p&gt;Here's the JS equivalent&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ordersCreateData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>rant</category>
    </item>
    <item>
      <title>Cheapest Durable Elasticache Redis</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Fri, 03 Feb 2023 08:02:28 +0000</pubDate>
      <link>https://dev.to/xmarkclx/cheapest-durable-elasticache-2ide</link>
      <guid>https://dev.to/xmarkclx/cheapest-durable-elasticache-2ide</guid>
      <description>&lt;h1&gt;
  
  
  Cheapest Durable Elasticache
&lt;/h1&gt;

&lt;p&gt;The recommended cheapest Elasticache solution for high availability would be to set up a Redis cluster with &lt;strong&gt;at least 3 cache nodes in different Availability Zones within a single region&lt;/strong&gt;. This provides both &lt;strong&gt;high availability and data durability&lt;/strong&gt;, as each cache node is its own full cluster, and each node in the cluster is a separate instance running in its own Availability Zone.&lt;/p&gt;

&lt;p&gt;Each of the 3 cache nodes in an AWS Elasticache Redis cluster &lt;strong&gt;acts as a full and independent cluster, storing the same data&lt;/strong&gt;. This means that all of the cache nodes contain the same data and can be used for both read and write operations.&lt;/p&gt;

&lt;p&gt;The cache nodes communicate with each other using a protocol called Redis Cluster, which automatically distributes data across the nodes in the cluster and ensures data consistency and availability. &lt;strong&gt;If one of the cache nodes fails or becomes unavailable, the remaining cache nodes will continue to function and serve client requests.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Read Replicas are not needed for durability, just for if you need a read endpoint…
&lt;/h2&gt;

&lt;p&gt;Having a &lt;strong&gt;single cache node and a single read replica&lt;/strong&gt; in AWS Elasticache Redis &lt;strong&gt;will not ensure data durability if the write node fails&lt;/strong&gt;. In this case, the read replica would not be able to take over as the primary node and continue serving client requests.&lt;/p&gt;

&lt;h1&gt;
  
  
  t3 vs t4g
&lt;/h1&gt;

&lt;p&gt;The new T4g instances provide better CPU performance and they are cheaper than T3 and T3a instances. This should be the go-to instance type in this instance family.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>cryptocurrency</category>
      <category>ethereum</category>
      <category>web3</category>
    </item>
    <item>
      <title>No Emojis on IntelliJ IDEs Terminals</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Thu, 29 Sep 2022 07:39:06 +0000</pubDate>
      <link>https://dev.to/xmarkclx/no-emojis-on-intellij-ides-terminals-535</link>
      <guid>https://dev.to/xmarkclx/no-emojis-on-intellij-ides-terminals-535</guid>
      <description>&lt;p&gt;I find it pretty annoying IntelliJ IDEs does not support emojis on terminal yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EH49C-49--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chbjebj4bb6495p9hqsw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EH49C-49--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chbjebj4bb6495p9hqsw.png" alt="Image description" width="800" height="135"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is an issue tracked for it:&lt;br&gt;
&lt;a href="https://youtrack.jetbrains.com/issue/IDEA-248010/Terminal-does-not-support-Emoji-Characters"&gt;https://youtrack.jetbrains.com/issue/IDEA-248010/Terminal-does-not-support-Emoji-Characters&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, VSCode does support them, along with most Terminal apps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lz7XVuz5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxwfgr6uaom2erx10p1z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lz7XVuz5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxwfgr6uaom2erx10p1z.png" alt="Image description" width="405" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Default Exports Are Horrible</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Tue, 06 Sep 2022 15:08:52 +0000</pubDate>
      <link>https://dev.to/xmarkclx/default-exports-are-horrible-1bdj</link>
      <guid>https://dev.to/xmarkclx/default-exports-are-horrible-1bdj</guid>
      <description>&lt;p&gt;&lt;a href="https://www.lloydatkinson.net/posts/2022/default-exports-in-javascript-modules-are-terrible/?ck_subscriber_id=987015562"&gt;https://www.lloydatkinson.net/posts/2022/default-exports-in-javascript-modules-are-terrible/?ck_subscriber_id=987015562&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I agree with this so much. Default exports should just go away.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Cosmos</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Tue, 21 Sep 2021 05:11:11 +0000</pubDate>
      <link>https://dev.to/xmarkclx/cosmos-436p</link>
      <guid>https://dev.to/xmarkclx/cosmos-436p</guid>
      <description>&lt;p&gt;I am getting a liking to Azure because CosmosDB, their clone of DynamoDB emulates MongoDB, so you can use it as a drop in replacement for anything that can use MongoDB.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Eslint Error on enum.</title>
      <dc:creator>Mark Lopez</dc:creator>
      <pubDate>Mon, 20 Sep 2021 06:37:45 +0000</pubDate>
      <link>https://dev.to/xmarkclx/eslint-error-on-enum-51m7</link>
      <guid>https://dev.to/xmarkclx/eslint-error-on-enum-51m7</guid>
      <description>&lt;p&gt;Annoyingly, Typescript tells me an enum is unused.&lt;/p&gt;

&lt;p&gt;He's right, but no one cares.&lt;/p&gt;

&lt;p&gt;Solution was to:&lt;br&gt;
&lt;a href="https://github.com/typescript-eslint/typescript-eslint/issues/2621"&gt;https://github.com/typescript-eslint/typescript-eslint/issues/2621&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rules: {
  "no-unused-vars": "off",
  "@typescript-eslint/no-unused-vars": "error"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
