← Back to list

The Hidden Cost of Global State: Why Everything Doesn’t Belong in Your Store

One Store To Rule Them All

Dipak Ahirav in Angular Engineering · 2026-07-02 16:01 · 81 claps · 3.0 min read paywalled
#angular #architecture #software-engineering #software-architecture #frontend-architecture
Open on Medium ↗
Wiki topics: 🌐 · Web Development 🏛️ · Architecture

The Hidden Cost of Global State: Why Everything Doesn’t Belong in Your Store

One Store To Rule Them All

When teams first adopt state management, something interesting happens.

The store becomes the answer to every problem.

Need a loading flag?

Put it in the store.

Need a selected customer?

Store.

Search text?

Store.

Dialog visibility?

Store.

Current tab?

Store.

Notification?

Store.

Soon the store knows everything about the application.

It feels centralized.

It also becomes incredibly difficult to evolve.

**Not a Member? Read for FREE here.**

Global Doesn’t Mean Important

One of the biggest architectural mistakes is confusing:

Important data

with

Global data.

These are not the same thing.

A customer profile may be critical to the business.

That doesn’t automatically mean every feature should own or observe it.

Importance does not determine scope.

Ownership does.

Local State Is Often Better

Imagine a search box inside the Customer page.

Only that page needs:

  • Search text
  • Current filter
  • Selected row
  • Expanded panel
  • Sort order

Why should the entire application know these values?

It shouldn’t.

Keeping state local reduces complexity.

Every Global State Has A Cost

Global state seems convenient.

Until dozens of features start reading it.

Then updating it.

Then depending on it.

Now a small change requires understanding multiple teams, workflows, and screens.

The architecture becomes tightly coupled — not because of Angular, but because of shared ownership.

Ask One Simple Question

Before adding something to the global store, ask:

Who needs this state?

If the answer is:

“This page.”

Keep it local.

If the answer is:

“This feature.”

Keep it inside the feature.

Only when multiple independent features truly depend on the same state should you consider making it global.

A Layered View Of State

Think of Angular state in layers.

Component State

Lives inside one component.

Examples:

  • Dialog open/close
  • Active tab
  • Form progress
  • Hover state

Feature State

Shared within one business capability.

Examples:

  • Selected customer
  • Customer list
  • Customer filters
  • Customer permissions

Owned by the Customer feature.

Application State

Shared across independent features.

Examples:

  • Logged-in user
  • Current organization
  • Theme
  • Language
  • Authentication status

Only a small percentage of application state belongs here.

Bigger Store ≠ Better Architecture

Some projects proudly say:

“Everything is in NgRx.”

Or:

“Everything is in Signal Store.”

That isn’t necessarily a success.

A huge store often means unclear ownership.

Good architecture isn’t measured by how much state is centralized.

It’s measured by how well responsibilities are separated.

Signals Don’t Change This Principle

Signals make state updates simpler.

Signal Store makes state organization cleaner.

But neither changes the fundamental question.

Who owns this data?

Architecture still comes before tooling.

The Cost Of Unnecessary Global State

Over time you begin to notice symptoms.

  • Components listening to unrelated state
  • Features reacting to changes they don’t own
  • Difficult debugging
  • Unexpected side effects
  • Fear of modifying state

These are ownership problems disguised as state problems.

Think Like A City

Not every road needs to be a national highway.

Most roads are local.

Some connect neighborhoods.

Only a few connect the entire country.

State should follow the same principle.

Keep it as local as possible.

Promote it only when necessary.

A Practical Rule

Whenever you create new state, ask yourself:

Can this stay local for now?

If the answer is yes…

Leave it there.

Promoting state is easy later.

Pulling unnecessary global state back into features is much harder.

Final Thoughts

Global state is one of Angular’s most valuable tools.

It’s also one of the easiest to overuse.

The strongest Angular architectures don’t centralize everything.

They centralize only what truly belongs at the application level.

Everything else stays close to the feature that owns it.

Because software scales best when responsibility stays local.

Not when every piece of information becomes everyone’s concern.

[embed]State Ownership: The Most Important Angular Architecture Decision Nobody Talks About Most State Problems Aren’t Really State Problemsmedium.com

Connect with Me

If you enjoyed this post and would like to stay updated with more content like this, feel free to connect with me on social media:

Email: Email me on dipaksahirav@gmail.com for any questions, collaborations, or just to say hi!

I appreciate your support and look forward to connecting with you!


메타데이터
post_id
92a627b91c39
slug
the-hidden-cost-of-global-state-why-everything-doesnt-belong-in-your-store-92a627b91c39
url
https://medium.com/angular-engineering/the-hidden-cost-of-global-state-why-everything-doesnt-belong-in-your-store-92a627b91c39
canonical_url
https://medium.com/angular-engineering/the-hidden-cost-of-global-state-why-everything-doesnt-belong-in-your-store-92a627b91c39
author_url
https://medium.com/@dipaksahirav
status
ok
fetched_at
2026-07-09 05:26:43