<?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>Forem: Aditya</title>
    <description>The latest articles on Forem by Aditya (@im_aditya30).</description>
    <link>https://forem.com/im_aditya30</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%2F1033613%2F1994bcd0-d308-40dd-b6c1-ef7b29e62648.png</url>
      <title>Forem: Aditya</title>
      <link>https://forem.com/im_aditya30</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/im_aditya30"/>
    <language>en</language>
    <item>
      <title>A beginner friendly guide on Installing Apache AGE and PostgreSQL from source on WSL</title>
      <dc:creator>Aditya</dc:creator>
      <pubDate>Sun, 26 Feb 2023 11:51:46 +0000</pubDate>
      <link>https://forem.com/im_aditya30/a-beginner-friendly-guide-on-installing-apache-age-and-postgresql-from-source-on-wsl-24fp</link>
      <guid>https://forem.com/im_aditya30/a-beginner-friendly-guide-on-installing-apache-age-and-postgresql-from-source-on-wsl-24fp</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Graph databases are gaining popularity due to their inherent design of storing and managing data using graph structures and being able to model and query complex relationships intuitively. There are several graph database technologies available in the market, and one of the technologies we will see today is Apache AGE. &lt;br&gt;
PostgreSQL is one of the most popular and powerful open-source Relational Database Management Systems (RDMS), built upon it is an extension of Apache AGE which is an open-source project that supports the property graph model and provides a native graph storage and processing engine for managing large-scale graph data. Today we will see a step-by-step guide on installing and setting up Apache AGE and PostgreSQL. &lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisite before Installation
&lt;/h2&gt;

&lt;p&gt;Before starting the installation you should have WSL enabled and installed on your system. If you don't have WSL installed you can consider the &lt;a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;official docs here&lt;/a&gt; or you can also take help from this &lt;a href="//omgubuntu.co.uk/how-to-install-wsl2-on-windows-10"&gt;blog&lt;/a&gt;. After installing WSL you should also have git installed and if not take help from &lt;a href="https://github.com/git-guides/install-git#install-git-on-linux" rel="noopener noreferrer"&gt;here&lt;/a&gt; and follow the guidelines of installing on Linux.&lt;/p&gt;

&lt;p&gt;I have used ubuntu on WSL and below are the steps for installing Apache AGE and PostgreSQL from the source.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation:
&lt;/h2&gt;

&lt;p&gt;First lets make a new directory so as to making up the installation clean.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir apache
cd apache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also need some important libraries which can be downloaded by using the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. Installing Postgres from Source:
&lt;/h3&gt;

&lt;p&gt;For installing Postgres you need to install a compatible version of Postgres and currently AGE supports only Postgres version 11 and 12.&lt;/p&gt;

&lt;p&gt;Here I am using version 11.18.&lt;/p&gt;

&lt;p&gt;To install postgresql:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the postgresql using the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://ftp.postgresql.org/pub/source/v11.18/postgresql-11.18.tar.gz &amp;amp;&amp;amp; tar -xvf postgresql-11.18.tar.gz &amp;amp;&amp;amp; rm -f postgresql-11.18.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command would download and extract the postgresql-11.18.&lt;br&gt;
You would see the following output:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsq21c56faamuj0llz255.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsq21c56faamuj0llz255.png" alt="Download output" width="592" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuring and installing postgresql using the following commands:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd postgresql-11.18

# configuring
./configure --prefix=$(pwd) --enable-debug --enable-cassert CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

# installing
make install

# moving back to apache folder
cd ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This would take a while to complete and after completion you would see the following output after the make install command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbzvrhzrzco2pql2zpuo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbzvrhzrzco2pql2zpuo.png" alt="Install complete output" width="800" height="107"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;NOTE: If the make install command gives you error, try &lt;code&gt;sudo make install&lt;/code&gt; as sometimes the home directory in windows is a protected folder and you need admin permissions to add files to it.&lt;/p&gt;

&lt;p&gt;Also in the above command the prefix flag contains the path where PSQL would install you can either replace the path to your custom or this would install in the &lt;code&gt;postgresql-11.18&lt;/code&gt; directory.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  2. Installing Apache AGE:
&lt;/h3&gt;

&lt;p&gt;Follow the following commands to install and setup AGE.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/apache/age.git

# configuring AGE with PostgreSQL.
sudo make PG_CONFIG=/home/aditya/apache/postgresql-11.18/bin/pg_config install

# checking if everything is alright
make PG_CONFIG=/home/aditya/Apache/postgresql-11.18/bin/pg_config installcheck
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;In the above command PG_CONFIG would point to the &lt;code&gt;pg_config&lt;/code&gt; file which is stored in the &lt;code&gt;bin&lt;/code&gt; folder. Also the &lt;code&gt;installcheck&lt;/code&gt; command would check if the installation has been successful.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After the above commands you would see the following output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0i7i10902c8l4mx8ofk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0i7i10902c8l4mx8ofk.png" alt="Tests Passed output" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;p&gt;You can check the following for more info on installation and setup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/75096701/how-to-install-age-extension-of-postgresql-from-source-code-in-ubuntu/75116011#75116011" rel="noopener noreferrer"&gt;Ubuntu Installation - Stackoverflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://age.apache.org/age-manual/master/intro/setup.html" rel="noopener noreferrer"&gt;Apache AGE Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.postgresql.org/docs/current/install-procedure.html" rel="noopener noreferrer"&gt;PostgreSQL Installation&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Installation on other OS:
&lt;/h3&gt;

&lt;p&gt;For installation on other operating systems you can check out the following blogs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/xk_woon/how-to-install-postgresql-and-apache-age-on-macos-45m8"&gt;MacOS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p"&gt;Windows&lt;/a&gt; (This covers a different approach which you can use).&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/talhahahae/installation-of-apache-age-and-postgresql-from-source-in-linux-part-1-gka"&gt;Linux&lt;/a&gt; - Although the steps for Linux might be same this blog also has a &lt;a href="https://dev.to/talhahahae/initialization-and-creating-a-database-for-testing-the-installation-of-postgres-and-age-part-2-118l"&gt;part-2&lt;/a&gt; which contains instruction for testing.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Video tutorials
&lt;/h3&gt;

&lt;p&gt;You can also check the following video tutorials:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://youtu.be/ddk8VX8Hm-I" rel="noopener noreferrer"&gt;Windows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtu.be/0-qMwpDh0CA" rel="noopener noreferrer"&gt;MacOS&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a detailed tutorial you can check out &lt;a href="https://theundersurfers.netlify.app/age-installation" rel="noopener noreferrer"&gt;this&lt;/a&gt; blog too!&lt;/p&gt;

&lt;p&gt;You can also visit &lt;a href="https://github.com/apache/age" rel="noopener noreferrer"&gt;Apache AGE Github&lt;/a&gt; repository to start contributing or can visit their &lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;website&lt;/a&gt; for more info.&lt;/p&gt;

&lt;p&gt;That's it for today guys. I hope this would help you in getting started with Apache AGE.&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>discuss</category>
      <category>productivity</category>
      <category>career</category>
    </item>
  </channel>
</rss>
