Labs/Bespin/DesignDocs/MetaData: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with ' == Meta Data == === Examples === There are a number of areas where we have a growing need for a meta-data system: * status messages active on file save for future commit messa...')
 
No edit summary
Line 1: Line 1:
== Meta Data ==
== Meta Data ==


Line 15: Line 14:
The meta-data system should:
The meta-data system should:
* Be accessed via an API so the disk layout can be changed in the future
* Be accessed via an API so the disk layout can be changed in the future
* Have 0 risk of data and meta-data files colliding
* Have zero risk of data and meta-data files colliding
* Should allow the storage of large amounts of data (e.g. the current edit version of a file)
* Should allow the storage of large amounts of arbitrary data (e.g. the current edit version of a file)
* Storage should count towards a users quota (TODO: Are there any cases where this should not be the case?)
* Storage should count towards a users quota (TODO: Are there any cases where this should not be the case?)


=== Proposed Solution ===
=== Proposed Solution ===
'''API:'''
# Get a File object
project = get_project(user, owner, 'MyProject')
file = project.get_file_object("example.js")
# Read the 'live-edit' meta-data
current = file.metadata['live-edit']
# Reads from MyProjectMeta/example.js/live-edit
# Write to the 'status-messages' meta-data
file.metadata['status-messages'] = new_msg
# Writes to MyProjectMeta/example.js/status-messages
'''Data Storage:'''


Inside a users project directory we should have something like:
Inside a users project directory we should have something like:
- SomeProject/
- SomeProject/
  - example1.js
  - example1.js
  - some-dir/
  - some-dir/
    - example2.js
    - example2.js
  - ...
  - ...
- SomeProjectMeta/
- SomeProjectMeta/
  - example1.js/
  - example1.js/
    - status-messages
    - status-messages
    - live-edit
    - live-edit
    - chat-log
    - chat-log
    - ...
    - ...
  - some-dir/
  - some-dir/
    - example2.js/
    - example2.js/
      - status-messages
      - status-messages
      - live-edit
      - live-edit
      - chat-log
      - chat-log
      - ...
      - ...


I think this system is extendable, and there isn't any danger that the data will collide with the meta-data.
I think this system is extensible, and there isn't any danger that the data will collide with the meta-data.
Confirmed users
295

edits

Navigation menu