Re: Article on new mainframe use

Liste des GroupesRevenir à c arch 
Sujet : Re: Article on new mainframe use
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.arch
Date : 22. Aug 2024, 21:59:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <va88rq$ioap$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 8/16/2024 12:43 PM, George Neuner wrote:
On Fri, 16 Aug 2024 02:05:27 -0000 (UTC), Lawrence D'Oliveiro
<ldo@nz.invalid> wrote:
 
The best way to interface to [relational] DBMS was to be able to generate SQL
strings on the fly; but this required some facility with manipulation of
dynamic, variable-length strings, which COBOL completely lacked. And so
special extensions were tacked on, just to cope with the generation of SQL
queries and templates.
 You mean the *WORST* way.
 Just about every SQL injection attack is made possible by programmers
dynamically generating queries.  Most[1] attacks can be prevented
simply by proper use of SQL parameters.
  There are only a few situations in which dynamic SQL actually is
necessary - it is not possible to specify table or column names using
parameters, so to reuse a query with a different table or column name
does require generating new query text.
 Some applications do have a need to do this - but in most cases the
names to use will be known statically, will be predictable (e.g., date
related), or, if necessary, can be discovered by querying the database
schema - so they should not be provided by user input.
 The only exception is to permit a user to create a new *custom* table
type ... but there is little/no need for most applications to do this.
Most applications that must create new tables at runtime know what
names to use, and/or how to generate them, and do not need any input
from a user to do so.
 If creating custom table types with user specified names even is
permitted by the application, it should be an operation reserved to
privileged users [presumably who know what they are doing].
  ---
[1] many RDBMS now directly support JSON and/or XML data, and it is
possible via SQL parameters to inject false "path" information for
working with these data types.  To guard against this the application
itself has to be aware of the data layout.
Ironically, relational databases are one of those things that manages to be both underused and overused at the same time:
Underused: It is a sensible way of structuring data, but needing to interface with it though SQL strings is awkward and inefficient.
Overused: Probably 99% of the cases where a person resorts to using an RDBMS for something, it is massive overkill. Like, if an application expects someone to install MySQL or PostGres and then proceeds to use it for mostly trivial things, like application settings, that would be better served by INI/CFG files or the OS Registry, they are doing it wrong.
In most (non business) contexts, if someone is using an RDBMS for something, it is most often for holding application settings (well, except MineTest which made the absurd design choice of using the DBMS to store Minecraft-style terrain data; which is both absurd/overkill and a relatively inefficient way to store this type of data).
OTOH, seemingly people fail hard at coming up with sensible APIs to access database data.
Often it turns into one of:
Hey, compose SQL as strings and parse data from the response strings;
Awkwardly bolt the SQL query syntax onto the language, and then have a mechanism to parse the query responses (as some sort of weird outgrowth of the underlying language);
Or, do some weird OO thing where object methods exist for SQL keywords and each method returns an object that can be used to glue on the next keyword:
   res=db.select().from("FOOTAB").where().equals("NAME", "John").end();
Or, ...
I guess, possible alternative thoughts:
System where database is mapped to normal filesystem files, rather than some centralized DBMS;
Nominally, access is application local, exposed as a library facility;
Expressed in a way that "makes sense" for a language like C or similar, and likely abandoning most of the trappings of SQL syntax.
Possibly, it could make sense to also abandon the use of full static typing for the use of dynamically typed tagrefs, as ironically tagrefs could make the implementation simpler (and most of what "efficiency" would be lost by dynamic typing is likely to be dwarfed by the overhead of the system as a whole; and still more efficient than text parsing).
Though, the implementation could still enforce typing in some cases, such as if a column is defined as holding an integer, not allowing an "insert" to put a string or similar there.
The alternative being mostly to define it as a system for serializing C structs with the table layout mapped to the C struct, but then dealing with any table layout changes will be a pain (you would need to version the structs, and to automatically translate between them, which would be more of a pain than an implementation than just treating each row like a JavaScript style object and then letting the application deal with some of this).
Granted, one could still use C structs in the API but then have everything using dynamic types internally (and then try to dispel any complains that a dynamic-typed representation is somehow less efficient than trying to dynamically deal with a data layout resembling C structs... The moment the layout is not fixed at compile time, any claims of "efficiency" effectively go out the window).
But, maybe moot as it is likely to either still go unused, or used mostly for things like application settings.
...
I guess possible structure:
DB is organized into blocks, probably 1K to 4K, which will nominally reflect nodes in one or more B-Trees (along with data blocks);
Internally, each DB table will have its own B-Tree;
There will be an internal "table of tables" which would define the layout of each table and the root of each tables' tree, along with internal management metadata (such as a free blocks list).
Node structure (leaf nodes):
   Node Magic, Next/Prev/Up pointers, etc.
   A list of keys and offsets into the node, for each row/item;
     This will hold the primary key for the table.
   A data area for row data, and other data (like string contents).
For non-leaf nodes, likely only the index part would exist (except if the primary key is a string or similar), with the offsets instead giving node numbers.
Each row would consist of a set of key/value pairs, say:
   16-bit key, index into a symbol list
     All row and table names in the DB;
     May also encode the value's base type.
   32 or 64-bit value;
If one does: 4b type + 12b keyword, this should be sufficient as it is very unlikely there would be more than 4K unique table or column names.
Or, maybe:
   64-bit combined key/value, with 16-bit key+tag, and 48 bits value;
   Well, vs 80 or 96 bits per value;
Or, the key also allows for variable 32/64/128 bit payload:
   So, 48/80/144 bits per member.
Say, for example, 48 bits to hold an "Integer" member, etc.
Values that can't fit directly into the value field (such as strings) likely being expressed as size+offset fields to a data area stored at the end of the node.
The number of rows per node is variable, if an insert would result in a node over-filling, it is split.
There could be "data nodes" for items that are too large to be reasonably held directly in a node.
Say, for example, with a 1K node size, strings:
   <=8 or 16: Inline to Row
   <=64 bytes: Inline to Node
   65..511 bytes: Small Data Node (multiple items end-to-end per node);
   512+: Bulk data node (data is held within 1 or more nodes).
     Entire node designated to a single data item,
     or part of a larger item
...
As for API, might provide an API to specify simple single-table queries and then walk a list of results (in a vaguely similar way to "readdir()").
Might need a more complex mechanism to compose multi-table queries (if supported directly). Could possibly skip on SQL parsing.
Goal would be for something for small-to-medium use (possibly serving a similar role to something like SQLite), but possibly provided as an OS API. Ideally, would want something smaller and lighter weight than SQLite, which puts a pretty big chunk of code into a program (some of this could be reduced by not bothering to have it parse SQL and having the "core" only provide for single-table queries).
If I could find a spec for SQLlite's table format, might also be worth looking at, TBD...
But, dunno...

Date Sujet#  Auteur
14 Aug 24 * Article on new mainframe use132Stephen Fuld
14 Aug 24 +* Re: Article on new mainframe use124MitchAlsup1
15 Aug 24 i`* Re: Article on new mainframe use123George Neuner
15 Aug 24 i +- Re: Article on new mainframe use1Stephen Fuld
15 Aug 24 i `* Re: Article on new mainframe use121MitchAlsup1
15 Aug 24 i  +- Re: Article on new mainframe use1Stephen Fuld
15 Aug 24 i  +* Re: Article on new mainframe use118Niklas Holsti
16 Aug 24 i  i`* Re: Article on new mainframe use117Lawrence D'Oliveiro
16 Aug 24 i  i +* Re: COBOL, Article on new mainframe use30John Levine
17 Aug 24 i  i i+* Re: COBOL, Article on new mainframe use5Lawrence D'Oliveiro
17 Aug 24 i  i ii+- Re: COBOL, Article on new mainframe use1John Levine
17 Aug 24 i  i ii`* Re: COBOL, Article on new mainframe use3Keith Thompson
18 Aug 24 i  i ii `* Re: coroutines in COBOL, Article on new mainframe use2John Levine
18 Aug 24 i  i ii  `- Re: coroutines in COBOL, Article on new mainframe use1Lawrence D'Oliveiro
18 Aug 24 i  i i`* Re: COBOL, Article on new mainframe use24OrangeFish
18 Aug 24 i  i i +- Re: COBOL, Article on new mainframe use1John Levine
18 Aug 24 i  i i `* Re: COBOL, Article on new mainframe use22John Dallman
18 Aug 24 i  i i  +* Re: COBOL, Article on new mainframe use14MitchAlsup1
19 Aug 24 i  i i  i+- Re: COBOL, Article on new mainframe use1John Dallman
23 Aug 24 i  i i  i`* Re: COBOL, Article on new mainframe use12Terje Mathisen
23 Aug 24 i  i i  i `* Re: COBOL, Article on new mainframe use11Michael S
23 Aug 24 i  i i  i  `* Re: COBOL, Article on new mainframe use10Terje Mathisen
23 Aug 24 i  i i  i   `* Re: COBOL, Article on new mainframe use9Michael S
23 Aug 24 i  i i  i    +* Re: COBOL, Article on new mainframe use6John Levine
24 Aug 24 i  i i  i    i+- Re: COBOL, Article on new mainframe use1Lawrence D'Oliveiro
27 Aug 24 i  i i  i    i`* Re: COBOL, Article on new mainframe use4Keith Thompson
28 Aug 24 i  i i  i    i `* Re: COBOL, Article on new mainframe use3MitchAlsup1
28 Aug 24 i  i i  i    i  `* Re: COBOL, Article on new mainframe use2Keith Thompson
2 Sep 24 i  i i  i    i   `- Re: COBOL, Article on new mainframe use1Lawrence D'Oliveiro
24 Aug 24 i  i i  i    `* Re: COBOL, Article on new mainframe use2John Dallman
28 Aug 24 i  i i  i     `- Re: COBOL, Article on new mainframe use1Lawrence D'Oliveiro
19 Aug 24 i  i i  `* Re: COBOL, Article on new mainframe use7Lawrence D'Oliveiro
19 Aug 24 i  i i   `* Re: COBOL, Article on new mainframe use6John Levine
21 Aug 24 i  i i    `* Re: COBOL, Article on new mainframe use5Lawrence D'Oliveiro
21 Aug 24 i  i i     `* Re: COBOL, Article on new mainframe use4Keith Thompson
21 Aug 24 i  i i      `* Re: COBOL, Article on new mainframe use3MitchAlsup1
21 Aug 24 i  i i       +- Re: COBOL, Article on new mainframe use1Keith Thompson
2 Sep 24 i  i i       `- Re: COBOL, Article on new mainframe use1Tim Rentsch
16 Aug 24 i  i +* Re: Article on new mainframe use82George Neuner
22 Aug 24 i  i i`* Re: Article on new mainframe use81BGB
23 Aug 24 i  i i +- Re: Article on new mainframe use1Stephen Fuld
23 Aug 24 i  i i `* Re: Article on new mainframe use79Lawrence D'Oliveiro
23 Aug 24 i  i i  +* Re: Article on new mainframe use77BGB
23 Aug 24 i  i i  i+- Re: libraries, was Article on new mainframe use1John Levine
24 Aug 24 i  i i  i`* Re: Article on new mainframe use75Lawrence D'Oliveiro
24 Aug 24 i  i i  i +- Re: Article on new mainframe use1BGB
24 Aug 24 i  i i  i `* Re: Article on new mainframe use73John Levine
28 Aug 24 i  i i  i  +* Re: Article on new mainframe use70Lawrence D'Oliveiro
29 Aug 24 i  i i  i  i`* Re: Article on new mainframe use69John Levine
30 Aug 24 i  i i  i  i `* Re: Article on new mainframe use68Lawrence D'Oliveiro
30 Aug 24 i  i i  i  i  `* Re: Article on new mainframe use67Michael S
30 Aug 24 i  i i  i  i   +* Re: Article on new mainframe use12John Levine
30 Aug 24 i  i i  i  i   i`* Re: tiny COBOL, Article on new mainframe use11John Levine
31 Aug 24 i  i i  i  i   i +* Re: tiny COBOL, Article on new mainframe use8Stefan Monnier
31 Aug 24 i  i i  i  i   i i+* Re: tiny COBOL, Article on new mainframe use5Thomas Koenig
2 Sep 24 i  i i  i  i   i ii`* Re: tiny COBOL, Article on new mainframe use4Terje Mathisen
2 Sep 24 i  i i  i  i   i ii +* Re: tiny COBOL, Article on new mainframe use2Thomas Koenig
2 Sep 24 i  i i  i  i   i ii i`- Re: tiny COBOL, Article on new mainframe use1Anssi Saari
2 Sep 24 i  i i  i  i   i ii `- Re: tiny COBOL, Article on new mainframe use1Anton Ertl
31 Aug 24 i  i i  i  i   i i+- Re: tiny COBOL, Article on new mainframe use1Anton Ertl
31 Aug 24 i  i i  i  i   i i`- Re: tiny COBOL, Article on new mainframe use1George Neuner
2 Sep 24 i  i i  i  i   i `* Re: tiny COBOL, Article on new mainframe use2Lawrence D'Oliveiro
4 Sep 24 i  i i  i  i   i  `- Re: tiny COBOL, Article on new mainframe use1Lawrence D'Oliveiro
1 Sep 24 i  i i  i  i   +* Re: Article on new mainframe use6Lawrence D'Oliveiro
1 Sep 24 i  i i  i  i   i+* Re: COBOL history, Article on new mainframe use3John Levine
1 Sep 24 i  i i  i  i   ii+- Re: COBOL history, Article on new mainframe use1Lynn Wheeler
2 Sep 24 i  i i  i  i   ii`- Re: COBOL history, Article on new mainframe use1Lawrence D'Oliveiro
1 Sep 24 i  i i  i  i   i`* Re: Article on new mainframe use2John Dallman
2 Sep 24 i  i i  i  i   i `- Re: Article on new mainframe use1Lawrence D'Oliveiro
1 Sep 24 i  i i  i  i   `* Re: Article on new mainframe use48Lawrence D'Oliveiro
1 Sep 24 i  i i  i  i    `* Re: Article on new mainframe use47MitchAlsup1
2 Sep 24 i  i i  i  i     `* Re: Article on new mainframe use46Lawrence D'Oliveiro
2 Sep 24 i  i i  i  i      `* Re: Address bits again, Article on new mainframe use45John Levine
2 Sep 24 i  i i  i  i       +- Re: Address bits again, Article on new mainframe use1Thomas Koenig
2 Sep 24 i  i i  i  i       +- Re: Address bits again, Article on new mainframe use1Stephen Fuld
4 Sep 24 i  i i  i  i       `* Re: Address bits again, Article on new mainframe use42Lawrence D'Oliveiro
4 Sep 24 i  i i  i  i        +* Re: Address bits again, Article on new mainframe use2Terje Mathisen
4 Sep 24 i  i i  i  i        i`- Re: Address bits again, Article on new mainframe use1Lawrence D'Oliveiro
4 Sep 24 i  i i  i  i        `* Re: Address bits again, Article on new mainframe use39John Levine
4 Sep 24 i  i i  i  i         +* Re: Address bits again, Article on new mainframe use37John Dallman
4 Sep 24 i  i i  i  i         i+- Re: Address bits again, Article on new mainframe use1MitchAlsup1
5 Sep 24 i  i i  i  i         i+* transparent huge pages (was: Address bits again)4Anton Ertl
5 Sep 24 i  i i  i  i         ii+- Re: transparent huge pages1MitchAlsup1
5 Sep 24 i  i i  i  i         ii+- Re: transparent huge pages1Chris M. Thomasson
8 Sep 24 i  i i  i  i         ii`- Re: transparent huge pages (was: Address bits again)1Lawrence D'Oliveiro
5 Sep 24 i  i i  i  i         i`* Re: Address bits again, Article on new mainframe use31John Levine
8 Sep 24 i  i i  i  i         i `* Re: Address bits again, Article on new mainframe use30Lawrence D'Oliveiro
8 Sep 24 i  i i  i  i         i  `* Re: Address bits again, Article on new mainframe use29MitchAlsup1
8 Sep 24 i  i i  i  i         i   +* Re: Address bits again, Article on new mainframe use4MitchAlsup1
8 Sep 24 i  i i  i  i         i   i`* Re: Address bits again, Article on new mainframe use3Chris M. Thomasson
9 Sep 24 i  i i  i  i         i   i `* Re: Address bits again, Article on new mainframe use2Lawrence D'Oliveiro
9 Sep 24 i  i i  i  i         i   i  `- Re: Address bits again, Article on new mainframe use1Chris M. Thomasson
9 Sep 24 i  i i  i  i         i   `* Re: Address bits again, Article on new mainframe use24Lawrence D'Oliveiro
9 Sep 24 i  i i  i  i         i    `* Re: Address bits again, Article on new mainframe use23MitchAlsup1
10 Sep 24 i  i i  i  i         i     `* Re: Address bits again, Article on new mainframe use22Lawrence D'Oliveiro
11 Sep 24 i  i i  i  i         i      +* Re: Address bits again, Article on new mainframe use2John Levine
11 Sep 24 i  i i  i  i         i      i`- Re: Address bits again, Article on new mainframe use1Lawrence D'Oliveiro
11 Sep 24 i  i i  i  i         i      `* Re: Address bits again, Article on new mainframe use19MitchAlsup1
12 Sep 24 i  i i  i  i         i       `* Re: Address bits again, Article on new mainframe use18Lawrence D'Oliveiro
12 Sep 24 i  i i  i  i         i        `* Re: Address bits again, Article on new mainframe use17Lars Poulsen
12 Sep 24 i  i i  i  i         i         +* Re: Address bits again, Article on new mainframe use13Lawrence D'Oliveiro
13 Sep 24 i  i i  i  i         i         `* Re: Address bits again, Article on new mainframe use3George Neuner
4 Sep 24 i  i i  i  i         `- Re: Address bits again, Article on new mainframe use1Lawrence D'Oliveiro
28 Aug 24 i  i i  i  `* Re: Article on new mainframe use2Lawrence D'Oliveiro
23 Aug 24 i  i i  `- Re: Article on new mainframe use1George Neuner
16 Aug 24 i  i `* Re: Article on new mainframe use4Lynn Wheeler
15 Aug 24 i  `- Re: Article on new mainframe use1Thomas Koenig
15 Aug 24 `* Re: Article on new mainframe use7Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal