0

has anyone used mapdb as a state store in spring boot for a request lifecycle ? I mean set things like "isDebug", etc in mapdb for the particular request and then clear it out at the end of the request ?

mapdb sounds very much like how Redux, etc is used in React, so im trying to leverage similar patterns.

if you have done so, how do you manage the flushing of data at the end of a request, etc ?

Sandeep
  • 1,745
  • 3
  • 20
  • 30
  • 1
    What is wrong with just storing request attributes? Why bolt something on top of that? – M. Deinum Sep 27 '22 at 12:12
  • What do you mean by "flushing"? What do you want to achieve by using mapdb? You can simply store request scoped values in the ... well ... request scope. Why is this tagged with `spring-data-jpa`? I'm confused. – Jens Schauder Sep 27 '22 at 12:28
  • @JensSchauder thanks for replying. yes im aware of storing in request scope. however im exploring this as the first step of a larger snapshotting session state feature in my infrastructure. if mapdb is also viable as a state store, that makes my job easier. so i asked this question to focus on it is possible to do this in mapdb. not comparing mapdb vs anything else – Sandeep Sep 28 '22 at 16:01

1 Answers1

0

how do you manage the flushing of data at the end of a request

The documentation of MapDb is rather sparse, but at a first glance DB.close() seems to close the current transaction and write data to files, if it is actually backed by a file, which I guess you mean by "flushing".

Of course this begs the question why you would want to perma

I'd assume it destroys an in memory database

Note: Just as M. Deinum I don't really see what you expect to gain from using mapdb.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348