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

Apollo

2.4K
1.8K
+ 1
25
MobX

730
512
+ 1
114
Add tool

Apollo vs MobX: What are the differences?

Introduction

In the world of web development, there are several state management solutions available, two of which are Apollo and MobX. These tools are widely used to handle application state and provide easy ways to manage and manipulate data. Although they serve a similar purpose, there are key differences between Apollo and MobX that make them unique in their own ways.

  1. Integration with GraphQL: Apollo is a state management solution that is specifically designed to work seamlessly with GraphQL, a query language for APIs. It provides built-in support for GraphQL queries, mutations, and subscriptions, making it easier for developers to consume and manage data from a GraphQL server. On the other hand, MobX is a general-purpose state management library that can be used with any data source, including REST APIs and local data.

  2. Reactive vs Observable: Apollo uses a reactive programming model, where changes in data trigger automatic updates in the user interface. It leverages GraphQL's built-in behavior of tracking and updating changes efficiently, resulting in a smoother user experience. MobX, on the other hand, uses an observable pattern to track changes in state. Developers need to explicitly mark observables and define reactions to update the UI when changes occur.

  3. Normalized Caching: Apollo comes with a powerful caching mechanism that allows developers to normalize and store the fetched data in a normalized form. This means that multiple queries can share the same data, reducing redundant network requests and improving performance. MobX, on the other hand, does not provide a built-in caching mechanism and relies on developers to implement caching strategies manually.

  4. Community and Ecosystem: Both Apollo and MobX have active developer communities and are widely adopted in the industry. However, Apollo has a larger ecosystem and community support due to its close integration with GraphQL. It has a rich set of tools, libraries, and resources available for developers to leverage. MobX, while still popular, may have relatively fewer resources and integrations compared to Apollo.

  5. Learning Curve: Apollo introduces additional GraphQL concepts such as schemas, resolvers, and queries, which may require developers to learn new concepts and patterns. This learning curve can be steeper compared to MobX, which follows a more traditional and familiar approach to state management. Developers familiar with React and JavaScript may find it easier to adapt to MobX.

  6. Server-side Rendering (SSR) Support: Apollo has built-in support for server-side rendering (SSR) out of the box. It provides APIs and tools to fetch data on the server and pass it to the client for rendering. MobX, on the other hand, does not have built-in SSR support and may require additional configuration and setup to enable server-side rendering.

In summary, Apollo and MobX have key differences that set them apart. Apollo excels in its tight integration with GraphQL, normalized caching, and server-side rendering support, while MobX offers a simpler learning curve, broader compatibility with different data sources, and a more familiar approach to state management. The choice between Apollo and MobX ultimately depends on the specific needs and requirements of the project.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Apollo
Pros of MobX
  • 12
    From the creators of Meteor
  • 8
    Great documentation
  • 3
    Open source
  • 2
    Real time if use subscription
  • 26
    It's just stupidly simple, yet so magical
  • 18
    Easier and cleaner than Redux
  • 15
    Fast
  • 13
    Automagic updates
  • 13
    React integration
  • 10
    Computed properties
  • 8
    ES6 observers and obversables
  • 7
    Global stores
  • 3
    Flexible architecture the requeriment
  • 1
    Has own router package (mobx-router)

Sign up to add or upvote prosMake informed product decisions

Cons of Apollo
Cons of MobX
  • 1
    File upload is not supported
  • 1
    Increase in complexity of implementing (subscription)
  • 1
    Maturity

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -

What is Apollo?

Build a universal GraphQL API on top of your existing REST APIs, so you can ship new application features fast without waiting on backend changes.

What is 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.

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

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

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

What tools integrate with Apollo?
What tools integrate with MobX?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

What are some alternatives to Apollo and MobX?
Helios
Helios is a Docker orchestration platform for deploying and managing containers across an entire fleet of servers. Helios provides a HTTP API as well as a command-line client to interact with servers running your containers.
GraphQL
GraphQL is a data query language and runtime designed and used at Facebook to request and deliver data to mobile and web apps since 2012.
Python
Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
Relay Framework
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.
Heroku
Heroku is a cloud application platform – a new way of building and deploying web apps. Heroku lets app developers spend 100% of their time on their application code, not managing servers, deployment, ongoing operations, or scaling.
See all alternatives