Skip to content

Commit 7743718

Browse files
author
R. S. Doiel
committed
Merge branch 'main' of github.com:caltechlibrary/dataset into gh-pages
2 parents 4d89b7b + d3f4f66 commit 7743718

19 files changed

Lines changed: 154 additions & 298 deletions

dataset-v2-next.html

Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,18 @@ <h2 id="ideas">Ideas</h2>
5454
<p>In developing a version 2 of dataset an eye needs to be kept to
5555
several areas –</p>
5656
<ol type="1">
57-
<li>reduction of complexity.
57+
<li>reduction of complexity (see v2.3 has significant code reduction).
5858
<ol type="a">
5959
<li>simplification of codebase</li>
6060
<li>simplification of operation</li>
61+
<li><strong>elimination</strong> of underused “features”</li>
6162
</ol></li>
6263
<li>learn from other systems.
6364
<ol type="a">
6465
<li>align with good data practices</li>
6566
<li>adopt standards, e.g. codemeta for general metadata</li>
6667
</ol></li>
67-
<li><strong>elimination</strong> of underused “features”.</li>
6868
</ol>
69-
<p>With the introduction of Go 1.18 some of this can be achieved through
70-
a better organization of code, some by applying lessons learned over the
71-
last several years and some by reorganizing the underlying persistenent
72-
structure of the collections themselves (e.g. take advantage of SQL
73-
storage options as well as the tried and true pairtree model)</p>
7469
<h2 id="proposed-updates">Proposed updates</h2>
7570
<p>The metadata of a collection can be described by two JSON document.
7671
Operational metadata (e.g. type of collection storage) is held in a
@@ -101,47 +96,30 @@ <h2 id="proposed-updates">Proposed updates</h2>
10196
explored through using the tool. Versioning should be across the
10297
collection meaning both the JSON documents and attachments should be
10398
versioning consistently or not versioned at all.</p>
104-
<p>Dataset frames have proved very helpful. Where possible code should
105-
be simplified and frames should be available regardless of JSON document
106-
storage type. As we continue to use frames in growing collections
107-
performance will need to be improved. In practice the object list or
108-
keys associated with a frame are used not the direct representation of
109-
the frame in memory. This is an area suited to refinement. The internals
110-
could be changed to improve performance as long as the access to the
111-
keys/objects in the frame remains consistent. E.g. Frames don’t have to
112-
be stored as plain text on disk. The code for frames needs to be
113-
reviewed and positioned for possible evolution as needs evolve with
114-
frame usage.</p>
115-
<p>Before frames were implemented data grids were tried. In practical
116-
usage frames replaced grids. The data grids code can be removed from
117-
dataset. The few places where they are used in our feeds processing are
118-
scheduled to be rewritten to use regular frames. It is a good time to
119-
prune this “feature”.</p>
120-
<p>Importing, syncing and exporting to CSV is a canidate for a rethink.
121-
While it makes it easy to get started with dataset maintaining the
122-
ability to syncronization between a CSV representation and a dataset
123-
collection is overly complex. While CSV support in Go is very good but
124-
so are the Python libraries for working with CSV files. Processing
125-
objects in a collection is more commonly done in a script (e.g. Python
126-
using py_dataset) then directly in Go. It may make more sense to either
127-
simplify or drop support for CSV for the version 1 level integration.
128-
How much does Go bring to the table beyond Python? Does this need to be
129-
“built-in” to dataset or should it be left to scripting a dataset
130-
service or resource? Does import/export support of CSV files make
131-
dataset easier to use beyond the library? If so does that extend to SQL
132-
tables in general?</p>
99+
<p>Dataset frames have proved very helpful until implementation of
100+
<strong>dsquery</strong>. <strong>dsquery</strong> was an experimental
101+
add on that allowed SQL queries against the object store. Even for a
102+
pairtree collection it was easy to use SQLite databases as a rich index
103+
then query that. Additionally in v2.2 JSONL (JSON lines) support was
104+
added to dataset command. This proved very fast and was much more
105+
flexibly than clone repositories. It’s also easy to take samples out of
106+
a stream of of JSON objects. Given the current state of JSON tooling
107+
Cloing, sample, sync as well as the CSV importer seems redudent. About a
108+
quarter of the Dataset codebase is taken up supporting these features
109+
which have limitted application moving forward. They are being removed
110+
as part of the simplification process.</p>
133111
<p>There are generally two practices in using dataset in Caltech
134112
Library. The command line is used interactively or Python is used
135113
programatically to process collections (e.g. like in reporting or the
136114
feeds project). Python has been support via a C shared library called
137115
libdataset. While this has worked well it also has been a challenge to
138116
maintain requiring acccess to each os/hardware platform the cli
139-
supports. I don’t think this is sustainable. Since the introduction of
140-
datasetd (the web service implementation of dataset) py_dataset could be
141-
rewritten to use the web service implementation of dataset
142-
(i.e. datasetd) and this would fit most of our use cases now and planned
143-
in the near future. It would avoid some hard edge cases we’ve run across
144-
where the Go run time and Python run need to be kept in sync.</p>
117+
supports. It is not sustainable. Since the introduction of datasetd (the
118+
web service implementation of dataset) py_dataset could be rewritten to
119+
use the web service implementation of dataset (i.e. datasetd) and this
120+
would fit most of our use cases now and planned in the near future. It
121+
would avoid some hard edge cases we’ve run across where the Go run time
122+
and Python run need to be kept in sync.</p>
145123
<p>Dropping libdataset support (done in release v2.2.2) would allow
146124
dataset/datasetd to be cross compiled for all supported platforms using
147125
only the Go tool chain. It would make fully supporting snap installs
@@ -184,7 +162,7 @@ <h2 id="proposals">Proposals</h2>
184162
<li><strong>minor</strong> would increment the minor number and set
185163
patch to zero</li>
186164
<li><strong>major</strong> would increment the major number and set
187-
minor and patch to zer</li>
165+
minor and patch to zero</li>
188166
</ol></li>
189167
<li>JSON objects should be versioned if the collection is
190168
versioned.</li>
@@ -213,19 +191,18 @@ <h2 id="leveraging-sql-with-json-column-support">Leveraging SQL with
213191
created and a collections.json document will also be create. This will
214192
help in supporting import/export (aka cloning) of JSON collections
215193
to/from pairtree and SQL engines.</p>
216-
<p>The v1 structure of a collection is defined by a directory name (e.g.
217-
mydataset.ds) containing a collection.json file (e.g. 
218-
mydata.ds/collection.json).</p>
194+
<p>The v1 structure of a collection is defined by a directory name
195+
(e.g. mydataset.ds) containing a collection.json file
196+
(e.g. mydata.ds/collection.json).</p>
219197
<p>When supporting SQL storage the collections.json should identify that
220-
the storage type is a SQL storage engine targetted
221-
(e.g. <code>"sqlite3", "mysql"</code>) a URI like string could be used
222-
to define the SQL stored based on Go’s DNS (data source name). The
223-
storage engine could be indentified as the “protocal” in the URI. The
224-
collection.json document SHOULD NOT require storing any secrets. Secrets
225-
can be passed via the environment. Loading a configuration should
226-
automatically check for this situation (e.g. you’re running a datasetd
227-
cprocess in a container and the settings.json file needs to be stored in
228-
the project’s GitHub repo)</p>
198+
the storage type is a SQL storage engine targetted (e.g. “sqlite3”,
199+
“mysql”`) a URI like string could be used to define the SQL stored based
200+
on Go’s DNS (data source name). The storage engine could be indentified
201+
as the “protocal” in the URI. The collection.json document SHOULD NOT
202+
require storing any secrets. Secrets can be passed via the environment.
203+
Loading a configuration should automatically check for this situation
204+
(e.g. you’re running a datasetd cprocess in a container and the
205+
settings.json file needs to be stored in the project’s GitHub repo)</p>
229206
<p>If the “storage type” is not present it is assumed that storage is
230207
local disk in a pairtree. Storage type is set at collection creation.
231208
E.g.</p>

0 commit comments

Comments
 (0)