<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Blog on Raul&#39;s Blog</title>
    <link>https://blog.rulyotano.com/blog/</link>
    <description>Recent content in Blog on Raul&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 17 Mar 2025 22:07:11 +0000</lastBuildDate>
    <atom:link href="https://blog.rulyotano.com/blog/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Building a Distributed Sequence Generator with ZooKeeper and C#</title>
      <link>https://blog.rulyotano.com/articles/zookeeper/</link>
      <pubDate>Mon, 17 Mar 2025 22:07:11 +0000</pubDate>
      <guid>https://blog.rulyotano.com/articles/zookeeper/</guid>
      <description>&lt;h2 id=&#34;1-goal-and-motivation&#34;&gt;1. Goal and Motivation&lt;/h2&gt;
&lt;p&gt;This demo project explores how to assign unique, dynamic sequence numbers to multiple server instances in a distributed environment, inspired by challenges that surface when designing things like global ID generators (e.g., Twitter’s Snowflake). As described in the project’s README, the scenario began as a typical interview problem: how do you ensure each server instance receives (and keeps) a unique ID, especially if instances are started, stopped, or restarted?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Improving latency by 20x times!</title>
      <link>https://blog.rulyotano.com/blog/article/improve-service-latency/</link>
      <pubDate>Wed, 09 Oct 2024 11:16:55 +0000</pubDate>
      <guid>https://blog.rulyotano.com/blog/article/improve-service-latency/</guid>
      <description>&lt;p&gt;I want to share my experience in improving our service latency and the steps I&amp;rsquo;ve taken to get there. As a result, the P75 Latency went down from more than 100 milliseconds to less than 5! By de-normalizing the SQL queries and creating one specific cache to fit our needs.&lt;/p&gt;
&lt;h2 id=&#34;situation&#34;&gt;Situation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Our service is a read-heavy system, with a ratio of 99-1 reads over the writes&lt;/li&gt;
&lt;li&gt;Created in dotnet core, we use EF core as ORM (Object Relational Mapper), and our main DB is Postgres (relational DB)&lt;/li&gt;
&lt;li&gt;We used Redis for caching. But it was not a custom cache but yes a &amp;ldquo;general propose&amp;rdquo; one. We used a library that acted as a middleware between EF and the DB, named the Second-Level Cache.&lt;/li&gt;
&lt;li&gt;Very high latency (&lt;strong&gt;P75 ~ 140ms&lt;/strong&gt; and &lt;strong&gt;P99 ~ 4s&lt;/strong&gt;) with high peaks of more than 2 seconds!&lt;/li&gt;
&lt;li&gt;Frequent incidents! A lot of DB connections were created when the cache was cold, so reached the Postgres connection limit, and new pods were not created, even if existing ones were in a bad state.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&#34;Latency before&#34; loading=&#34;lazy&#34; src=&#34;https://blog.rulyotano.com/images/improving-latency-by-20x-times/oits-before.png&#34;&gt;&lt;img alt=&#34;Redis cache hit rate before&#34; loading=&#34;lazy&#34; src=&#34;https://blog.rulyotano.com/images/improving-latency-by-20x-times/redis-before-long-ttls.png&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Interpolate 2D Points Using Bezier Curves in WPF (and Javscript)</title>
      <link>https://blog.rulyotano.com/blog/article/wpf-bezier-interpolation/</link>
      <pubDate>Wed, 02 Oct 2024 18:45:59 +0000</pubDate>
      <guid>https://blog.rulyotano.com/blog/article/wpf-bezier-interpolation/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://main.codeproject.com/articles/Interpolate-2D-Points-Using-Bezier-Curves-in-WPF&#34;&gt;&lt;strong&gt;[Original Article]&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/rulyotano/WPF-Bezier-Interpolation/tree/master&#34;&gt;&lt;strong&gt;Sample on GitHub (WPF)&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/rulyotano/rulyotano.crosscutting.js/tree/main/src/rulyotano.math.interpolation.bezier&#34;&gt;&lt;strong&gt;Sample on Github (JavaScript)&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://rulyotano.com/demos/bezier&#34;&gt;&lt;strong&gt;Live example in JavaScript (ReactJs)&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Interpolating points sometimes is hard mathematical work, even more, if the points are ordered. The solution is to create a function using the points and using an extra parameter &lt;code&gt;t&lt;/code&gt; that represents the time dimension. This often is called a parametric representation of the curve. This article shows a simple way of interpolating a set of points using Bezier curves in WPF.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tree-Extended, a tool to get custom directories trees</title>
      <link>https://blog.rulyotano.com/blog/article/tree-extended-tool/</link>
      <pubDate>Wed, 02 Oct 2024 18:33:17 +0000</pubDate>
      <guid>https://blog.rulyotano.com/blog/article/tree-extended-tool/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://medium.com/@rulyotano/tree-extended-a-tool-to-get-custom-directories-trees-3dea42ebf407&#34;&gt;&lt;strong&gt;[Original Article]&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this write, I want to show two ways to create custom directory trees by using the &lt;a href=&#34;https://github.com/rulyotano/tree-extended&#34;&gt;tree-extended&lt;/a&gt; tool:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;By using directly &lt;a href=&#34;https://github.com/rulyotano/tree-extended&#34;&gt;tree-extended&lt;/a&gt; in your SO command line by installing it as a node package.&lt;/li&gt;
&lt;li&gt;Or, by using the &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=rulyotano.tree-extended&#34;&gt;tree-extended vscode extension&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Why tree-extended?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I was documenting one of my projects and I wanted to write in markdown a directory tree representation, but I didn’t want to show all the directories but a particular one, the one that I was talking about in that section in the document. There is a command for Linux named &lt;code&gt;tree&lt;/code&gt; that you can install, but it didn’t match all the requirements I was looking for. That is why I created &lt;code&gt;tree-extended&lt;/code&gt; as a custom implementation of &lt;code&gt;tree&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Build Your Personal Website for Free Using React.js</title>
      <link>https://blog.rulyotano.com/blog/article/build-your-personal-website-free-reactjs/</link>
      <pubDate>Tue, 01 Oct 2024 14:59:32 +0000</pubDate>
      <guid>https://blog.rulyotano.com/blog/article/build-your-personal-website-free-reactjs/</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://medium.com/better-programming/get-your-personal-website-for-free-create-it-with-reactjs-b7e3c3c874b4&#34;&gt;&lt;strong&gt;[Original Article]&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this article, I want to show you how to create your personal website for free!&lt;/p&gt;
&lt;p&gt;To get that, we are going to use &lt;a href=&#34;https://pages.github.com/&#34;&gt;GitHub Pages&lt;/a&gt;, which will allow us to host our website and will even give us a secure (HTTPS) URL.&lt;/p&gt;
&lt;p&gt;Optionally, we can even use our own domain name; in such a case, it is the only thing that you will need to pay for.&lt;/p&gt;
&lt;p&gt;As the title says, we want to create the website using ReactJS.&lt;/p&gt;</description>
    </item>
    <item>
      <title></title>
      <link>https://blog.rulyotano.com/blog/draft/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.rulyotano.com/blog/draft/</guid>
      <description>&lt;h1 id=&#34;my-coding-interview-tarining-schema&#34;&gt;My Coding Interview Tarining Schema&lt;/h1&gt;
&lt;h2 id=&#34;intro&#34;&gt;Intro&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Explain this schema would work for train for most of coding interviews whiteboards hands 1-1 iterviews&lt;/li&gt;
&lt;li&gt;Explain most important is way of communication, thinking process, solving problem skills (from gathering requirements to testing and analysis), over just completing the challenge.&lt;/li&gt;
&lt;li&gt;Im going to give a short preparation process, to train main things to focus, just a couple of problems&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;interview-schema&#34;&gt;Interview schema&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;During preparation, every problem you solve, even if you know the solution, or if you&amp;rsquo;ve already solved it. Try to speak in a loud voice, or if you can&amp;rsquo;t, just try to simulate you are talking in your head, and explain everything you have in mind.&lt;/li&gt;
&lt;li&gt;Write in comments every step, as a place holder, to not forget anything. Even in the actual interview you can do so.&lt;/li&gt;
&lt;li&gt;Steps:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/*
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# 1. Understand the problem
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# 2. Find edge cases
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# 3. Propose several solutions
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# 4. Implementation
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# 5. Testing
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# 6. Analysis
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;1-understand-the-problem&#34;&gt;1. Understand the problem&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;After finishing this step, you should get a real understanding of the problem&lt;/li&gt;
&lt;li&gt;Ask any clarification questions, even if it seems obvious.&lt;/li&gt;
&lt;li&gt;Happened to me that after Im implementating I realize the implementation is wrong because I didn&amp;rsquo;t understand the problem&lt;/li&gt;
&lt;li&gt;At the end, write a summary for the interviewer to check if you got it correctly&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;find-edge-cases&#34;&gt;Find edge cases&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Try to find any edge case:
&lt;ul&gt;
&lt;li&gt;Input numbers: 0, negative, long int&lt;/li&gt;
&lt;li&gt;Arrays: null, empty, fewer items than required&lt;/li&gt;
&lt;li&gt;Strings: null, empty, fewer chars, weird characters&lt;/li&gt;
&lt;li&gt;Matrix: empty, null, fewer rows or cols&lt;/li&gt;
&lt;li&gt;TreeNodes (objects): null, roots, &amp;hellip;&lt;/li&gt;
&lt;li&gt;problematic values depending on the problem specification&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;propose-several-solutions&#34;&gt;Propose several solutions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Find the brute force, or the first idea come to your mind (try to do it always)&lt;/li&gt;
&lt;li&gt;Then find a better one, or improve brute force&lt;/li&gt;
&lt;li&gt;If nothing comes to your mind, just ask for tips or help&lt;/li&gt;
&lt;li&gt;This is the most critical step&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
  </channel>
</rss>
