Code Monkey home page Code Monkey logo

restore's Introduction

The premise of the Restore application is this:
	People often say you need to have backups. But that is not the end goal.
	The end goal is to be able to restore your data when needed.
	So we have an application focused on that goal.

The aim of this program is to make backups of personal files more efficient
by realising an important point - a lot of personal data is re-creatable.
Some simple examples:
	Programs, libraries and other package-manager provided files can be re-downloaded.
	A digitally distributed game can be re-downloaded, but its saves cannot.
	A conversion of a file from one format to another can be re-applied.
	Files in source control can be recovered from the repository data.

The program works by taking a list of files and attempting to associate them with handlers.
Handlers have a priority and a match rule, allowing for automatic allocation of files to handlers.

Both directories and regular files can have handlers. If a directory is handled, files inside it
generally don't need to be (but may). This is implemented by having a high-priority handler for files
whose directories have a non-trivial handler.

Although handler allocation is automatic, it is a seperate user-initiated step.
This is because the user can also manually edit the list of handler assignments.

Finally, the restore service requires a backing store to store handler metadata, which
in the worst case is simply the entire data of the file. In this regard the backing store
is similar to a traditional backup service.

In summary, backing up a collection of files might look like this:
	Automatically allocate handlers
	Manually edit allocation list
	Initiate backup

An example of some handlers:
	Package manager handler:
		match on: file is reported as owned by a package by the manager, and isn't modified
		store: package name as metadata
		on restore: install package
	File conversion handler:
		match on: probably nothing, or possibly specific cases like "same name, different extension from this set"
		store: source file path, conversion command
		on restore: wait for source file handler, then run command

The archive format:
	The archive is a tar archive containing the files:
		./manifest # a copy of the manifest being saved, allowing us to map paths to handlers during restoration
		./data/PATH/ # note that this is a directory, even if the file saved is not
		./data/PATH/KEY # for each key in PATH's extra_data, a file exists containing the value
		...
	To save space, ./data/PATH/ may be omitted if no extra_data is present for that PATH.
	Motivations:
		The use of a tar archive allows the data to remain recognisable by both manual inspection and sniffing
		tools should problems occur.
		A secondary motivation is that the tar format allows easy stream-based construction compared to, say,
		JSON, which (for most libraries) must be constructed entirely in memory before being written out.

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.