<?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: samuele sala</title>
    <description>The latest articles on Forem by samuele sala (@samuele_sala_f712f688c7f2).</description>
    <link>https://forem.com/samuele_sala_f712f688c7f2</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%2F3353407%2F7b4807b3-1ab9-48e2-b70c-eb45f66e7fd3.jpg</url>
      <title>Forem: samuele sala</title>
      <link>https://forem.com/samuele_sala_f712f688c7f2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/samuele_sala_f712f688c7f2"/>
    <language>en</language>
    <item>
      <title>Refactoring a monolithic MPA platform - memory wiped on every deploy</title>
      <dc:creator>samuele sala</dc:creator>
      <pubDate>Wed, 23 Jul 2025 10:40:45 +0000</pubDate>
      <link>https://forem.com/samuele_sala_f712f688c7f2/refactoring-a-monolithic-mpa-platform-memory-wiped-on-every-deploy-68e</link>
      <guid>https://forem.com/samuele_sala_f712f688c7f2/refactoring-a-monolithic-mpa-platform-memory-wiped-on-every-deploy-68e</guid>
      <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I’m a self-taught fullstack dev. I built a multiplayer writing platform using Node.js, static HTML-EJS, PostgreSQL and railway for the deployment. Everything is bundled together in a single monolithic app (frontend, backend, game logic, etc.).&lt;/p&gt;

&lt;p&gt;The issue: every time I push new code, the entirety of the app obviously restarts, and all the in-memory game data is lost.&lt;/p&gt;

&lt;p&gt;Basically, the platform creates live games that exist in memory until they're finished. Once a match is over, the "story" get saved permanently to the database. But during the game, it all lives in RAM. Since it's collaborative and competitive, players write in turns, on a timer, in teams, and these sessions must stay alive. A restart breaks everything.&lt;/p&gt;

&lt;p&gt;This was fine early on, but now I want to find a real solution.&lt;/p&gt;

&lt;p&gt;I was thinking of splitting the platform into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a static frontend&lt;/li&gt;
&lt;li&gt;a backend for APIs and auth&lt;/li&gt;
&lt;li&gt;a separate game engine (where live matches run)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But I’ve never done this kind of separation before. Also looked into Redis, but it feels a bit advanced for me right now.&lt;/p&gt;

&lt;p&gt;Anyone here ever dealt with something similar? Any advice on how to approach this transition?&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>node</category>
    </item>
  </channel>
</rss>
