FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Your Domain Doesn't Know About PostgreSQL (And It Shouldn't)
How-ToWeb Development

Your Domain Doesn't Know About PostgreSQL (And It Shouldn't)

via Dev.to WebdevPablo Ifrán4h ago

Your business logic shouldn't care whether you're using PostgreSQL, MySQL, or a folder full of text files. If it does that's not a minor code smell. That's an architectural problem. Let me show you what it looks like in a real codebase. A Simple Example That's Not Actually Simple Say you're building an order management system. An order has items, a total, and a status. When an order is placed, you validate it, apply a discount if the customer qualifies, and save it. Here's what that service looks like in most codebases: from sqlalchemy.orm import Session from app.models import Order , Customer from app.db import get_db from fastapi import HTTPException import os class OrderService : def place_order ( self , customer_id : int , items : list , db : Session ): customer = db . query ( Customer ). filter ( Customer . id == customer_id ). first () if not customer : raise HTTPException ( status_code = 404 , detail = " Customer not found " ) total = sum ( item [ " price " ] * item [ " qty " ]

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles

IntentCAD v0.8.0 — Thirteen EPICs, One Day
How-To

IntentCAD v0.8.0 — Thirteen EPICs, One Day

Dev.to • 7h ago

A Growing Position Doesn't Always Mean Fresh Buying — Here's How to Tell
How-To

A Growing Position Doesn't Always Mean Fresh Buying — Here's How to Tell

Dev.to Beginners • 8h ago

Tutorials Are Lying to You Here’s What Actually Works ?
How-To

Tutorials Are Lying to You Here’s What Actually Works ?

Medium Programming • 11h ago

Flutter Mistakes That Make Apps Slow ⚡
How-To

Flutter Mistakes That Make Apps Slow ⚡

Medium Programming • 12h ago

Welcome Thread - v370
How-To

Welcome Thread - v370

Dev.to • 12h ago

Discover More Articles