[Erlang] ODBC interface to Mnesia

Hakan Mattsson <>
Mon Aug 30 17:15:22 CEST 1999


On Sat, 28 Aug 1999, Bruce Fitzsimons wrote:

Bruce>Do you have any more comments on this? I'm still at an architecture level of
Bruce>design - I think an ODBC interface would be very positive for the growth of
Bruce>Erlang because it allows admin and reporting interfaces to be written with
Bruce>familiar Windows tools (or *nix tools, if a compatible driver was written
Bruce>for it).
Bruce>
Bruce>You are correct about this being a lot of work. Its a good challenge to get
Bruce>my teeth into on the fast approaching winter nights.

Back in 1997, I did some estimations of the work needed in order to
implement a foreign language interface to Mnesia. I think that the
work could be divided in several phases, starting with "Mnesia SQL".
The actual figures will of course depend a lot of the ambition
level (conformance & quality) and of the skill of the implementor.

We decided to implement the last alternative "Mnesia Session" as it
made Mnesia open enough, without too much efforts.

/Håkan

    Mnesia is a DBMS implemented in Erlang and intended to be used from
    programs written in Erlang. The query language Mnemosyne is fully
    integrated with Erlang as a pure language extension. When discussing
    potential new interfaces to Mnesia, it is important to have in mind
    that interfaces for foreign languages always will add a significant
    overhead caused by impedance mismatch and interprocess communication.
    
    It would be very nice to have a SQL-based interface to Mnesia since it
    is standardized and is supported by many other relational DBMS's. The
    most straightforward approach for an implementation of a SQL interface
    to Mnesia is to map Mnesia's current functionality to SQL and make use
    of ODBC to benifit from already existing ODBC language bindings.
    
      1a/ We estimate the work of "Mnesia SQL" to be approximately
	  4-5 months.
    
    There are three conformance levels of SQL. The simplest one is called
    "Entry SQL" and in order to be conformant with that there are several
    features that OTP needs to be extended with. E.g. views, ordered
    tables, security, constraints, string pattern matching, foreign keys
    etc. This involves work in Mnesia, ERTS and StdLib.
    
      1b/ We estimate the work of "Entry SQL" to be approximately
	  10-12 months, plus the work of "Mnesia SQL".
    
    The next conformance level of SQL is called "Intermediate SQL" and
    requires Mnesia to be extended with features like domains, datetime,
    alternate isolation semantics in transactions, updatable views,
    dynamic SQL etc.
    
      1c/ We estimate the work of "Intermediate SQL" to be approximately
	  4-5 months, plus the work of "Entry SQL".
    
    The ultimate conformance level of SQL is called "Full SQL" and
    requires Mnesia to be extended with features like assertions,
    privileges with column granularity, cascading effects, various
    character sets, explicit time precision, multiple catalogs, temporary
    tables etc.
    
      1d/ We estimate the work of "Full SQL" to be approximately
	  4-5 months, plus the work of "Intermediate SQL".
    
    Another apporoach of open Mnesia for access from foreign languages is
    to specify an interface with OMG's IDL and make Mnesia's entire
    functionality available via our own ORB.
    
      2/ We estimate the work of "Mnesia Session" to be approximately
	 3-4 months.




More information about the erlang-questions mailing list