3 ms·
They are global variables. Worth working very hard to block in any project. Separate microservices are the most effective way I saw so far to stop people in a
by foobarian 3y ago
They are global variables. Worth working very hard to block in any project. Separate microservices are the most effective way I saw so far to stop people in a large org from making shortcuts via global contexts. I feel bad for our frontend devs dealing with a tide of global constructs in our React codebase.
- recursive 3y agoI still haven't seen a non-handwavy method for orchestrating a transaction across microservices. That means I still can't use them. Although I don't think I ever wanted to particularly.
- duped 3y agoYou wouldn't ever design a microservice architecture that required transactions across them. Every microservice owns its own data.
- recursive 3y agoMaybe it's just the domain, but I guess it means the scope of my microservice is just the whole damn thing anyway. I guess I was doing microservices the whole time.
- toast0 3y agoThat seems domain specific. I can imagine some services where transactions across everything are unavoidable, but I've also worked on lots of things where there's different databases and transactions aren't needed between them. Some times it is a relaxation of requirements though. Some people might want/need account deletion to also remove all the content related to the account transactionally, etc, and if that's a requirement, everything account related must be in a transactionable system. If you can be more flexible on that, separating account management from other data is pretty common in my experience.
- dclowd9901 3y agoGlobal objects in react are almost universally an anti pattern. The only way to do them right is through a context, ensuring the state lives in the context. But most people hate writing the scaffolding, so a non reactive, non FP singleton gets to work and fails at integrating correctly with the react ecosphere.
- Joker_vD 3y agoWell, the file system, too, is a global variable. Concurrent reading/writing of a single file has about the same racy behaviour as concurrent reading/writing of a global variable.
- Dylan16807 3y agoYou still need to store variables somewhere. The equivalent of "separate microservices" is making sure multiple programs don't share registry keys, and that's already the case 99% of the time for this kind of key.