SFTtech / nyan

Typesafe hierarchical key-value database with inheritance and dynamic patching :smiley_cat:
Other
207 stars 29 forks source link

Hot reloading #85

Open TheJJ opened 3 years ago

TheJJ commented 3 years ago

It should be possible to hot-reload nyan files when they change.

Changes in the file could either be applied by an auto-generated patch, or the whole state is replayed with the new values.

Or some other creative idea :)

wanghenshui commented 2 years ago

you need a file watcher

TheJJ commented 2 years ago

indeed, but what follows then? to what state is the database updated? :)

wanghenshui commented 2 years ago

what do you mean? pull nyan files from a central server / a cental server dispatch nyan files?

this kind of central config server just like ETCD/Zookeeper, with watch

basicly every company has it's own config central management server

heinezen commented 2 years ago

@wanghenshui

@TheJJ is referring to what should happen inside the database when a file is changed. A file watcher only tells us that a file is changed, that is true... but we need to figure out how to sanely update the database when the changes occur :D

pull nyan files from a central server / a cental server dispatch nyan files?

That's overkill for now. We can currently assume that the nyandb is running locally for one user (the openage engine) and do not have to worry about distribution over network.

wanghenshui commented 2 years ago

@heinezen nyandb provide a watch/subcribe api, problem solved

which db do you use? redis has subscribe, mongo has change stream

if you implement your own database, should provide some kind of feature

heinezen commented 2 years ago

@wanghenshui nyan is the database. that what we are implementing :)