~openerp-commiter/openobject-addons/extra-6.0

« back to all changes in this revision

Viewing changes to etl/specs/prototype/README.txt

  • Committer: Fabien Pinckaers
  • Date: 2009-01-12 07:30:23 UTC
  • Revision ID: fp@tinyerp.com-20090112073023-t6pon9a1d16bycby
Adding_specs_etl

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Prototypes for the ETL system
 
2
=============================
 
3
 
 
4
 
 
5
Notes on the prototype
 
6
~~~~~~~~~~~~~~~~~~~~~~
 
7
 
 
8
The prototype prooved it's quite easy and fast to develop a complete ETL.
 
9
It takes about 15 lines per simple connector to develop. The whole prototype
 
10
including the framework and the connectors takes 150 lines, including the
 
11
following connectors:
 
12
* CSV input, csv output, data logger, data logger in one block
 
13
* Sort, diff, merge
 
14
 
 
15
The concept used by the prototype:
 
16
* Channel: name of transition used by connector to read/write
 
17
    for example, the diff connector read two channels (original, modified)
 
18
    and write to four channels: same, added, removed, updated
 
19
 
 
20
Summary of improvements to apply
 
21
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
22
 
 
23
* Don't put the logic in the node but in the job execution. That's the job
 
24
that should schedule the node function calls. And not the node itself.
 
25
 
 
26
* Add a system of triggering/listening events. Some events can be raised by
 
27
default: start, stop, end, error. Others can be user defined.
 
28
 
 
29
* Add different kinds of transitions. We implemented the data transition, we
 
30
will have to add the event/signal transition.
 
31
 
 
32
* Use a class to store the data, not a simple dict. We should be able to put
 
33
meta information on this class, so that information change from one node to
 
34
another. The class should also store the metadata of the current information.
 
35
(the list of fields and their type)
 
36
 
 
37
* Currently, I am passing the same data structure to all channels. It's efficient,
 
38
but when we split from one node to two, we have two pointers to the same data.
 
39
So if one node change data, it's also changed in the splitted branch. On the
 
40
transition, we should be allowed to decide if we copy() or not the data.
 
41
 
 
42
* Change the run execution on jobs and nodes so that it process one element at
 
43
a time and not the complete flow of elements. So that the job execution can decide
 
44
to stop running, run one element at a time to trace, or run until it's finnished.
 
45
 
 
46
* If you send an empty data to output, it does not go to input of the relateds
 
47
nodes. So that we have a system to manage loops and recursivity.
 
48
 
 
49
* Create a new node type which is sub-job or sub-process. It calls a new process.
 
50
 
 
51
* I implemented a push mechanism, we should also add a pull mechanism: a node
 
52
can request information to another node, and then receive the requested result.
 
53
 
 
54
 
 
55
Questions
 
56
~~~~~~~~~
 
57
 
 
58
* What's the best solution to store the data ? a list of dict is easy but may
 
59
take some place in memory. Is it better to use a list of lists ? We should
 
60
evaluate the difference in memory occupation. If it's less than 50%, we keep
 
61
list of dict.
 
62
 
 
63
Time Line
 
64
~~~~~~~~~
 
65
 
 
66
1. Finnish requirements
 
67
 * Prototype (done)
 
68
 * All menus
 
69
 * All screens
 
70
 * List of components to develop
 
71
 
 
72
2. Development
 
73
 * Implement all objects/menus/views in Open eRP
 
74
 * Improve the current prototype, integrating the above notes
 
75
 
 
76
3. Development of the Open ERP interface
 
77
 * eTiny: generalisation of the workflow editor to create a new type of view
 
78
 * etl addons: Integrate prototype logic on Open ERP objects
 
79
 
 
80
4. Develop real use cases
 
81
 * Sage -> Open ERP
 
82
 * Tally -> Open ERP
 
83
 * SugarCRM -> Open ERP
 
84
 
 
85
The Process
 
86
~~~~~~~~~~~
 
87
 
 
88
1. Run
 
89
 
 
90
First, the job process calls run on each starting node.
 
91
 
 
92
The run calls:
 
93
* start()
 
94
* input()
 
95
* stop()
 
96
 
 
97
2. Start
 
98
 
 
99
The start calls all start of related nodes through outgoing transitions.
 
100
 
 
101
3. Input
 
102
 
 
103
Then, the run call input with the data it reads from sources (csv, sql).
 
104
 
 
105
The input process the data and calls output on resulting data, on a dedicated
 
106
channel.  None channel means all channels.
 
107
 
 
108
The output calls input on related transitions with the data to related
 
109
nodes through outgoing transitions and channels.
 
110
 
 
111
4. The stop
 
112
 
 
113
The stop ends the process.
 
114
 
 
115
When all related nodes through incoming transistions have stopped, the current
 
116
node stops and propagate the stop call.
 
117
 
 
118
 
 
119
 
 
120
List of tests in the prototype
 
121
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
122
 
 
123
test.py
 
124
-------
 
125
 
 
126
data/partner.csv -> sort(name) -> output/partner.csv
 
127
                               -> logger
 
128
 
 
129
test2.py
 
130
--------
 
131
 
 
132
data/partner.csv
 
133
    -> log('PartnerLogger')
 
134
        -> output/partner.csv
 
135
            -> log('OutputLogger')
 
136
 
 
137
test3.py
 
138
--------
 
139
 
 
140
data/partner.csv
 
141
    -> log('PartnerLogger')
 
142
        -> sort('name')
 
143
            -> output/partner.csv
 
144
                -> log('OutputLogger')
 
145
 
 
146
diff.py
 
147
-------
 
148
 
 
149
First Job:
 
150
* Perform a diff between partner.csv and partner2.csv and store
 
151
   - intermediate/add.csv : added records
 
152
   - intermediate/remove.csv : removed records
 
153
   - intermediate/update.csv : updated records
 
154
 
 
155
data/partner.csv
 
156
data/partner2.csv
 
157
    -> diff()
 
158
       - csv.output(intermediate/add.csv)
 
159
       - csv.output(intermediate/remove.csv)
 
160
       - csv.output(intermediate/update.csv)
 
161
 
 
162
Second Job:
 
163
* Apply on partner3.csv to produce output/partner3.csv
 
164
   - add records from intermediate/add.csv
 
165
   - del records from intermediate/remove.csv (not yet implemented)
 
166
   - update records from intermediate/update.csv (not yet implemented)
 
167
 
 
168
data/partner3.csv
 
169
    -> merge(intermediate/add.csv)
 
170
        -> filter(intermediate/remove.csv)
 
171
            -> update(intermediate/update.csv)
 
172