<?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>DEV Community: Bright Machawira</title>
    <description>The latest articles on DEV Community by Bright Machawira (@briteatom).</description>
    <link>https://dev.to/briteatom</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260184%2Fe0a95420-d681-4c11-ae60-b9e3a6f2047f.jpg</url>
      <title>DEV Community: Bright Machawira</title>
      <link>https://dev.to/briteatom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/briteatom"/>
    <language>en</language>
    <item>
      <title>Deciding the irreversible first: four database choices I made before writing any features</title>
      <dc:creator>Bright Machawira</dc:creator>
      <pubDate>Mon, 23 Nov 2026 09:28:39 +0000</pubDate>
      <link>https://dev.to/briteatom/deciding-the-irreversible-first-four-database-choices-i-made-before-writing-any-features-3c0j</link>
      <guid>https://dev.to/briteatom/deciding-the-irreversible-first-four-database-choices-i-made-before-writing-any-features-3c0j</guid>
      <description>&lt;p&gt;Most engineering decisions can be revisited. A small number cannot, because data accumulates on top of them. When I began building Erudyt, a multi-tenant school management and analytics platform on FastAPI and PostgreSQL, I listed the decisions I would not be able to change cheaply and made them first.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;UUID primary keys&lt;br&gt;
Sequential integers are guessable, which weakens any endpoint that exposes an id, and they collide when records from separate tenants are merged. UUIDs cost more storage and larger indexes, which I accepted. Changing key type later means rewriting every foreign key that references it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Soft deletes&lt;br&gt;
A student's results are a historical record. Soft deletion preserves that history, but it has costs: every query needs a filter, unique constraints must account for deleted rows, and data protection obligations mean you still need a deliberate, audited purge path. I designed that path rather than leaving it for later.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tenant isolation at the database&lt;br&gt;
Application code will eventually contain a mistake, and in a multi-tenant system a mistake can expose one school's records to another. PostgreSQL row-level security enforces isolation at the data layer. The caveat is that a policy no one tests is only an intention, so isolation tests belong in the suite from the beginning.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Owning authentication&lt;br&gt;
I implemented JWT authentication in FastAPI to avoid vendor lock-in. This trades convenience for responsibility: hashing, token lifetime, rotation and revocation become my problem permanently. It suits a team prepared to carry that, and not one hoping to avoid it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why it matters beyond engineering&lt;br&gt;
Zimbabwe's Cabinet approved a National AI Charter this week, built on transparency, inclusion and human-centred principles. Governance is arriving alongside adoption, and systems that hold children's records will increasingly be asked to explain how they work. Early structural decisions make that explanation straightforward.&lt;/p&gt;

&lt;p&gt;The rule&lt;br&gt;
Before the first table exists, list what you could not change in two years, and spend your slowest effort there. Move quickly on everything else.&lt;/p&gt;

</description>
      <category>postgressql</category>
      <category>systemdesign</category>
      <category>python</category>
      <category>security</category>
    </item>
  </channel>
</rss>
