Comments (13)
the js-ipfs site has an enable service worker function, so they are definitely pushing it.
But apart from that, making IPFS and OrbitDB run on a Web Worker will be extremely helpful for performance. OrbitDB is the blocker on this, and just by moving from localStorage to IndexedDB on the keychain should be enough to support this. Service Worker is just one kind of Worker
from field-manual.
OrbitDB in a separate thread in a web worker is very compelling. You;d have to use messages heavily for computation but its certainly possible!
from field-manual.
I'm currently working with AssemblyScript to use WebAssembly and atomic memories to have faster web worker communication.
I'lve also been working on OrbitFS, which uses a mutable filesystem from IPFS and then commits root hashes to orbitdb. So in that system you'd only need to use orbitdb with bigger updates.
from field-manual.
+1 to this. Apart from service worker, it's great to run IPFS in workers, and it'd be great to run OrbitDB in a worker as well
from field-manual.
For now, Service Workers are not like this.
They always stop and start, you can't rely on them for doing long tasks.
I recommend you to read the following (about ServiceWorkers lifecycle)
https://developers.google.com/web/fundamentals/primers/service-workers/
I already tried putting an IPFS node on a service worker, it was very difficult and the result was a slowwwwww IPFS node always restarting, and rarely available to respond to requests or listen for PubSub messages.
Because they're not made for such kind of tasks.
You should rather open a popup window that runs an IPFS/OrbitDB node and tell the user to keep it open.
from field-manual.
Yup! And there are many use cases for batching DB calls
from field-manual.
@willemneal do you want to show this at the next community call on March 5?
from field-manual.
@aphelionz I would like to, but it's not quite ready for demoing. But perhaps the next one. When is it?
from field-manual.
They're every two weeks on Tuesday morning EST. Info is posted as issues in this repo. For example: orbitdb-archive/welcome#51
from field-manual.
Okay thanks! I'll aim for the next one!
from field-manual.
Hey, I'm using orbitDB inside an iframe with some strict sandbox security requirements aragon/client#702
If we ran orbit in a service worker, do people think this would solve the above issue as well? If not, do people see any alternatives to getting orbit to work in an iframe besides loosening sandbox restrictions? Thanks for any help!
from field-manual.
I'm running orbitDB in an iframe, but the storage is taken care of from the domain itself, not from the page that loads the iframe, so it stores it in the specific indexeddb instance for that domain.
Do you want all your aragon apps which are in different iframe to access the indexeddb storage of the domain that loads those iframes? Maybe you can set up some kind of post message communication for that, but using workers won't be an option as they're domain specific as well I believe
from field-manual.
Moving to the Field Manual so we can document Web Worker usage
from field-manual.
Related Issues (20)
- How does OrbitDB update the heads (tails?) (oplog?) on immutable IPFS HOT 3
- Error: No resolver found for codec "undefined" HOT 3
- Update Code Snippets to latest js-IPFS HOT 1
- Publishing Options
- Chapter on customizing OrbitDB HOT 2
- Ipfs.node.dag.get fails in Chapter 2 of the tutorial HOT 9
- TypeError: Cannot read property 'length' of undefined HOT 2
- 01_Basics.md: why do you use window.something for a nodeJS code? HOT 3
- [01_Tutorial/02_Managing_Data.md]: using await in node REPL HOT 2
- In `04_P2P_Part_1`, `NPP.connectToPeer` got `Error: Circuit relay dial failed as addresses did not have peer id` HOT 6
- field-manual/1-Basics outdated? HOT 6
- In 01_Tutorial I have some confusion
- Code example in 02 Managing Data errors
- IPFS Codecs issue HOT 1
- Outdated Tutorial [Chapter 1 & 2]
- Replication when 2 orbitdb apps connected to a single node IPFS does not work HOT 2
- Scaling database is not clear from the manual
- Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in package.json HOT 2
- Database is not replicating in browser, Error(PublishError.InsufficientPeers)
- SQL standards
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 field-manual.