Need advice about which tool to choose?Ask the StackShare community!

Redux

29.7K
22.1K
+ 1
663

Redux vs Relay: What are the differences?

What is Redux? Predictable state container for JavaScript apps. Redux helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as live code editing combined with a time traveling debugger.

What is Relay? A JavaScript Framework for Building Data-Driven React Applications, by Facebook. Never again communicate with your data store using an imperative API. Simply declare your data requirements using GraphQL and let Relay figure out how and when to fetch your data.

Redux and Relay are primarily classified as "State Management Library" and "Javascript UI Libraries" tools respectively.

Some of the features offered by Redux are:

  • Predictable state
  • Easy testing
  • Works with other view layers besides React

On the other hand, Relay provides the following key features:

  • Build data driven apps
  • Declarative style
  • Mutate data on the client and server

Redux and Relay are both open source tools. It seems that Redux with 49.2K GitHub stars and 12.7K forks on GitHub has more adoption than Relay with 13K GitHub stars and 1.28K GitHub forks.

According to the StackShare community, Redux has a broader approval, being mentioned in 1021 company stacks & 803 developers stacks; compared to Relay, which is listed in 39 company stacks and 7 developer stacks.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Redux
  • 191
    State is predictable
  • 149
    Plays well with React and others
  • 125
    State stored in a single object tree
  • 78
    Hot reloading out of the box
  • 73
    Allows for time travel
  • 14
    You can log everything
  • 11
    Great tutorial direct from the creator
  • 6
    Endorsed by the creator of Flux
  • 6
    Test without browser
  • 5
    Easy to debug
  • 2
    Enforces one-way data flow
  • 2
    Granular updates
  • 1
    Blabla
Cons of Redux
  • 12
    Lots of boilerplate
  • 6
    Verbose
  • 5
    Design
  • 4
    Steeper learning curve than RxJs
  • 4
    Steeper learning curve than MobX
  • 4
    Steep learning curve

What is Redux?

It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. t provides a great experience, such as live code editing combined with a time traveling debugger.

Need advice about which tool to choose?Ask the StackShare community!

Jobs that mention and Redux as a desired skillset
What companies use Redux?
See which teams inside your own company are using Redux or undefined.
Sign up for StackShare EnterpriseLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Redux?

Blog Posts

JavaScriptGitHubReact+12
5
4058
Oct 11 2019 at 2:36PM

LogRocket

JavaScriptReactAngularJS+8
5
1912
JavaScriptGitHubNode.js+29
14
13235
GitHubPythonReact+42
49
40500
GitHubPythonNode.js+47
54
71924
What are some alternatives to and Redux?
Cycle.js
A functional and reactive JavaScript framework for predictable code
MobX
MobX is a battle tested library that makes state management simple and scalable by transparently applying functional reactive programming (TFRP). React and MobX together are a powerful combination. React renders the application state by providing mechanisms to translate it into a tree of renderable components. MobX provides the mechanism to store and update the application state that React then uses.
Flux
Flux is the application architecture that Facebook uses for building client-side web applications. It complements React's composable view components by utilizing a unidirectional data flow. It's more of a pattern rather than a formal framework, and you can start using Flux immediately without a lot of new code.
React
Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
RxJS
RxJS is a library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code. This project is a rewrite of Reactive-Extensions/RxJS with better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.
See all alternatives