Urgent.News

What's breaking now, across thousands of outlets.

Tech

When Does an Entity Stop Being a Data Model?

Most backend applications start simple. You have a few tables, a few endpoints, some business logic, and an ORM or repository layer that keeps persistence manageable. Then the application grows. A Customer is no longer just: id name email Now it also needs: an owner authorization rules validation lifecycle states optimistic concurrency events transactional outbox audit information increasingly…

The article discusses the concept of "entity gravity" in backend applications as they grow in complexity. Initially, entities like a Customer might be simple, but as the application expands, the entity's infrastructure becomes distributed across various components such as controllers, services, repositories, database constraints, and event handlers.

This distribution can lead to challenges when changes to one entity-level rule require coordination with multiple parts of the application. The author proposes a solution by introducing an explicit architectural boundary for the entity, which would handle common mechanics and guarantees. This boundary would allow the application to focus on business decisions while the entity infrastructure manages common mechanics like optimistic concurrency, transactions, and event handling.

The author provides an example of how updates to an entity could be handled with an explicit actor and expected version, ensuring that the transaction records the intent to publish the event, keeping the entity mutation and event recording transactionally consistent.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Calculus Is Fun When You Can Make a Robot Move: Understanding Differential Kinematics

let's start with two fundamental ways of describing a robot: Joint space Task space Joint Space When a robot's current configuration is represented in terms of its joint positions , we call it joint…

  • Calculus applied to robotics makes it engaging
  • Forward kinematics determines end effector's position
  • Differential kinematics links joint angles to end effector motion

I Built a CBT Thought Journal in 50 Lines of Python 🧠

Last week I caught myself thinking: "I always mess everything up." My therapist would recognize this as overgeneralization — a cognitive distortion where one mistake becomes "everything." But I didn't…

  • Author created CBT Thought Analyzer API to flag cognitive distortions
  • 50 lines of Python code implement journal with automatic analysis
  • Output provides timestamp, thought, and detected distortions/patterns

Boring Tools, Better Work

Every developer I know has a strange relationship with their tools. We customize, we tinker, we migrate. And then one day we realize the tool we abandoned years ago still does the job better than the…

More from Saturday 19 September →