Coder Social home page Coder Social logo

Comments (5)

agoalofalife avatar agoalofalife commented on June 2, 2024

@frednomoon to record information on the disk is used mmap
therefore entry does not occur instantly,
perhaps this is the reason

quote

At the moment tiedot does not use a journal file, therefore it relies on operating system to periodically synchronize mapped file buffer with underlying storage device; this means, that in case of a system crash, you may lose several most recent document updates.

but maybe I'm wrong

from tiedot.

frednomoon avatar frednomoon commented on June 2, 2024

@agoalofalife thanks for the quick response Ilya!

I'll expand on my explanation to say why I don't think that is the problem... In the situation I describe, service A adds a new Document which it is almost immediately able to read/ update etc. Despite service A being able to see the new document it has added, service B cannot see it. This situation persists until I restart service B (I have seen this happen for >5 minutes).

Also to be more specific in what I mean by "restart". I mean that the tiedot function openDB needs to be called, which I usually would do once upon starting the application.

I have solved the problem for now in my application by simply calling openDB again when I need service B to check for new information. But I am still interested to find out what is happening in the background!

from tiedot.

HouzuoGuo avatar HouzuoGuo commented on June 2, 2024

Hello @frednomoon.
I am sorry to say that this use case is not well supported. OpenDB function is very expensive to call, it may take up to several seconds to finish for a large collection, and there cannot be two DB instances operating under the same data directory.

For your use case, please consider running an HTTP service on the server A and let server B use HTTP client to query for the new document.

from tiedot.

agoalofalife avatar agoalofalife commented on June 2, 2024

I have not read the original code
I can try to guess again
maybe something is stored in memory, because the main use of using REST API
I think the addresses of the documents are stored in the buffer
you can write a function to fill or update the buffer
more details probably will answer @HouzuoGuo
In any case, good luck!

from tiedot.

frednomoon avatar frednomoon commented on June 2, 2024

Thanks for the responses!

from tiedot.

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.