<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zana Şimşek on Medium]]></title>
        <description><![CDATA[Stories by Zana Şimşek on Medium]]></description>
        <link>https://medium.com/@zanasimsek?source=rss-ecd14f7dfae8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OBTHy0E4jqlsplQDO7bQxg.jpeg</url>
            <title>Stories by Zana Şimşek on Medium</title>
            <link>https://medium.com/@zanasimsek?source=rss-ecd14f7dfae8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 03:28:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zanasimsek/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Apache Kafka State Store Usage to Use Retrieval of a Desired State for a given Record]]></title>
            <link>https://medium.com/@zanasimsek/apache-kafka-state-store-usage-to-use-retrieval-of-a-desired-state-for-a-given-record-5c9ff8a1707b?source=rss-ecd14f7dfae8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c9ff8a1707b</guid>
            <category><![CDATA[kafka-streams]]></category>
            <category><![CDATA[kafka-state-store]]></category>
            <dc:creator><![CDATA[Zana Şimşek]]></dc:creator>
            <pubDate>Sat, 08 Feb 2025 20:54:06 GMT</pubDate>
            <atom:updated>2025-02-09T15:28:12.352Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apache Kafka State Store Usage to Retrieve of a Desired State for a Record</h3><p>Apache Kafka is a fundamental component in many cutting-edge technological solutions. I actively incorporate Apache Kafka into my projects due to its user-friendly nature, configurability, and reliability. The platform’s versatility and numerous benefits make it a cornerstone of modern tech innovation. .</p><h3>Problem</h3><p>Imagine, you’re about to calculate a rank by looking at difference of startDateand endDate parameters and trying to group them hourly basis for the events you received. Let’s say you got an event where startDate is 2025-02-08 13:14:15 and endDate is 2025-02-08 16:17:18. What would you expect to see is as below for this single event:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/113b2f8bf2c504ee797b70b47431b057/href">https://medium.com/media/113b2f8bf2c504ee797b70b47431b057/href</a></iframe><p>The &quot;Density&quot; column showcases the duration for which a record has been present within the hour, measured as a rate. This value falls within the range of [0, 1], calculated by dividing the total seconds the record stayed during the hour by 3600 (60 * 60).</p><p>I multiplied a single record into four and sent it to the next processor. But, wait a sec. What if I receive an update event regarding the time range values of the record above? What if the newly defined date range couldn’t match with the range I calculated earlier?</p><p>Absolutely, the solution isn’t that much simple if I have to take the updates into account. Because, I output 4 records from a given single input record and the update record couldn’t align with the previous record. Even worse, it’ll produce the wrong result even if I receive a range with an absolute match.</p><p>As Kafka is, fundamentally, a key-value store under the hood, the records I produced earlier will remain there unless an intervention, will lead a miscalculation if I can’t somehow update them. Unlike a SQL query that calculates results at query runtime, this process computes results upon receiving events, resembling a Materialized View in SQL. Those familiar with this system understand the importance of regular updates or updates triggered by custom events.</p><h3>Motivation</h3><p>The solution to this problem was pretty easy:0 By referencing the previous state of the given record and conducting the same calculations with negated values, I was able to generate and share the new values effortlessly. It was because I read lots of things about the state store feature of Kafka, variations of it and etc. However, delving into the documentation, implementations, and even the Kafka’s source code posed challenges. Yet, a question arose: Could this feature be exclusive to Kafka’s internal operations? Certainly not, as such a sophisticated project would not incorporate a functionality with such limited applicability.</p><p>I realized that there is no neatly prepared documentation/blog post about it, neither AI helped, or I was on the completely wrong path regarding with my searches.</p><p>Nevermind, it doesn’t matter. I was quite a while since my last post.</p><p>Before I go on, don’t forget to check out the usage project I created specifically for this blog post. It is attached to the bottom of this post.</p><h3>Solution</h3><p>Following an extensive and enlightening process, which involved thorough searches, code analysis, and experimentation with AI suggestions, I unraveled the key method to access a user-defined state store – through the processors of Kafka. Here is the approach I adopted:</p><p>First of all, it is needed to define a state store bean for it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ffc330d5d3e03758919ff4462bf1b14/href">https://medium.com/media/4ffc330d5d3e03758919ff4462bf1b14/href</a></iframe><p>I established a persistent store to facilitate data access between restarts and cluster autoscales. Kafka primarily utilizes RocksDB to expedite the process, supported by a Kafka topic. Therefore, a corresponding topic is necessary to store the state with the compact cleanup policy.</p><p>Regarding the peculiar definition on line 11, the Spring framework typically handles such requirements seamlessly. However, for the storeBuilder, manual addition into the builder was necessary. It would be beneficial to automate this process post bean creation. Any insights on this matter are welcomed in the comments.</p><p>I also enabled the exactly_once_v2 feature of Kafka in order to completely exclude dirty state records and etc.</p><p>So, it is time to define a processor to reach out the state of the record:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec951062e4c23b768fe7e1ad30a4e672/href">https://medium.com/media/ec951062e4c23b768fe7e1ad30a4e672/href</a></iframe><p>With the init function, Kafka Stream API is providing a context. It is required both for record forward and, more importantly, to reach out desired state store. I defined it as part of init function and reused it again and again.</p><p>Inside the process function, I’m mapping the incoming record into a new DTO, reading the last state of my record by calling “get” method of the store with the key of my record, forwarding record to next processor, and persisting my last state and it is that much simple! Now, it is time to use it as part of Kafka Stream API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a3cdc7f9acfbef3ef003a7da8197461/href">https://medium.com/media/8a3cdc7f9acfbef3ef003a7da8197461/href</a></iframe><p>I defined reader stream as a bean by using “<em>StreamsBuilder</em>” of Kafka and called it “<em>rangeEventStream</em>”. The next thing is to attach the desired processor into my stream api chain as you can see on line 6.</p><p>Please note that the process function is not accepting an instance of desired processor. Instead, it is requiring you to provide a supplier of desired processor and forcing you to create a new instance between calls. This is it because of thread-safety, rebalancing, partitionig, scalability and etc. Moreover, it is also needed to provide the name of the stores for the service of processor.</p><h3>Conclusion</h3><p>It was a funny and good journey to implement it and learn more about the Kafka. I implemented a complete and exclusive implementation of what I explained. I used Maven, Spring Boot 3. It is a ready-to-use implementation enriched with “docker-compose” and “make” tool to ease the usage and let you focus more on the logic instead of technical difficulties. Feel free to try it and let me know your thoughts!</p><p><a href="https://github.com/wilius/kafka-stream-user-defined-statestore-usage">GitHub - wilius/kafka-stream-user-defined-statestore-usage</a></p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c9ff8a1707b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migration of Postgres from 9.6 to 10 via PgLogical for a Debezium Included Tech Stack]]></title>
            <link>https://medium.com/@zanasimsek/migration-of-postgres-from-9-6-to-10-via-pglogical-for-a-debezium-included-tech-stack-61114cb3f783?source=rss-ecd14f7dfae8------2</link>
            <guid isPermaLink="false">https://medium.com/p/61114cb3f783</guid>
            <category><![CDATA[debezium]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[postgresql-replication]]></category>
            <category><![CDATA[upgrade]]></category>
            <category><![CDATA[pglogical]]></category>
            <dc:creator><![CDATA[Zana Şimşek]]></dc:creator>
            <pubDate>Tue, 13 Dec 2022 13:54:22 GMT</pubDate>
            <atom:updated>2022-12-14T16:30:36.960Z</atom:updated>
            <content:encoded><![CDATA[<p>Upgrading a database is a challenging undertaking. Careful considerations must be taken to ensure that the upgrade causes minimum downtime, while no data should be lost and detailed rollback scenarios should be considered in the event of an unsuccessful upgrade.</p><p>Naturally, if the time came for you to realize that an upgrade to a newer version is a pressing issue, as the version 9.6 lost its long-term maintenance support by the community more than 1 year ago, as well as while at the same time you are missing on various performance improvements that are offered by the newer versions of Postgres, then it is time to upgrade it.</p><p>To upgrade the database, I opted for an incremental upgrade, which is less risky compared to major upgrades at once — I would upgrade a database by a major version at a time and make sure that everything is working as expected, until continue to a next major upgrade.</p><p>In this article, I will share with you my way of upgrading a Postgres database from version 9.6 to version 10.</p><p>The article assumes you are running your instance either at on-premise datacenter or on Google Cloud.</p><p>If you’re operating a database for the mission critical apps relies-on, it is not possible to foresee every possible disaster scenario, as any issue could have a major impact on your business and in the trust of your customers.</p><p>To do it so, my approach creates two new database instances instead of one:</p><ul><li>The first instance would be with the target version 10</li><li>The second instance would be in exactly the same version as the existing database. In our case, it was 9.6. (I called it the <strong>rollback</strong> instance)</li></ul><p>The idea behind the rollback instance is to allow applications to quickly switch to using the old stable instance (aka the <em>rollback</em> instance) without any loss of data in case of an unexpected situation that you didn’t encounter during the upgrade on your test environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xTsgFaFgXc-uhJk5nEttOA.png" /><figcaption>Data Sync Chain</figcaption></figure><p>As shown on the diagram above, the idea behind the rollback instance is the following:</p><ul><li><strong>The new version 10 instance </strong>will be the subscriber of the <strong>old v9.6</strong> instance’s DMLs</li><li><strong>The rollback instance with version 9.6</strong> will be the subscriber of the <strong>new v10</strong> instance for its DMLs.</li></ul><p>I did this with the following expectations:</p><ul><li>Any data change that happens in the <strong>old 9.6</strong> instance should be propagated <strong>first</strong> to the new v10 instance and <strong>then</strong> to the new v9.6 rollback instance.</li><li>Any data change happening in new v10 instance should be propagated to the new 9.6 rollback instance.</li></ul><p>As you might have guessed, the rollback instance will be needed if any unexpected situation happens after switching to the new v10 instance, so that applications can operate without any data loss as the rollback instance is a subscriber of the v10 instance.</p><p>I explained briefly the overall idea behind the database upgrade to ensure no data loss. Now lets dig in the implementation details.</p><p>As mentioned in the title of the article, the underlying approach relies on the existence of the <strong>pglogical</strong> extension and <strong>wal_level=logical </strong>configuration. If you’re already a client of a cloud provider, many of them support the pglogical and wal_level settings only with small configurations.</p><p>On GCloud, enabling the two configurations below will be sufficient for that particular requirement:</p><pre>cloudsql.logical_decoding: on<br>cloudsql.enable_pglogical: on</pre><p>For on-premise installations, applying the changes provided by the official <a href="https://github.com/2ndQuadrant/pglogical#installation"><strong>pglogical github page</strong></a> is going to be required. It includes the installation of pg_logical for most popular Linux distros. Therefore, I will skip the installation details of the pg_logical for on-premise instances.</p><blockquote>The instructions above should be activated for all instances, meaning for the old 9.6, the new 10 and the new rollback 9.6 instance.</blockquote><p>After the <strong>wal_level</strong> and <strong>pglogical</strong> settings have been enabled on all instances, it is now the time to initiate the replication between the instances. In the following section, you will see how to do this with step-by-step instructions.</p><h3>Preparation steps on the old v9.6 instance</h3><p>Postgresql doesn’t support DDL replications through WAL. Therefore, replication with pglogical relies on the existence of the same schema from the source database on the destination database. In order to get schema and roles from the source database, I will use the <strong>pg_dump</strong> and <strong>pg_dumpall</strong> command-line utilities:</p><pre>pg_dump --dbname=$DB_NAME -s -C --username=postgres --host=$OLD_96_HOST_IP --port=5432 &gt; schema.sql<br>pg_dumpall --roles-only --username=postgres --host=$OLD_96_HOST_IP --port=5432 &gt; roles.sql</pre><p>Note that if you’re trying to upgrade your GCloud-managed Postgres instance, the pg_dumpall command to get the roles will fail because of insufficient permissions. I did a lot of research in order to figure out how to dump roles on GCloud-managed instance, but I couldn’t as it requires a <em>SUPERUSER</em> role which is not allowed by GCloud. So, the creation of all the roles requires you to do it manually by writing the SQLs and <strong><em>assignment of the passwords by keeping them as exactly same as configured in old v9.6 instance</em></strong>.</p><blockquote>It is important to have same passwords for the roles which the applications use. Otherwise, you have to change them on all applications’ YAML or Vault definitions. I strongly suggest to keep them as is if possible.</blockquote><p>This is how I obtain the existing roles and their definitions:</p><pre>ubuntu@ubuntu $ psql -h $OLD_96_HOST_IP --port=5432 -U postgres <br>psql (12.12 (Ubuntu 12.12-0ubuntu0.20.04.1), server 9.6.24)<br>Type &quot;help&quot; for help.<br>postgres=# \du<br>                                                List of roles<br>         Role name         |                         Attributes                         |      Member of      <br>---------------------------+------------------------------------------------------------+---------------------<br> cloudsqladmin             | Superuser, Create role, Create DB, Replication, Bypass RLS | {}<br> cloudsqlagent             | Create role, Create DB                                     | {cloudsqlsuperuser}<br> cloudsqliamserviceaccount | Cannot login                                               | {}<br> cloudsqliamuser           | Cannot login                                               | {}<br> cloudsqlreplica           | Replication                                                | {}<br> cloudsqlsuperuser         | Create role, Create DB                                     | {pg_signal_backend}<br> first-service-user        | Create role, Create DB                                     | {cloudsqlsuperuser}<br> second-service-user       | Create role, Create DB                                     | {cloudsqlsuperuser}<br> postgres                  | Create role, Create DB, Replication, Bypass RLS | {}</pre><p>The command above followed by the creation of role scripts based on the definition table, output by the command <strong>\du</strong>:</p><pre>create user &quot;first-service-user&quot;<br>    createdb<br>    createrole;<br>create user &quot;second-service-user&quot;<br>    createdb<br>    createrole;<br>...</pre><p>I put all the SQLs related with roles into the roles.sql file. It is also important to make sure the postgres user has been granted replication to allow it to initiate the replication:</p><pre>alter user postgres replication;</pre><p>After you successfully get the schema and roles from the old v9.6 instance, it is time to configure <strong>pglogical</strong> on it with commands below:</p><pre>CREATE EXTENSION pglogical;<br>SELECT *<br>from pglogical.create_node(<br>        node_name := &#39;master_node&#39;,<br>        dsn := &#39;host=&lt;ip-address-of-old-v9.6-instance&gt; port=5432 dbname=&lt;db-to-replicate&gt; user=postgres password=password_of_old_9.6_instance&#39;<br>);<br>select *<br>from pglogical.create_replication_set(<br>    &#39;version_upgrade_replication_set&#39;<br>);<br>SELECT *<br>from pglogical.replication_set_add_all_tables(<br>      &#39;version_upgrade_replication_set&#39;, <br>      ARRAY [<br>        &#39;schema1&#39;,<br>        &#39;schema2&#39;,<br>        .. // all the schemas you want to include as part of upgrade<br>        ],<br>      synchronize_data := true<br>);<br>select *<br>from pglogical.replication_set_add_all_sequences(<br>      set_name := &#39;version_upgrade_replication_set&#39;,<br>      schema_names := ARRAY [<br>        &#39;schema1&#39;,<br>        &#39;schema2&#39;,<br>        .. // all the schemas you want to include as part of upgrade<br>      ],<br>      synchronize_data := true<br>);</pre><p>To get the list of schemas, you should run the query below:</p><pre>ubuntu@ubuntu $ psql -h $OLD_96_HOST_IP --port=5432 -U postgres --dbname=$DB_NAME<br>psql (12.12 (Ubuntu 12.12-0ubuntu0.20.04.1), server 9.6.24)<br>Type &quot;help&quot; for help.<br>db_to_replicate=# \dn<br>           List of schemas<br>           Name            |  Owner   <br>---------------------------+----------<br> pglogical                 | postgres<br> schema1                   | postgres<br> schema2                   | postgres<br> schema3                   | postgres<br> ...</pre><blockquote>As you see from the output above, pglogical and other internal schemas are also included. So, please don’t forget to exclude them from the replication set. Also make sure, they are not included in your schema dump we obtained via the pg_dump command.</blockquote><h3>Preparation steps on the new v10 instance</h3><p>After you successfully applied the commands above on the old v9.6 instance, it is time to prepare the new v10 instance accordingly.</p><p>The first thing we need to do is to import roles via the command below:</p><pre>psql --file=roles.sql --username=postgres --host=$NEW_10_HOST_IP --port=5432</pre><p>After you imported the roles successfully, you should import the schema by running the command below:</p><pre>psql --file=schema.sql --username=postgres --host=$NEW_10_HOST_IP --port=5432</pre><blockquote>It is much more crucial to make sure that all of the imports above have been done without any error.</blockquote><p>Now, we need to grant replication privilege to <strong>postgres</strong> user on the <strong>new v10 instance</strong> so that it can create a replication from the old v9.6 instance:</p><pre>alter user postgres replication;</pre><p>Now, we can safely configure pglogical in order to initiate replication:</p><pre>create extension pglogical;<br>SELECT pglogical.create_node(<br>        node_name := &#39;replica_node&#39;,<br>        dsn := &#39;host=&lt;ip-address-of-new-v10-instance&gt; port=5432 dbname=&lt;database-for-replica-to&gt; user=postgres password=password_of_v10_postgres_user&#39;<br>);<br>select pglogical.create_subscription(<br>        subscription_name := &#39;subscription_to_master&#39;, <br>        replication_sets := array [&#39;version_upgrade_replication_set&#39;],<br>        provider_dsn := &#39;host=&lt;ip-address-of-old-v9.6-instance&gt; port=5432 dbname=&lt;database-name&gt; user=postgres password=password_of_old_9.6_instance&#39;<br>);</pre><p>If there is nothing wrong with your configuration, the command below should print out something similar:</p><pre>db_to_replicate=# SELECT subscription_name, status FROM pglogical.show_subscription_status(&#39;subscription_to_master&#39;);<br> subscription_name      | status<br>------------------------+--------------<br> subscription_to_master | initializing</pre><p>You did it if you see <strong>status=initializing</strong>. You rock! :)</p><p>But, it is possible to miss some of the important points, or, custom requirements for your installation and see <strong><em>status=down</em></strong> for your first try. So, to detect the underlying reason, the only way is to check logs on both instances and, unfortunately, there is no quick solution for it. The detection of the problem can take a while based-on the one you are experiencing.</p><p>Assuming you got the output of <strong><em>status=initializing</em>,</strong> you have to wait until <strong>status</strong> becomes <strong>replicating</strong>. Instead of checking it manually, run the command below:</p><pre>SELECT *<br>FROM pglogical.wait_for_subscription_sync_complete(&#39;subscription_to_master&#39;);</pre><p>The command above will return a result just after the status of replication becomes either <strong>replicating</strong> or <strong>down</strong>. In case of a down status, you have to again struggle with the reason and solve it by yourself, and as I mentioned before, there is no magic solution to apply neither.</p><p>If you impatient like me and wishing to see what pglogical runs before the replication status turn to the <strong>replicating</strong>, run the query below:</p><pre>select query <br>from pg_stat_activity <br>where application_name = &#39;subscription_to_master_copy&#39;;</pre><p>If your status just turned to <strong>replicating</strong>, please apply the same steps for the new rollback v9.6 instance. I summarize the commands for you below:</p><pre>psql --file=roles.sql --username=postgres --host=$NEW_ROLLBACK_96_HOST_IP --port=5432<br>psql --file=schema.sql --username=postgres --host=$NEW_ROLLBACK_96_HOST_IP --port=5432</pre><p>Run the commands below on the <strong>new v10</strong> instance:</p><pre>select *<br>from pglogical.create_replication_set(<br>    &#39;rollback_replication_set&#39;<br>);<br>SELECT *<br>from pglogical.replication_set_add_all_tables(<br>      &#39;rollback_replication_set&#39;, <br>      ARRAY [<br>        &#39;schema1&#39;,<br>        &#39;schema2&#39;,<br>        .. // all the schemas you want to include as part of upgrade<br>        ],<br>      synchronize_data := true<br>);<br>select *<br>from pglogical.replication_set_add_all_sequences(<br>      set_name := &#39;rollback_replication_set&#39;,<br>      schema_names := ARRAY [<br>        &#39;schema1&#39;,<br>        &#39;schema2&#39;,<br>        .. // all the schemas you want to include as part of upgrade<br>      ],<br>      synchronize_data := true<br>);</pre><p>Run the commands below on new <strong>rollback v9.6</strong> instance:</p><pre>alter user postgres replication;<br>create extension pglogical;<br>SELECT pglogical.create_node(<br>        node_name := &#39;replica_node_rollback_96&#39;,<br>        dsn := &#39;host=&lt;ip-address-of-rollback-96-node&gt; port=5432 dbname=&lt;database-for-replica-to&gt; user=postgres password=password_of_rollback_v96_postgres_user&#39;<br>);<br>select pglogical.create_subscription(<br>        subscription_name := &#39;subscription_of_v10&#39;, <br>        replication_sets := array [&#39;rollback_replication_set&#39;],<br>        provider_dsn := &#39;host=&lt;ip-address-of-new-v10-instance&gt; port=5432 dbname=&lt;database-name&gt; user=postgres password=password_of_v10_postgres_user&#39;<br>);</pre><p>Our expectation is to see the following output for the query:</p><pre>db_to_replicate=# SELECT subscription_name, status FROM pglogical.show_subscription_status(&#39;subscription_to_master&#39;);<br> subscription_name      | status<br>------------------------+--------------<br> subscription_to_master | initializing</pre><h3>Switching from 9.6 to 10</h3><p>The steps you should follow for switching to the new instance for a tech stack includes kafka, zookeeper and debezium might as following:</p><ul><li>Restrict access from the all outside of the world</li><li>Stop all the instances except Zookeeper and Kafka</li><li>Change the password of all roles that are in-use by applications to a random value, in order to prevent a misconfigured app to connect old instance by mistake.</li><li>Make sure there is no connection with the roles of the applications. If such exist, gracefully shut them down by running the query below on the old v9.6 instance:</li></ul><pre>select pg_cancel_backend(pid) from pg_stat_activity where usename in (&#39;first-service-user&#39;, &#39;second-service-user&#39;, ...)</pre><ul><li>Wait until all the unwanted connections have been closed gracefully after you run the query above.</li><li>Run the query below to make sure sequences have synchronized their latest status to the replication slot on the old v9.6 instance:</li></ul><pre>select pglogical.synchronize_sequence(seqoid)<br>from pglogical.sequence_state;</pre><ul><li>Run the query below on the new v10 instance to make sure the replication on the new instance has reached a final status:</li></ul><pre>SELECT *<br>FROM pglogical.wait_for_subscription_sync_complete(&#39;subscription_to_master&#39;);</pre><ul><li>Update the DNS name of database instance so that it can resolve the new v10 instance.</li><li>As we are using Debezium, creation of replication slots are also needed on new instance so that we can make sure, we didn’t miss any CDC event. So, run the query below to create debezium’s replication slots on new v10 instance:</li></ul><pre>select pg_create_logical_replication_slot(<br>    slot_name := &#39;debezium_replication_slot1&#39;,<br>    plugin := &#39;wal2json&#39;<br>);<br>select pg_create_logical_replication_slot(<br>    slot_name := &#39;debezium_replication_slot2&#39;,<br>    plugin := &#39;wal2json&#39;<br>);<br>...</pre><ul><li>Remove the debezium topic on Kafka called <strong>debezium-offset</strong> so that it can start with a fresh LSNs instead of the old v9.6’s LSNs.</li><li>Scale up the applications.</li><li>Open applications so that they can be reached out by your secure network in order to verify they operate as expected.</li><li>Open up the applications to the rest of the world.</li></ul><p>The recipe I presented is as above. Switching back to the rollback instance recipe is exactly same as the recipe presented above.</p><p>I wish, you get an insight about how an upgrade can get done with all the details of my recipe. Don’t hesitate to ask your question and subscribe to my profile to be updated about the next coming upgrades about the way to achieve it with almost zero-downtime approach.</p><p>I have special thanks to <a href="https://www.linkedin.com/in/petar-bivolarski/"><strong>Petar Bivolarski</strong></a> for the editorial, to <a href="https://www.linkedin.com/in/yusuftayman/"><strong>Yusuf Tayman</strong></a> for the image of flow and encouraging me to write it and to <strong>Zahari Angelkov</strong> about his impressive replies about my questions regarding with GCloud.</p><p><a href="https://twitter.com/zanasimsek">https://twitter.com/zanasimsek</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61114cb3f783" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking through “Learned Helplessness”​ at OpenPayd]]></title>
            <link>https://medium.com/@zanasimsek/breaking-through-learned-helplessness-at-openpayd-de68f4cddad5?source=rss-ecd14f7dfae8------2</link>
            <guid isPermaLink="false">https://medium.com/p/de68f4cddad5</guid>
            <dc:creator><![CDATA[Zana Şimşek]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 12:06:20 GMT</pubDate>
            <atom:updated>2022-12-12T12:06:20.076Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been almost 3 years since I joined <a href="https://www.linkedin.com/company/openpayd/">OpenPayd</a>, so it’s time to share my experience about why I’m still here!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VHeJjq3YY-o0Jde2.png" /></figure><p>I have never been someone who wanted to work on boring, straight-forward tasks over and over again. That’s why my CV is full of short running jobs: there was no growth and no opportunity to find a better way to work.</p><p>That experience was at the top of my mind when I first saw the job at OpenPayd — I wanted to be sure the role wasn’t going to be a dead-end<em>.</em> I went ahead and applied for a position as a “Java Software Developer”. An online interview, followed by a task and then a face-to-face interview followed, before I got the offer. It was by far the best one I’ve ever had, with a salary and benefits that were very competitive. Even then though, I still had concerns in the back of my mind about what my role would involve and whether the work would challenge me. After three years, I can certainly say it has delivered!</p><p><strong>Why am I still working for OpenPayd?</strong></p><p>There are lots of reasons that I could list here, but the first and most important one is the total freedom I have in my work. No matter who you are, what your religion is or beliefs you have, you can be your real self. Most companies promise it, but here, finally, the promises were real. At OpenPayd, Diversity and Inclusion feels lived by, it’s not just a social media statement. As a person who didn’t internalise the norms of society, it was really what I was looking for.</p><p>But, like most engineers, I was also looking for the freedom to select and build a tech stack that best fits our business requirements. It’s something that many of us have faced: no one listens to you if you are new and (relatively) young. Here, finally, it was different.</p><p>I couldn’t say all my technical suggestions were accepted immediately, but it was good to see respect and consideration from the team towards my ideas. I believe you have to prove yourself: even if you’re a popular content creator within the development community, no one gets a free pass. But I can also say that it was appreciated having the freedom to contribute your ideas as the “newbie” in the team.</p><p>After a short while, when we all got to know each other and understand our strengths, putting my ideas into action became even smoother. I am proud that I was able to make my mark on how our technology was engineered. And I know it also contributed to my promotion to “Software Architect” after 18 months in the business.</p><p><strong>How do we code at OpenPayd?</strong></p><p>Before beginning a task, at the analysing phase, we start with a deep investigation into the feature we want to develop. After all the participants have completed their investigation, we hold a session to brainstorm ideas and find the optimal solution for it. I can definitely say, it’s in those sessions that you’re really expanding your horizons.</p><p>The brainstorming phase is followed by the team coding in pairs for <em>mission critical</em> tasks, and working individually for the straightforward ones.</p><p>Sometimes, developers can find better solutions on the way, but that could be a bit risky or could take longer time to deliver. That’s why we have a “Technical Debts” period, 1.5 months each year that we only use to focus on technical problems and debts — no business development.</p><p>We follow the rule of “no blame” for individuals if production issues occur, even if it’s painful or costly to fix. Instead, we take an immediate action to fix the problem. Then, we simply take actions to understand what we need to do so it doesn’t happen again. These are the times which helped us to embrace the journey and move our mindset forward.</p><p><strong>How do we work?</strong></p><p>Long story short, we follow the rules of the Scrum methodology. The main idea is to keep the motivation and trust within the team as high as possible. I believe this is key for tech-driven companies.</p><p>With trust-led, motivated teams, there’s no room for micromanagement. This way, the code is a result of our multiple brains and ideas rather than a single engineering manager.</p><p>What else works for us? The answer is quite simple: Embracing the entire team! That’s easy to say, so I want to give you some real-life examples:</p><p><em>No task begins unless it’s understood by the entire team</em></p><p>We don’t start any task unless all of its requirements are totally understood by the team. Poorly understood tasks create unnecessary pressure for developers; they hold up projects and lower motivation while we wait for clarification from our stakeholders. As developers, we have to get a clear understanding of a task’s requirements, in order to schedule our days more precisely.</p><p><em>Including new items in our existing tech stack</em></p><p>As developers, there are always new tools to learn about and, sometimes, we can feel like we’re getting old and out-of-date if we keep using the same old technologies for years. That’s why we often challenge ourselves to incorporate new solutions within our tech stack.</p><p>At the very beginning of the year, we included the <a href="https://debezium.io/">Debezium Project</a> and <a href="https://ksqldb.io/">KSQLDB</a> into some of our less critical solutions, so we can start to get real-world experience under our belts. We invested and paid attention to the way that they worked and now I can proudly say that Debezium is the backbone of one of our mission-critical microservices which is responsible for our transaction fee calculations. Those fee calculations are incredibly complex and we now have 10–15ms response times.</p><p>The most recent example is choosing between Golang or GraalVM, which came from one of my colleagues. After long discussions, we decided that using Golang would be much more beneficial for the company — as well as the careers of our developers. We felt Golang and Rust will dominate the development communities in the near future, so it’s important for our teams to understand it.</p><p>Yes, we’re a technology-driven company. But the plan is to eventually open-source our internal libraries and frameworks to the communities to bring greater value to the developer community.</p><p><em>Properly arranged Sprints</em></p><p>The most important thing about the sprints is, I believe, the timing. At times, in my past experiences, I found myself in quite stressful circumstances when teams weren’t running proper scrums — they were running a “Zombie Scrum”.</p><p>At OpenPayd, we hold refinement sessions for tasks that are ready to refine, vote and agree on story point estimations. Later on, we estimate the time required from the developers. We always get an estimation from the developer who is going to be in charge of the given task. That’s a crucial part of our inclusive way of working. The development time for a task can differ from one developer to the next. We don’t want any of our people to be at risk of burnout: the first thing we care about is the mental health of the developer.</p><p><em>Free Times</em></p><p>Our sprints are for 10 working days. But, during the planning session, we only fill the first 8 days of developer time. The only things we planned for our last 2 days are 3 hours of refinement and 1 hour retrospective sessions. If engineers complete their tasks with no bugs, they’re totally free to do whatever they wish in those working days. This could be reading articles, something new for their personal growth or playing guitar, whatever they wish.</p><p>We do this because it motivates the team to pay more attention to the task we’re working on. We all know if we could deliver the task with no bugs, then we can get two more free days that we can use for our growth in other ways.</p><p><em>Build a bicycle, collect feedback, evolve it into a motorcycle</em></p><p>Most of us are faced with very complex problems throughout our career. There is no doubt that we will encounter high expectations with complex integrations and limited time. That should come as no surprise within the business world, especially within a competitive space like Banking-as-a-Service. But the key question is: How do we deal with this here at OpenPayd?</p><p>When the development team receives a requirement from the business, the first thing we do is to split the requirements into smaller requirements in an abstract way. We always want to know the whole story, so we analyse, refine and chunk the project into smaller pieces. Knowing the whole story makes you and your code ready for the next request. The idea is quite basic: if our stakeholders want a motorcycle, we aim to give them a bicycle first. If they need more functionality, then we evolve it towards a Scooter. But if they’re happy with a bicycle, that’s a great result — you’ve saved your codebase and architecture from unused code you have to maintain for no reason!</p><p><strong>Is it just co-working or more than that?</strong></p><p>It is common for most of us to only communicate with our colleagues about work. But here there’s much more to it.</p><p>When we find time and motivation, we get together and spend time with each other. Climbing, trekking, going out for fun, barbecues, competitions about various things and so on. Each of us is not only a colleague, we are also good friends. We’re here for each other beyond the workplace, for good times and also for when times are tough.</p><p><strong>What is it like being an OpenPayder?</strong></p><p>As you can imagine, personality is a vital part of becoming an OpenPayder. That’s because all the things I mentioned until now heavily rely on who you are as a person.</p><p>There are no strict rules about what to expect within the company. We embrace the differences as a culture and value that in interviewees. That’s because candidates with different backgrounds can add value when we’re considering various technical directions. It happened in my case and is why OpenPayd has been the longest role of my career.</p><p>Now, I can simply say I broke the learned helplessness just by being an Openpayder.</p><p>If you’d like to know more, check out our <a href="https://www.linkedin.com/company/openpayd/jobs"><strong>LinkedIn</strong></a> page and we’re always <a href="https://jobs.lever.co/OpenPayd/b9dfdaf9-07d8-43df-b0ee-81d4d54b5be0"><strong>interested in hearing from you</strong></a> if you think OpenPayd is right for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de68f4cddad5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>