DEV Community

Discussion on: Why I Stopped Using Redux

Collapse
 
dandv profile image
Dan Dascalescu

One important thing to remember is that our frontend and backend state are never really in sync, at best we can create a mirage that they are.

Amazing how absolutely everyone who commented on this post, took the sentence above for granted.

It's just not so, if you use the right tool for the job.

If you need your frontend to be in sync with backend data, and don't want to deal with stale data, cache invalidation and all that, then use a full-stack framework like Meteor.js, that has solved this problem for good.

No, Meteor is not dead.

Yes, Meteor does scale. It scaled remarkably well even 4 years ago.

Yes, Meteor does work with MySQL.

Yes, Meteor supports PWAs.

No, Meteor is not "trendy". It's a reliable workhorse that lets you actually focus on the code that makes your app different, and not rewrite the same boilerplate (including a user accounts system taking weeks to properly write, which Meteor solves with literally one line of code).

Collapse
 
g_abud profile image
Gabriel Abud

How is that statement not true? It's how the web works, even if you have "real time apps" using websockets, by the time the data reaches you it could already be stale technically. So even if you have perfect caching you will still have this problem. As far as I know there isn't a 100% perfect solution to this, although good caching comes close.

Collapse
 
dandv profile image
Dan Dascalescu

Sure, that's technically true, but for the vast majority of practical intents and purposes, Meteor solves that sync problem and you don't have to write any code. There's certainly value in not reinventing a wheel that's very hard to get round, and a wide perspective of the problem would include full-stack frameworks even if they only offer a 99% solution to this.

Meteor offers more than just caching, including optimistic updates and real-time sync between all connected clients.

Thread Thread
 
g_abud profile image
Gabriel Abud

I personally haven't used Meteor but if it handles caching well, then I think I'd be in favor of using it.

I realize the title of this article kind of entices a technology flame war but that's not what my point is. It's that managing backend state yourself on the frontend, in the majority of cases, is probably not the best approach. Any technology that handles frontend caching/fetching/invalidation/mutations well is a good way forward.

Thread Thread
 
dandv profile image
Dan Dascalescu

Any technology that handles frontend caching/fetching/invalidation/mutations well is a good way forward.

Well put. One of those technologies is React Query, another is Apollo Client, and I bet that if you had read about Meteor, you would've included it too.