Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template storing #34

Closed
mame82 opened this issue Sep 21, 2018 · 3 comments
Closed

Template storing #34

mame82 opened this issue Sep 21, 2018 · 3 comments

Comments

@mame82
Copy link
Collaborator

mame82 commented Sep 21, 2018

A proper serialization mechanism for the state instance objects is needed, along with a proper storing mechanism for the serialized data

  • should be used to store templates
  • persistent storage (on SD card)
  • has to sync FS as soon as data is written, because the situation of power loss is common (f.e. when powered by host USB and detached)
  • as protobuf is already used to transfer data (gRPC), a method for storing serialized protobuf messages would be prefered

Candidates for serialization:

  • protobuf
  • JSON
  • gob ??

Candidates for storage

  • file based (not prefered, because of the need to manage multiple files with additional metadata)
  • sqlite --> has to be checked for the "immediate FS sync" requirement

A database driven solution is preferred for the storage problem

@mame82 mame82 self-assigned this Sep 21, 2018
@mame82 mame82 added this to ToDo in P4wnP1 alpha release via automation Sep 21, 2018
@mame82 mame82 added this to the Alpha release milestone Sep 21, 2018
@mame82
Copy link
Collaborator Author

mame82 commented Sep 21, 2018

Chosen database: https://github.com/dgraph-io/badger

  • allows syncing DB writes to disk
  • simple KV storage
  • native Go implementation (no cgo)
  • compatible license (Apache-2.0)

@mame82
Copy link
Collaborator Author

mame82 commented Sep 21, 2018

For encoding the gRPC protobuf encoding is used:
--> Only structs with protobuf support are valid for storing (this means every storeable type/struct should be defined in the proto file ;-))

@mame82
Copy link
Collaborator Author

mame82 commented Oct 13, 2018

Solved with badger and protobuf (only data defined in proto files is storable)

@mame82 mame82 closed this as completed Oct 13, 2018
P4wnP1 alpha release automation moved this from ToDo to Done Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant