Comments (2)
Currently ftruncate
is unscalable because it reads in all the file blocks before deleting.
With our transactional iteration, we should be able to identify the block index we need to truncate to, and then do a more precise deletion of the blocks above, and the overwrite of that specific block that needs to be done. Will address this after all bugs are solved.
from js-encryptedfs.
I want to note that our write buffer is placed in the DB (disk) itself and is therefore unbounded by memory. However our write operations are buffered in-memory and not in the DB. You might wonder why not push all write operations also into the DB transaction data path? Well because at the end you still end up reading them all in-memory to perform the write batch, so there's no advantage with putting the operations onto disk. Therefore no matter what our transaction sizes are still bounded by memory.
Basically remember that our DB will always have transactions bounded by memory. So if there's an atomic operation that is larger than main memory, it will cause a problem.
Any solution has to avoid buffering too many operations into memory. Which is why I'm mentioning GC in this issue. If you get GC involved, you can "stream" mutate the DB, and thus side-effects occurs lazily (or in batches).
The best solution is that the underlying DB eventually has a disk-based write batch. But even in rocksdb, write batches are limited by main memory: facebook/rocksdb#5938.
So yea, eventually the design has to be capable of doing things lazily or in small batches while preserving consistency.
from js-encryptedfs.
Related Issues (20)
- Generated docs should be viewable directly from Github HOT 1
- NPM releases should create tags in the repo HOT 5
- Update jest test configuration HOT 1
- readdirSync doesn't return anything that isn't loaded in memory HOT 1
- unlinkSync does not unlink lower directory HOT 2
- Adapt EFS to the File System Interface
- lstat/lstatSync should propagate lowerDir
- @ imports don't work with webworkers HOT 2
- Update this to use node-forge HOT 1
- Refactoring EFS & Align coding standards with js-polykey HOT 5
- Implement True Snapshot Isolation for LevelDB HOT 6
- Benchmark & Load Test EncryptedFS HOT 1
- Fix Permission Hierarchy - User, Group, Other permission checking
- Structured Change Detection for Mutation Events and Schema Compliance HOT 3
- Add in `rm` method
- `EncryptedFS.rmdir` does not remove files on Windows HOT 26
- Streams don't seem to emit the close event HOT 2
- Streams are old and legacy and should be refactored to v16 LTS HOT 2
- Benchmark the EFS HOT 1
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 js-encryptedfs.