Comments (9)
If I understand correctly, db.Put(k, v) again will give you the effect you want.
from rosedb.
yes, it can achieve the desired outcome, but to clear the expiration time, you would need to execute the Put command, which involves overwriting the data. This can lead to increased network transfer overhead, especially when dealing with a large amount of data.
from rosedb.
If this function is to be implemented, it will be designed as follows:
func demo(k) {
v, _ := db.Get(key)
db.Put(k, v)
}
Whether the built-in implementation or the external call has similar overhead to the db.
@taroim @roseduan I can do this if necessary
from rosedb.
yes, it can achieve the desired outcome, but to clear the expiration time, you would need to execute the Put command, which involves overwriting the data. This can lead to increased network transfer overhead, especially when dealing with a large amount of data.
How large is your data?
A common way to do this is as @Jeremy-Run said, to Get
the data first, and rewrite it by Put()
.
But if this does not meet your needs, I can rethink another approach.
from rosedb.
My current use case involves storing meteorological data. Typically, each KEY holds data packets of around 500KB in size, and the number of KEYs processed in a single business operation is around 3000. Therefore, I am particularly concerned about duplicate data writes
from rosedb.
My current use case involves storing meteorological data. Typically, each KEY holds data packets of around 500KB in size, and the number of KEYs processed in a single business operation is around 3000. Therefore, I am particularly concerned about duplicate data writes.
I have checked the WAL logic, it is a little hard to do the in-place update.
So I think the only solution is to rewrite the data to clear its expire time.
I can add a Persist
function to you if you want. @taroim
from rosedb.
It is needed in my current application scenario. I hope you can add it, Thanks!
from rosedb.
It is needed in my current application scenario. I hope you can add it, Thanks!
Added in latest release, enjoy!
from rosedb.
It is needed in my current application scenario. I hope you can add it, Thanks!
如果你在使用 RoseDB,可以在这个 issue #226 上贴一下你的使用场景,也可以提出任何建议和期待功能,非常感谢! @taroim
from rosedb.
Related Issues (20)
- Suggestion: Add a separate method for setting expiration time. HOT 2
- Iterating over all KVs by their insertion order HOT 13
- NEW: Periodically remove expired keys from memory HOT 6
- V2.3.2 Release Plan
- add example code(in examples folder) for TTL (good first issue)
- add example code(in examples folder) for iterating (good first issue)
- Question: Hint file usage HOT 3
- panic: send on closed channel HOT 1
- Expired Keys Found in AscendKeys/DescendKeys HOT 4
- Optimize memory usage
- Proposal: keep key and value into memory HOT 3
- Proposal: allow key and value to store per bucket HOT 1
- Proposal: raft protocol support HOT 2
- Possible project use HOT 1
- about replicator HOT 1
- 有个问题,如果key过期了,不执行merge就永远不会删除文件是吗 HOT 9
- is hash ops still supported? HOT 1
- rose.Get panil HOT 10
- Bug: Is it a bug in *Batch.Put? HOT 2
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 rosedb.