Resources, urps ,urns, users and rooms (v0.9)
Contents
Resources
In NBD we call resources :
- Files
- “JSON objects”.
- Nodes of the NBD network (computers with NBD instaled)
- Scripts in OP language
- Native functions implemented in C
- Streams
- Tables in SQL Data bases
- Hadoop HDFS files
- ...
All Native Big Data resources:
- Will be located in one or more NBD node(s).
- Will be available in all the NBD net.
- Will be persistent.
- Will be mapped by a pointer called 'urp'.
URP's
Resource pointers will be names used to access resources. A resource pointer will be named “urp” (Universal Resource Pointer) and will have the following structure:
urp: [ type of resource ] :/ [ name of resource]
Example:
- urp:file:/documents/doc_1
- urp:obj:/objects/hash_23
- urp:op:/scripts/op_1
- urp:js:/test32
- urp:server:/pc_1
- urp:stream:/project_1/str
- urp:hdfs:/ff/tc1
- urp:ddbb:/ff/tc1
The syntax of a urp is the same as urns and is described in rfc 2141 [[1]] with only these diferences:
- urps begins with “urp:” rather than “urn:”
- NID field of urps describes the type of resource pointed.
- “#” character will be used to specify "fragments".
ROOMS
urp's are stored in rooms. A room is a repository of urp's. Two rooms can have urps with the same name but will represent different resources. Rooms are like namespaces in other languages like C++ or Java. It is recommended to create one room for every project.
USERS
Every user that will use NBD should have a user account. Every user account have its user name and password like other platforms. The security tasks are implemented in the resolver (authentication, privileges,...) Every time a user logs in the system a JWT token is created. This token will be used as a user credential in all the NBD network. Users can have access privileges to rooms. When a user have read privileges in a room, he can read all the resources of the room. A user can be:
- Owner: The owner of a room can read an write resources and can change the access privileges to the room of other users. Should be a project manager or a Scrum Master in Agile.
- Worker: Can read an write resources in the room. This is the role of developpers and analists.
- Guest: Can only read resources of the room. This user mus't be used by reports and people than only consult information.
- Applier: Users than wants enter in the room. Owner will be noticed about this situation and can change the privilege to Worker of Guest.
A administrator user named "admin" (with starting password "admin") is always available in a new installed system. This user can create new users. After a new instalation the password of this user should be changed.
URN's
Urps can be pointed by urn’s. Urn's (Universal Resource Names) are intended to serve as persistent, location-independent identifiers. A urn can point to a urp in a room, a url or other urn.
The resolver
In order to get a resource mapped by a urn or a urp NBD has a component named “resolver” which can translate names or pointers to physical resources. The resolver can be accessed from C code, from Javascript code, from op code or from http with these commands:
- I2C: uri to description:
- Parameters: urp and room or urn
- Result: A hash object with the metadata of the resource.
- I2R uri to resource:
- Parameters: urp and room or urn
- Result: A copy of the resource as a JSON object.
- I2O uri to object:
- Parameters: urp and room or urn
- Result: A proxy object loaded in RAM in a NativeBigData server. Access to server object is faster because only loads needed data and the loades data is persistent in RAM.