<?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 Naveed Ahmed on Medium]]></title>
        <description><![CDATA[Stories by Naveed Ahmed on Medium]]></description>
        <link>https://medium.com/@Navmed?source=rss-451c9e5e97b7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Naveed Ahmed on Medium</title>
            <link>https://medium.com/@Navmed?source=rss-451c9e5e97b7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 03:03:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Navmed/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[Setting up replication in PostgreSQL with pglogical]]></title>
            <link>https://medium.com/@Navmed/setting-up-replication-in-postgresql-with-pglogical-8212e77ebc1b?source=rss-451c9e5e97b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8212e77ebc1b</guid>
            <category><![CDATA[replication]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Naveed Ahmed]]></dc:creator>
            <pubDate>Sun, 04 Oct 2020 23:13:58 GMT</pubDate>
            <atom:updated>2020-10-07T02:08:19.594Z</atom:updated>
            <content:encoded><![CDATA[<p>To get high-availability with PostgreSQL, you definitely want to set up replication. My preferred approach is to set up the database instances in geographically apart locations, to minimize the probability of them going down simultaneously.</p><p>There are built-in options like logical replication and streaming replication. Streaming replication doesn’t give you 2-way replication or mirroring, so that’s out for me. This article doesn’t get into 2-way replication yet. I’ll add it later or write another article to add 2-way replication. Here is a <a href="https://www.2ndquadrant.com/en/blog/pglogical-logical-replication-postgresql-10/#:~:text=The%20PostgreSQL%2010%20built-in,create%20the%20tables%20beforehand%20manually.">detailed comparison </a>between pglogical and logical replication. The biggest plus with pglogical for me is conflict resolution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6ea0qZpu0CTg2qVzwNuNw.jpeg" /></figure><p>I had some challenges setting this up. The provided pglogical documentation is terse and makes a lot of assumptions about your knowledge.</p><p><strong>My environment:</strong></p><ul><li>PostgreSQL 12 (I don’t think pglogical has official support for 13 yet)</li><li>Centos 8</li><li>2 instances in different locations for more separation and better redundancy. I’m going to use IP addresses 1.1.1.1 for instance 1 and 2.2.2.2 for instance 2. The machine you connect from is 9.9.9.9. Please change these accordingly.</li><li>pglogical requires a superuser. I don’t like this, but it is what it is. The user I’m using is called <em>appuser</em>.</li></ul><p>One major problem I had was trying to get pglogical running with the default PostgreSQL installation. You cannot use the RPM install for pglogical if you have PostgreSQL installed. You’ll have to install from source. Since my setup was new, I chose to reinstall PostgreSQL from the from the recommended repos. Here’s a line about this from <a href="https://github.com/2ndQuadrant/pglogical">official documentation</a>.</p><p><em>To be able to install </em><strong><em>pglogical,</em></strong><em> these RPMs all require the PGDG PostgreSQL releases from </em><a href="http://yum.postgresql.org/"><em>http://yum.postgresql.org/</em></a><em>. You cannot use them with stock PostgreSQL releases included in Fedora and RHEL.</em></p><pre>sudo yum -y install <a href="https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm">https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm</a></pre><pre>yum install postgresql12-server postgresql12-contrib</pre><pre>curl <a href="https://access.2ndquadrant.com/api/repository/dl/default/release/12/rpm">https://access.2ndquadrant.com/api/repository/dl/default/release/12/rpm</a> | bash</pre><pre>yum -y install postgresql12-pglogical</pre><p>This is the default data path for this install.</p><p><em>/var/lib/pgsql/12/data/</em></p><p>Add these lines in this file: /var/lib/pgsql/12/data/<strong>postgresql.conf</strong></p><pre>wal_level = ‘logical’</pre><pre>max_worker_processes = 10 # one per database needed on provider node</pre><pre>max_replication_slots = 10 # one per node needed on provider node</pre><pre>max_wal_senders = 10 # one per node needed on provider node</pre><pre>shared_preload_libraries = ‘pglogical’</pre><pre>track_commit_timestamp = on</pre><pre>pglogical.conflict_resolution = &#39;last_update_wins&#39;</pre><h4>Enable trust login</h4><p>This step is not essential, but it makes it simpler to manage locally. Change the following in <em>/var/lib/pgsql/12/data/</em><strong>pg_hba.conf</strong></p><pre>local all  all           trust</pre><pre>host  all  127.0.0.1/32  trust</pre><h4>Allow external access</h4><p>In /var/lib/pgsql/12/data/<strong>postgresql.conf </strong>set</p><pre>listen_addresses = ‘*’</pre><p>In /var/lib/pgsql/12/data/<strong>pg_hba.conf </strong>set</p><p>On <strong>instance 1</strong>:</p><pre>host all all <em>2.2.2.2</em>/32 md5 # other machine’s IP</pre><pre>host all all <em>1.1.1.1</em>/32 md5 # <strong>this </strong>machine’s IP</pre><pre>host all all <em>9.9.9.9</em>/32 md5 # your dev machine’s IP</pre><p>On <strong>instance 2</strong>:</p><pre>host all all <em>1.1.1.1</em>/32 md5 # other machine’s IP</pre><pre>host all all 2.2.2.2/32 md5 # <strong>this</strong> machine’s IP</pre><pre>host all all <em>9.9.9.9</em>/32 md5 # your dev machine’s IP</pre><p>For some reason, the own machine’s IP is also required for this to work</p><h3>Create user and database</h3><p>On <strong>both instances</strong>, log in and create the user and databases.</p><pre>psql -U postgres</pre><pre>CREATE USER <em>appuser </em>WITH PASSWORD &#39;<em>apppass</em>&#39; WITH superuser;</pre><pre>CREATE DATABASE <em>appdb</em> WITH OWNER <em>appuser</em>;</pre><h3>Install CITEXT &amp; pglogical</h3><p>You can skip CITEXT — it allows for a case-insensitive text datatype, which I find very useful.</p><p>On <strong>both instances</strong></p><pre>psql -U postgres</pre><pre>\c appdb</pre><pre><strong>CREATE</strong> EXTENSION IF <strong>NOT</strong> <strong>EXISTS</strong> <em>citext</em> <strong>WITH</strong> <strong>SCHEMA</strong> <strong>public</strong>;</pre><pre><strong>CREATE</strong> EXTENSION <em>pglogical</em>;</pre><h3>Set up provider</h3><p><strong>Instance 1</strong></p><pre>select pglogical.create_node(node_name := &#39;provider1&#39;, dsn := &#39;host=<em>1.1.1.1</em> port=5432 dbname=<em>appdb</em> user=<em>appuser</em> password=apppass&#39;);</pre><pre>SELECT pglogical.replication_set_add_all_tables(&#39;default&#39;, ARRAY[&#39;public&#39;]);</pre><pre>grant usage on schema pglogical to <em>appdb</em>;</pre><h3>Fix pg_current_xlog_location bug</h3><p>On my setup, on <strong>instance 2</strong>, I encountered a bug where pglogical would call pg_current_xlog_location(). This has been replaced by pg_current_wal_lsn() since PostgreSQL 10. You can skip this step if you don’t run in to this bug.</p><pre>CREATE FUNCTION pg_catalog.pg_current_xlog_location() RETURNS pg_lsn AS $$</pre><pre>BEGIN</pre><pre>RETURN pg_current_wal_lsn();</pre><pre>END;</pre><pre>$$ LANGUAGE plpgsql;</pre><pre>CREATE FUNCTION pg_catalog.pg_last_xlog_receive_location() RETURNS pg_lsn AS $$</pre><pre>BEGIN</pre><pre>RETURN pg_last_wal_receive_lsn();</pre><pre>END;</pre><pre>$$ LANGUAGE plpgsql;</pre><h3>Set up subscriber</h3><p>Make sure you set up the table schema on instance 2 identical to instance 1 before you do the following. It will not work otherwise.</p><p><strong>Instance 2</strong></p><pre>SELECT pglogical.create_node( node_name := ‘subscriber1’, dsn := ‘host=<em>2.2.2.2</em> port=5432 dbname=<em>appdb </em>user=<em>appuser </em>password=<em>apppass</em>’ );</pre><pre>SELECT pglogical.create_subscription( subscription_name := ‘subscription1’, provider_dsn := ‘host=<em>1.1.1.1</em> port=5432 dbname=<em>appdb</em> user=<em>appuser </em>password=<em>apppass</em>’ );</pre><h4>Check status</h4><pre>select subscription_name, status FROM pglogical.show_subscription_status();</pre><h4>Check replication completed</h4><pre>SELECT pglogical.wait_for_subscription_sync_complete(‘subscription1’);</pre><h4>Drop subscription</h4><p>During the process of getting this running, I had to drop and recreate the subscription and nodes several times. Here are the commands for that, if you need to do it.</p><pre>SELECT pglogical.drop_subscription(‘subscription1’);</pre><h4>Drop node</h4><pre>SELECT pglogical.drop_node(‘subscriber1’);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8212e77ebc1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips on applying for a Software Engineer position]]></title>
            <link>https://medium.com/@Navmed/tips-on-applying-for-a-software-engineer-position-2aaf4196b78f?source=rss-451c9e5e97b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2aaf4196b78f</guid>
            <category><![CDATA[job-application]]></category>
            <category><![CDATA[resume]]></category>
            <dc:creator><![CDATA[Naveed Ahmed]]></dc:creator>
            <pubDate>Mon, 16 Oct 2017 02:54:25 GMT</pubDate>
            <atom:updated>2018-02-06T16:10:48.845Z</atom:updated>
            <content:encoded><![CDATA[<p>A good part of my role as CTO has been building a software development team. During this process, I&#39;ve seen all kinds of resumes and all kinds of applicants. I thought I’d write this up to help applicants improve their application approach. I’m going to try to skip the obvious that’s been repeated ad-nauseam across the net.</p><p>These tips are focused on US based positions. Tweak accordingly for your country.</p><p>- You don’t need a photo on your resume. Please remove it if you have one — this is not a modeling position.<br>- If you have a photo on your email profile, it will probably show up with your application. If you choose to keep the photo, it should be of yourself, by yourself. A smile is great, but limit it to that, don’t make funny faces. Keep it professional, you don’t have to wear a suit, but please do not wear a wife-beater (sleeveless undershirt) <a href="https://mic.com/articles/139771/why-are-we-still-calling-white-tank-tops-wife-beaters#.BlQiJSAHZ">https://mic.com/articles/139771/why-are-we-still-calling-white-tank-tops-wife-beaters#.BlQiJSAHZ</a> either. It should not include other people — even your significant other, child, dog or pet rock. Leave that for instagram.<br>- Use an email address that has your full name in it — funky ones are not only not particularly professional, but not easy to find when I’m searching for you later. Numbers after your name is fine, leave the cutesy email addresses for personal contacts. If your name is John Doe, a good email address would be john.doe.1007@gmail.com. A gmail tip: gmail ignores the dots in your email address, johndoe1007@gmail is identical to john.doe.1007@gmail.com.<br>- Make sure your email client uses your full name when sending emails.<br>- Remove irrelevant content from your resume, no body cares if you pushed shopping carts or waited tables before, it’s irrelevant to this position.<br>- Don’t list hobbies, passions, unless relevant to the job.<br>- I don’t care if your resume is one page or five, but it needs to be easy to read and scan for relevant information. Ideally you want a resume for each job type. Say you’re applying for an android developer job — don’t remove your web experience, but highlight the android experience, make my job easier.<br>- Make sure you’ve actually attached your resume.<br>- Make a serious effort to make your resume look presentable. No, you may not be applying for a designer job, but your job will reflect the work of a designer and an eye for detail is important. You don’t have to take design courses, but pick a decent typeface, don’t use Times News Roman, Arial and I shouldn&#39;t even have to mention this — Comic Sans. Use one and only one typeface — don’t mix multiple typefaces across the resume. Make sure your bullets and tables are aligned. Make sure there’s adequate spacing between sections. Make sure a section heading is not one page and the content on the next, move the whole section to the next page if this happens. The easiest thing to do is find an online template — search, there are many out there.<br>- Colors are OK, but don’t use hard to read or garish ones — unless you have a good eye for design, this might be better used from templates.<br>- Don’t title your resume with Resume, or Curriculum Vitae, I know what it is, put your full name there.<br>- Leave out the meaningless objective, instead put in a 2–5 line summary of yourself.<br>- Make sure your resume looks good when seen from the GMail viewer. Send it to yourself and see how it looks for your recipient. Some resumes get mangled and make you look bad. While you’re at it, make sure you test with the Microsoft Office Online viewer as well.<br>- You don’t need an address on your resume, but definitely include your city and state, email, phone and other contact info like linkedin, skype, etc, if you use it. If you’re applying for a position in another country, remote or otherwise, mention the country where you live.<br>- Make sure all links are clickable and work correctly.<br>- If you want to show case an app, try to put it on the app/play store. Try to have this under your name — it makes it obvious that it’s yours. Having this under a company name yours or otherwise, makes it harder to prove that it’s yours. This is far more likely to be looked at than looking at the source-code you have on github. If you are applying for a job in a different country, make sure it’s accessible from the target country. Don’t put screenshots within your resume, attach a separate document.<br>- Don’t use emojis, lol or smiley faces in your resume or cover letter<br>- Don’t refer to yourself in the third person — “Mr. So&amp;So has created this wonderful app” on your resume and especially in your cover letter. It sounds ridiculous. Either be direct and say “I have created this wonderful app” or don’t refer to yourself at all and say “Created this wonderful app”.<br>- A cover letter is highly encouraged. Keep it brief — 3–5 lines. Mention directly related experience that would make you a good fit. Mention anything that makes you stand out positively. Don’t ramble, don’t mention irrelevancies. Cover letters should absolutely be targeted to the company and position you’re applying. Be careful not to mention the wrong company’s name in the cover letter.<br>- This one should be obvious, but you’d be surprised how many resumes I receive in foreign languages. If you’re applying for a job in the US, make sure your cover letter and resume are in English.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2aaf4196b78f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>