Re: Universal Server / Datablade questions
Posted in 1997
Peries, Chaminda (CPeries@dynasty.com) wrote:
: * Can SQL be used to manipulate (query, Add, Delete, view, join, etc.. )
: these data types ?
Yes.
When you create a UDT (User Defined Type) you create an interface (a
set of User Defined Functions) that perform tasks like construct an
instance of the type from a string, load a large object from a
file, compare two instances of the type, communicate the type over
the wire between a client and the server. Once these functions are
written, the SQL framework -- SELECT, INSERT, UPDATE and DELETE --
as well as SPL can be used to manipulate data stored in the new
data type.
For example, users can create a 'Complex Number' data type. Creating
this type would mean writing the C or SPL to implement the behavior,
and running DDL through the engine like;
create opaque type Complex
( internallength = 8,
alignment = 4 );
grant usage on type Complex to public;
.
.
create function ComplexIn(lvarchar)returns Complex
external name
"$INFORMIXDIR/extend/Complex/bin/complex.bld(CNInput)"
language c;
grant execute on function ComplexIn (lvarchar) to public;
create implicit cast
( lvarchar as Complex
with ComplexIn
);
.
.
.
create function Equal(Complex,Complex)returns boolean
WITH (
NEGATOR = NotEqual,
COMMUTATOR = Equal
)
external name '$INFORMIXDIR/extend/Complex/bin/complex.bld(eq_CN)'
language c;
grant execute on function Equal(Complex,Complex) to public;
.
.
.
Once the type is created, you can use it in DDL statements to
create new ROW TYPES and TABLES. For example;
CREATE ROW TYPE SampleRowType
(
Id INTEGER NOT NULL,
Number COMPLEX NOT NULL
);
CREATE TABLE MyNumbersOF TYPE SampleRowType;
The data in this table can be manipulated using the standard SQL
statements. i.e.
INSERT INTO MyNumbers
( Id, Number)
VALUES
( 1, '(4 + 5.i)');
SELECT * FROM MyNumbers;
: * Will a datablade of one database manufacturer be compatible with
: another's ? I ask this B'cos Oracle, DB2 and Informix all have come out
: with Universal servers. Before since they all used some form of SQL and
: more or less similar data types we could exchange data between different
: types of databases. What will it take to have this kind of
: flexibility/standards now ?
No.
There are two major differences. First, the server's internal API for
writing extensions varies. IUS has a published 'C' API. IBM's Universal
Server does too. Trouble is, the syntax varies. Oracle makes vague
hand-waving noises about CORBA, but as far as I know they don't yet
have a published interface.
The second difference is architectural. Informix and IBM both adopt the
approach that proved successful in the academic prototypes; Postgres and
Starburst. This calls for the extensions to be run within the address space
of the server. This is done for performance, simplicity and (somewhat
surprisingly) stability. Running extensions outside the address space
of the server is slower -- IPC overhead -- more complex to administer --
one process per 'class of extension' -- and requires care to ensure
that the failure of any component of the system is handled correctly.
There is no standard extension API. However, in the IBM and Informix
case the architectural similarities will make for a lot of semantic
overlap. This should make it theoretically feasible to come up with
a 'shim' layer to abstract most of the differences.
: *How different (or alike) are Informix Datablades from/to Oracle's Data
: Cartridges and DB2's (whatever they call it) ?
Informix DataBlades and IBM extenders are technically quite close. The
key difference is in the two organization's business models. IBM have
elected to make their extensions internally. They have their own
text, image and so on. If a customer wants to extend DB2, then IBM
lets them. See the Don Chamberlain book on _The_New_DB2_ for coverage
of how IBM does this. Informix use partners to actually write the
extensions, which allows Informix's engineering to focus on the
core engine. Oracle have no extension API, and instead their own
engineers extend the engine to hit the 'important' extensions. (If
your business objects aren't on their list, then you're simply
not 'important' enough).
: *Can these datablades be manipulated via ODBC (not to my knowledge) or
: is there a special call interface of some sort ?
ODBC can be used. It's just not particularly elegant, and fails to
leverage the power of the extensible database. The same can be
said for JDBC. But basicly, if you can ship SQL to the server and map the
server side types to reasonable ODBC types -- in other words, if you
get a real big hammer and hit it hard enough -- it can be made to
work.
However, embedded SQL (ESQL/C and COBOL) work fine. The proprietery
API's work (Informix CLI).
But I think if you're planning to use one of the more 'modern'
application development languages (Java, C++, HTML (don't laugh))
then there are more elegant API's for each of these.
Hope this helps!
KR
Pb