<?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: Anushka Perera</title>
    <description>The latest articles on Forem by Anushka Perera (@anush09).</description>
    <link>https://forem.com/anush09</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%2F3826190%2F9407cce1-8481-4cd6-9304-93ebe8201e78.png</url>
      <title>Forem: Anushka Perera</title>
      <link>https://forem.com/anush09</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/anush09"/>
    <language>en</language>
    <item>
      <title>𝗚𝘂𝗶𝗱𝗲 #𝟬𝟱: 𝗗𝗲𝗲𝗽 𝗱𝗶𝘃𝗲 𝗶𝗻𝘁𝗼 𝗣𝗛𝗣, 𝗔𝗽𝗮𝗰𝗵𝗲, 𝗮𝗻𝗱 𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟 𝗮𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲</title>
      <dc:creator>Anushka Perera</dc:creator>
      <pubDate>Tue, 24 Mar 2026 03:27:13 +0000</pubDate>
      <link>https://forem.com/anush09/--a7j</link>
      <guid>https://forem.com/anush09/--a7j</guid>
      <description>&lt;p&gt;High Availability, Scaling, and Security for enterprise-level applications.&lt;br&gt;
Here are my top takeaways from today's study:&lt;/p&gt;

&lt;p&gt;𝟭. 𝗥𝗲𝗮𝗹 𝗦𝗲𝗰𝘂𝗿𝗶𝘁𝘆 𝗥𝗲𝗾𝘂𝗶𝗿𝗲𝘀 𝗘𝗻𝗳𝗼𝗿𝗰𝗲𝗺𝗲𝗻𝘁&lt;br&gt;
Simply enabling ssl=on in PostgreSQL doesn’t mean your connections are actually secure. To truly enforce encrypted communication between your PHP app and the database, you must update the pg_hba.conf file to use the hostssl keyword. Without this, clients can still bypass SSL and expose sensitive data.&lt;/p&gt;

&lt;p&gt;𝟮. 𝗧𝗵𝗲 "𝗣𝗿𝗼𝗰𝗲𝘀𝘀-𝗽𝗲𝗿-𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻" 𝗕𝗼𝘁𝘁𝗹𝗲𝗻𝗲𝗰𝗸&lt;br&gt;
Unlike MySQL, which uses lightweight threads, PostgreSQL creates an entirely new process for every single connection, consuming about 9 MB of memory each. If your PHP application gets a traffic spike, you will run out of memory incredibly fast. The solution? Specialized connection pooling using PgBouncer. Using transaction-level pooling allows a small handful of database connections to safely handle thousands of incoming PHP requests.&lt;/p&gt;

&lt;p&gt;𝟯. 𝗛𝗶𝗴𝗵 𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗶𝗹𝗶𝘁𝘆 𝗖𝗹𝘂𝘀𝘁𝗲𝗿𝘀&lt;br&gt;
To ensure an application never goes down, we have to move beyond a single server. I looked into two different clustering models: keepalived-repmgr (same-containment) and HAProxy-PgBouncer (cross-containment). HAProxy-PgBouncer not only provides load balancing across different network zones but also improves transaction throughput by up to 9.4%.&lt;/p&gt;

&lt;p&gt;𝟰. 𝗛𝗼𝗿𝗶𝘇𝗼𝗻𝘁𝗮𝗹 𝗦𝗰𝗮𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗖𝗶𝘁𝘂𝘀&lt;br&gt;
When vertical scaling (buying bigger servers) hits its limit, horizontal scaling is the answer. The Citus extension transforms PostgreSQL into a distributed database by sharding data across multiple worker nodes while maintaining full SQL compatibility. A major key to making this fast is "co-location"—ensuring related records (like a user and their orders) live on the exact same physical node so that JOIN operations happen instantly without cross-node network calls.&lt;/p&gt;

&lt;p&gt;hashtag#PostgreSQL hashtag#PHP hashtag#Apache hashtag#SystemArchitecture hashtag#HighAvailability hashtag#PgBouncer hashtag#WebDevelopment hashtag#Citus hashtag#DatabaseScaling&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>php</category>
      <category>postgres</category>
      <category>security</category>
    </item>
    <item>
      <title>𝗚𝘂𝗶𝗱𝗲 #𝟬𝟰: 𝗦𝗰𝗮𝗹𝗶𝗻𝗴 𝘁𝗵𝗲 𝗦𝘁𝗮𝗰𝗸 (𝗔𝗽𝗮𝗰𝗵𝗲, 𝗣𝗛𝗣, 𝗮𝗻𝗱 𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟)</title>
      <dc:creator>Anushka Perera</dc:creator>
      <pubDate>Fri, 20 Mar 2026 04:20:51 +0000</pubDate>
      <link>https://forem.com/anush09/--2bep</link>
      <guid>https://forem.com/anush09/--2bep</guid>
      <description>&lt;p&gt;Following up on our "Digital Handshake," it’s time to look under the hood at how we move from a simple connection to a high-performance, scalable architecture. In this guide, we dive into the integration between the Web Server, Execution Engine, and Database.&lt;/p&gt;

&lt;p&gt;𝗧𝗵𝗲 𝗘𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗘𝗻𝗴𝗶𝗻𝗲: 𝗪𝗵𝘆 𝗣𝗛𝗣-𝗙𝗣𝗠 𝗪𝗶𝗻𝘀&lt;br&gt;
While the legacy mod_php embeds the interpreter in every Apache process (which is "PHP heavy" and wastes RAM), PHP-FPM is the 2026 Performance Standard.&lt;br&gt;
Superior Isolation: It handles a pool of worker processes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adaptive Scaling: Better performance under high load and efficient opcode caching.&lt;/li&gt;
&lt;li&gt;Efficiency: It only processes what is needed, leaving static content to the web server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟 𝗔𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 &amp;amp; 𝗦𝗰𝗮𝗹𝗮𝗯𝗶𝗹𝗶𝘁𝘆&lt;br&gt;
PostgreSQL uses a Process-per-Connection model. Every time a client connects, it spawns a full OS process.&lt;br&gt;
The Risk: High isolation but also high resource cost (roughly 9MB RAM per process), which can lead to resource exhaustion warnings.&lt;br&gt;
The Solution: Connection Pooling is essential. Tools like PgBouncer manage a pool of persistent connections, reducing the overhead of constant process forking and allowing your app to scale.&lt;/p&gt;

&lt;p&gt;𝗧𝗵𝗲 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗮𝘁𝗶𝗼𝗻 𝗗𝘂𝗼&lt;br&gt;
To keep your database healthy and secure, you must master these two files:&lt;br&gt;
postgresql.conf: Your primary file for managing network settings, memory limits, and the max_connections parameter.&lt;br&gt;
pg_hba.conf: The Host-Based Authentication file. This controls which users and IP addresses can access specific databases.&lt;br&gt;
Security Tip: Use the hostssl keyword instead of host in pg_hba.conf to mandate SSL/TLS encryption for remote connections.&lt;/p&gt;

&lt;p&gt;𝗜𝗺𝗽𝗹𝗲𝗺𝗲𝗻𝘁𝗮𝘁𝗶𝗼𝗻 𝗘𝘅𝗮𝗺𝗽𝗹𝗲&lt;br&gt;
Ready to link them? Use the pg_connect() function to establish that secure bridge:&lt;br&gt;
$𝘤𝘰𝘯𝘯 = 𝘱𝘨_𝘤𝘰𝘯𝘯𝘦𝘤𝘵("𝘩𝘰𝘴𝘵=𝘭𝘰𝘤𝘢𝘭𝘩𝘰𝘴𝘵 𝘥𝘣𝘯𝘢𝘮𝘦=𝘮𝘺𝘥𝘣 𝘶𝘴𝘦𝘳=𝘮𝘺𝘶𝘴𝘦𝘳 𝘱𝘢𝘴𝘴𝘸𝘰𝘳𝘥=𝘮𝘺𝘱𝘢𝘴𝘴");&lt;/p&gt;

&lt;p&gt;Whether you are building a Learning Management System or a Sales Order app, understanding these architectural layers ensures your platform stays fast as your user base grows.&lt;/p&gt;

&lt;p&gt;hashtag#PostgreSQL hashtag#PHP hashtag#Apache hashtag#WebArchitecture hashtag#Scalability hashtag#BackendDevelopment hashtag#DatabaseScaling hashtag#TechGuide&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>𝗚𝘂𝗶𝗱𝗲 #𝟬𝟯: 𝗧𝗵𝗲 𝗙𝘂𝗹𝗹-𝗦𝘁𝗮𝗰𝗸 𝗕𝗿𝗶𝗱𝗴𝗲</title>
      <dc:creator>Anushka Perera</dc:creator>
      <pubDate>Thu, 19 Mar 2026 03:17:41 +0000</pubDate>
      <link>https://forem.com/anush09/--33e6</link>
      <guid>https://forem.com/anush09/--33e6</guid>
      <description>&lt;p&gt;𝗠𝗮𝘀𝘁𝗲𝗿𝗶𝗻𝗴 𝘁𝗵𝗲 𝗗𝗶𝗴𝗶𝘁𝗮𝗹 𝗛𝗮𝗻𝗱𝘀𝗵𝗮𝗸𝗲 (𝗔𝗽𝗮𝗰𝗵𝗲 &amp;amp; 𝗣𝗛𝗣)&lt;br&gt;
Ever wonder exactly what happens between a user clicking a link and your PostgreSQL data appearing on their screen? It’s all about the "Digital Handshake" between Apache and PHP.&lt;br&gt;
As I continue my series on database and server connectivity, today’s deep dive is into how the web server (delivery) and the scripting language (logic) work together to create dynamic experiences.&lt;/p&gt;

&lt;p&gt;🤝 The Roles: Server vs. Script&lt;br&gt;
Apache: Acts as the Web Server. Think of it as the delivery person that handles requests and serves content to the world.&lt;br&gt;
PHP: Acts as the Scripting Language. This is the brain behind the operation, processing logic and communicating with databases like PostgreSQL.&lt;/p&gt;

&lt;p&gt;🔄 The 4-Step Workflow&lt;br&gt;
Client Requests Page: A user enters a URL in their browser.&lt;br&gt;
Apache Receives: The server catches the request and realizes it needs processing.&lt;br&gt;
PHP Interprets Code: PHP goes to work, executing scripts and fetching data.&lt;br&gt;
HTML Returns: The final, processed result is sent back to the user as a clean webpage.&lt;/p&gt;

&lt;p&gt;⚡ Modern Integration: PHP-FPM vs. mod_php&lt;br&gt;
Choosing how these two talk to each other is critical for performance:&lt;br&gt;
The 2026 Recommendation: Use PHP-FPM.&lt;br&gt;
Why? Unlike the legacy mod_php which embeds PHP inside Apache, PHP-FPM uses isolated worker pools for superior speed, security, and high performance in modern environments.&lt;br&gt;
Configuration Tip: With PHP-FPM, use php.ini for global settings, as .htaccess won't support PHP directives in this mode.&lt;/p&gt;

&lt;p&gt;⚠️ Pro-Tip from the Trenches&lt;br&gt;
If you're following along on macOS and hitting the zsh: command not found: psql error, remember that installation is only half the battle—configuration is the other half! Always ensure your PATH is set correctly so your terminal knows where your tools live.&lt;/p&gt;

&lt;p&gt;hashtag#WebDevelopment hashtag#Apache hashtag#PHP hashtag#PostgreSQL hashtag#FullStack hashtag#BackendEngineering hashtag#CodingTips hashtag#TechTutorial&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>php</category>
      <category>laravel</category>
    </item>
    <item>
      <title>𝗚𝘂𝗶𝗱𝗲 #𝟬𝟮: 𝗧𝗵𝗲 𝗙𝘂𝗹𝗹-𝗦𝘁𝗮𝗰𝗸 𝗕𝗿𝗶𝗱𝗴𝗲</title>
      <dc:creator>Anushka Perera</dc:creator>
      <pubDate>Tue, 17 Mar 2026 03:21:55 +0000</pubDate>
      <link>https://forem.com/anush09/--5a14</link>
      <guid>https://forem.com/anush09/--5a14</guid>
      <description>&lt;p&gt;𝗧𝗵𝗲 𝗥𝗼𝗮𝗱𝗺𝗮𝗽: 𝗣𝗿𝗼𝘀𝗴𝗿𝗲𝗦𝗤𝗟 + 𝗔𝗽𝗮𝗰𝗵𝗲 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝘃𝗶𝘁𝘆 𝗥𝗼𝗮𝗱𝗺𝗮𝗽&lt;br&gt;
(𝗙𝗿𝗼𝗺 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗜𝗻𝘀𝘁𝗮𝗹𝗹 𝘁𝗼 𝗪𝗲𝗯 𝗩𝗶𝗲𝘄𝗶𝗻𝗴)&lt;br&gt;
Connecting PostgreSQL to Apache doesn't have to be a headache. Whether you're building a local dev environment or a production-ready web app, here is the complete 4-phase journey to getting your data on the web:&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟭: 𝗜𝗻𝘀𝘁𝗮𝗹𝗹𝗮𝘁𝗶𝗼𝗻&lt;br&gt;
Depending on your OS, the start line looks a bit different:&lt;br&gt;
Windows: Use Bitnami WAPP/WAMP for an all-in-one package (Apache, PostgreSQL, PHP).&lt;br&gt;
Linux: Use native package managers like apt-get (Ubuntu/Debian) or yum (RHEL/CentOS).&lt;br&gt;
macOS: Follow official .dmg installers or stack packages to establish your local server.&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟮: 𝗦𝗲𝗿𝘃𝗲𝗿 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗮𝘁𝗶𝗼𝗻&lt;br&gt;
You need to "bridge" the gap between your web server and database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;php.ini: Enable the bridge by uncommenting extension=php_pgsql.dll (Windows) or ensuring php-pgsql is active.&lt;/li&gt;
&lt;li&gt;pg_hba.conf: Set up access control by allowing specific IP addresses or localhosts to connect (e.g., host all all 127.0.0.1/32 trust).&lt;/li&gt;
&lt;li&gt;postgresql.conf: Ensure your database is listening on the right network by setting listen_addresses = '*' and verifying the default port 5432.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟯: 𝗖𝗼𝗻𝗻𝗲𝗰𝘁 𝘃𝗶𝗮 𝗽𝗴𝗔𝗱𝗺𝗶𝗻&lt;br&gt;
Once the server is running, use a GUI like pgAdmin to: Create a new database (e.g., test_db) as a superuser.&lt;br&gt;
Initialize the Schema: Use the Query Tool to run CREATE TABLE commands and define your primary keys and data types.&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟰: 𝗪𝗲𝗯 𝗩𝗶𝗲𝘄𝗶𝗻𝗴 (𝗣𝗛𝗣 𝗦𝗰𝗿𝗶𝗽𝘁𝘀)&lt;br&gt;
Finally, pull the data into your browser: The Connection Script: Use pg_connect() to link your PHP file to your database host and credentials.&lt;br&gt;
The Alternative: For a more portable approach, use PDO (PHP Data Objects) to manage connections and handle exceptions.&lt;/p&gt;

&lt;p&gt;𝗧𝗿𝗼𝘂𝗯𝗹𝗲𝘀𝗵𝗼𝗼𝘁𝗶𝗻𝗴 𝗖𝗼𝗺𝗺𝗼𝗻 𝗚𝗼𝘁𝗰𝗵𝗮𝘀&lt;br&gt;
Getting an error? &lt;/p&gt;

&lt;p&gt;Check these first:&lt;br&gt;
Connection Refused? Verify the PostgreSQL service is actually running.&lt;br&gt;
Too Many Clients? Increase the max_connections limit in postgresql.conf.&lt;br&gt;
No pg_hba.conf entry? Your IP might not be authorized yet!.&lt;/p&gt;

&lt;p&gt;hashtag#PostgreSQL hashtag#WebDevelopment hashtag#Apache hashtag#PHP hashtag#FullStack hashtag#Database hashtag#CodingTips hashtag#anu_web&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>php</category>
      <category>laravel</category>
      <category>programming</category>
    </item>
    <item>
      <title>𝗚𝘂𝗶𝗱𝗲 #𝟬1: 𝗧𝗵𝗲 𝗙𝘂𝗹𝗹-𝗦𝘁𝗮𝗰𝗸 𝗕𝗿𝗶𝗱𝗴𝗲</title>
      <dc:creator>Anushka Perera</dc:creator>
      <pubDate>Mon, 16 Mar 2026 03:06:07 +0000</pubDate>
      <link>https://forem.com/anush09/1--2m42</link>
      <guid>https://forem.com/anush09/1--2m42</guid>
      <description>&lt;p&gt;𝗕𝗲𝗴𝗶𝗻𝗻𝗲𝗿 𝗪𝗲𝗯 𝗙𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 𝗟𝗮𝘂𝗻𝗰𝗵 𝗣𝗮𝘁𝗵&lt;br&gt;
𝗣𝗵𝗮𝘀𝗲 𝟭: 𝗙𝗼𝘂𝗻𝗱𝗮𝘁𝗶𝗼𝗻𝘀 &amp;amp; 𝗦𝗲𝘁𝘂𝗽&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;&lt;br&gt;
The Goal: Move beyond "Hello World" to understanding how data flows through a web application.&lt;br&gt;
Installation: Modern Laravel (v11/12) focuses on a "slim" structure to reduce complexity for newcomers.&lt;br&gt;
Routing &amp;amp; Controllers: Learn to define entry points for your app and use Route Names so you can change URLs later without breaking your internal links.&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟮: 𝗧𝗵𝗲 𝗖𝗼𝗿𝗲 𝗟𝗼𝗴𝗶𝗰 𝗦𝘁𝗮𝗰𝗸&lt;br&gt;
To build a functional app, beginners must master these three pillars:&lt;br&gt;
Blade Templating: The engine for creating your front-end views using pure PHP and HTML.&lt;br&gt;
Authentication Basics: Use Laravel's built-in "Starter Kits" to handle user registration and login securely without writing custom security logic.&lt;br&gt;
Database &amp;amp; Eloquent: Understand Migrations (version control for your database) and Eloquent (the tool that lets you talk to your database like it’s a standard PHP object).&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟯: 𝗧𝗵𝗲 𝗕𝗲𝗴𝗶𝗻𝗻𝗲𝗿 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗠𝗶𝗹𝗲𝘀𝘁𝗼𝗻𝗲&lt;br&gt;
The Project: Create a Simple Personal Blog.&lt;br&gt;
Key Feature: Master a full CRUD (Create, Read, Update, Delete) cycle. This includes handling forms, validating user input, and managing file uploads for images.&lt;br&gt;
Constraint: At this stage, avoid complex architectures like Domain-Driven Design (DDD). It is recommended to master the basics and traditional MVC first before adding architectural overhead.&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟰: 𝗧𝗵𝗲 𝗟𝗮𝘂𝗻𝗰𝗵 (𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁 𝗢𝗽𝘁𝗶𝗼𝗻𝘀)&lt;br&gt;
Sharing how to get an app live is the final step. Beginners have three primary official paths:&lt;br&gt;
Laravel Cloud (Recommended for Beginners): A "zero DevOps" platform that manages everything—databases, caching, and domains—so you can focus purely on code.&lt;br&gt;
Laravel Forge: Best if you want to own your own server (e.g., on DigitalOcean) but want an automated tool to handle the setup.&lt;br&gt;
Laravel Vapor: A serverless option for high-scale apps, though it is more complex and requires AWS knowledge.&lt;/p&gt;

&lt;p&gt;𝗣𝗵𝗮𝘀𝗲 𝟱: 𝗧𝗵𝗲 𝗥𝗼𝗮𝗱𝗺𝗮𝗽 𝘁𝗼 𝗝𝘂𝗻𝗶𝗼𝗿 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿&lt;br&gt;
Once the blog is launched, the next step is building a Simple CRM for a client or getting a first job. This involves learning Middleware, API Basics, and Automated Testing with tools like Pest to ensure your code is reliable.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>php</category>
      <category>postgres</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
