Giter Site home page Giter Site logo

Comments (9)

Jeremy-Run avatar Jeremy-Run commented on June 6, 2024

If I understand correctly, db.Put(k, v) again will give you the effect you want.

from rosedb.

taroim avatar taroim commented on June 6, 2024

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.

Jeremy-Run avatar Jeremy-Run commented on June 6, 2024

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.

roseduan avatar roseduan commented on June 6, 2024

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.

taroim avatar taroim commented on June 6, 2024

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.

roseduan avatar roseduan commented on June 6, 2024

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.

taroim avatar taroim commented on June 6, 2024

It is needed in my current application scenario. I hope you can add it, Thanks!

from rosedb.

roseduan avatar roseduan commented on June 6, 2024

It is needed in my current application scenario. I hope you can add it, Thanks!

Added in latest release, enjoy!

from rosedb.

roseduan avatar roseduan commented on June 6, 2024

It is needed in my current application scenario. I hope you can add it, Thanks!

如果你在使用 RoseDB,可以在这个 issue #226 上贴一下你的使用场景,也可以提出任何建议和期待功能,非常感谢! @taroim

from rosedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.