Comments (1)
We've been working on this issue for a while now and tried to implement the suggested setup. This failed quite early because workers can request the same module multiple times from multiple segments. In the current setup, there wasn't a way to figure out the requesting segment. So we had to go back to the drawing board.
To overcome this problem we refactored the requesting strategy to track where the request was coming from. For this we added a caller parameter.
GET http://repository/modules/file.js?caller=otherfile.js
With this addition information, the repository can check if both files share a segment. If they do the real implementation gets provided, otherwise the remote implementation. This strategy works very well, but introduces a change that has set us to think.
The ESM system caches modules based on their origin. Meaning that in the current setup modules are cached per client (id). No matter the segment, the same module is provided for any request. In the new setup this has changed to caching per
module/caller pair. Effectively this leads more overhead in the memory used. But this isn't something we're worried about yet. We've got another fish to fry first.
Every uniquely loaded module has it's own isolated scope. In this scope state can be kept. Since building distributed systems require stateless components, this new setup forces to keep everything stateless. Great right? For most case, absolutely. But as always, there are exceptions. For example, you might want to share a database connection (pool) with all components running on a worker. The new setup doesn't allow this, so we have to go back to the drawing board again...
from jitar.
Related Issues (20)
- Update socks dependency
- Release 0.7.2
- Visual studio code plugin
- Add request size limit configuration option HOT 3
- Update website headline
- Release version 0.7.3
- Update social information website
- 'undefined' becomes 'null' after deserialization HOT 1
- Squash sonar issue
- Separate server implementation from node
- Update express to fix security vulnerability
- Update dependencies
- Improve dependency strategy for @jitar packages
- Update templates for creator
- Release jitar 0.7.4
- Do not compile the webui folder in full-stack example
- Add support for event driven design
- Address sonar issues
- Release 0.7.5
- Update sonar configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jitar.