In most applications, data is passive. It sits quietly in a database, waiting for your application code to read it, manipulate it, and decide what to do next. This traditional model works, but it often leads to business logic being scattered across monolithic codebases or tangled in a web of microservices. What if your data could be more active? What if a change to an entity could, by itself, trigger a cascade of well-defined business processes?
This is the core principle behind Entities as Code at Nouns.do. We believe your data model shouldn't just represent your business; it should actively participate in it. By attaching business logic directly to entity events, you can transform your static data into an intelligent, automated system that drives your operations.
Think about a common workflow: a new customer signs up. What needs to happen?
In a conventional setup, this logic lives inside your application's on_signup function. Now, what happens when a customer's status is upgraded to "Enterprise"? A different set of actions is required. This logic might live in a completely different part of the codebase, or even in a separate service.
This scattered approach creates several problems:
Nouns.do treats your business nouns—your Customers, Products, Orders, and Projects—as first-class citizens. Our universal entity management API doesn't just store their properties; it also fires events throughout their lifecycle.
You can listen for these key events:
By attaching logic to these events—typically via webhooks that trigger serverless functions or other API endpoints—you can build a powerful, decoupled, and event-driven architecture. It's like adding an addEventListener to your business itself.
Let's look at how this works in practice.
Instead of hardcoding the onboarding logic into your app, your application's only job is to create the entity.
1. Create the Entity: Your code makes a single API call to Nouns.do.
POST /v1/entities
{
"type": "Customer",
"properties": {
"name": "Jane Doe",
"email": "jane.doe@example.com",
"status": "active",
"segment": "trial"
}
}
2. Trigger the Event: Nouns.do creates the entity and fires an entity.created event.
3. Execute the Logic: Your pre-configured webhooks, listening for this specific event, spring into action:
The result? Your primary application is completely decoupled from your onboarding process. You can change your email provider or CRM without ever touching your core application code.
Now, let's say Jane's company becomes a major client. You update her entity to reflect this.
1. Update the Entity:
PATCH /v1/entities/cus_1a2b3c4d5e6f7g8h
{
"properties": {
"segment": "enterprise"
}
}
2. Trigger the Event: Nouns.do updates the entity and fires an entity.updated event. The event payload includes both the old and new state, so your logic knows exactly what changed.
3. Execute Intelligent Logic: A more sophisticated webhook, configured to watch for segment changes on Customer entities, executes:
This is the power of business-as-code. Complex business rules are no longer buried in application logic; they are clear, automated reactions to changes in your core business data.
Adopting an event-driven model around a central entity management system like Nouns.do provides transformative benefits.
Your data holds the story of your business. It's time to let it speak. Stop writing code that just queries data and start building systems where your data actively drives the business forward.
Ready to model your business world and make your data intelligent?
Explore the Nouns.do API and see how you can unify your people, places, things, and ideas as code. Sign up at Nouns.do and start building a more connected, automated business today.