ITBoard

Welcome to ITBoard Sign in | Join | Help
in
Site găzduit de AXTI
Home Blogs Forums Photos Downloads

Catalin's Blog

Ramblings on the technical world we live on. "Opiniile expuse aici sunt strict ale persoanelor care le publica."

The dummies cookbook for multi database access - Introduction

So at last, I bring myself to write this so to try a bit to begin with the beginning.

We all know that around are many different database vendors, but when we think at databases we think at SQL. Which means Structured Query Language, which is also ISO and ANSI standardized.
In addition, .Net has a provider model that, at least on theory, forces you to use a pattern and an interface implementation in accessing the database.  In plain english this means that all providers should expose same methods (implement the same interface), and behave consistently similar. Sounds a bit like the ODBC times for .Net.

Therefore, if you do not know better, you suppose that is fairly easy to change at runtime the database used, and that all will work fine.
Well, surprise, noooo! Smile
And hearing ISO and interoperability in some sentence and getting none (interoperability) is a bit ironic after all the bitter fights on document standards, and I really hope that this text will have some relevance after they are all but forgotten.

In this series or articles, I will try to share a bit from my experience in this field (nobody told me that it cannot be done so I've tried my hand at it…Smile),  present the problems, how to work around them, and what the future may hold for us (and if it help us or not).  Also I will try to give you resources on dealing with these problems, resources that some could prove useful even if you just want to target one database and you do not know where to start (for that particular database).

And be warned some of the stuff will be a bit controversial.
In addition, I'm not touching the code generators for database abstraction layers (DAL), I do believe that you can have a piece of code that could work on any database (better said on reasonable number of them) without rebuilding the application and with decent performance. Of course that are instances in which other options could be better.

Published Thursday, June 05, 2008 5:51 PM by MrSmersh

Comments

 

geto_dacul said:

Asta suna a ORM.CU nhibernate te-ai jucat poti face asta.Adica sa te conectezi la SGBD pentru care ai provider-ul respectiv.

Microsoft o sa faca chestia asta in ADO.net enetity framework care e cam beta din cate stiu eu.LINq e ORM dar numai pt sql server ,cel putin deocamdata din cate stiu

June 6, 2008 3:49 PM
 

MrSmersh said:

Pai nu, mie mi s-ar parea normal sa pot deschide o ADO .Net connection si pe urma la fel sa fac toate operatiile pentru toate bazele de date (la fel cu SQL Server), si sa mearga la fel. Si asta nu e ORM...

Si mai sint alte chestii care "fac" asta dar in principal la build time eu zic ca merge si la run time.

Dar sa nu anticipez Smile, dar voi vorbi si despe unel din chestii pomenite, da sau nu si de ce...

June 6, 2008 6:47 PM
 

geto_dacul said:

pai daca ai driver de oledb sau odbc pt sgbd respectiv poti si cu ado peste oledb sau odbc

June 6, 2008 8:27 PM
 

MrSmersh said:

Da poti, si ce daca? La capat tot ai ceva care se manifesta diferit, si spre deosebire de ODBC, ADO nu prea stie sa uniformizeze asta.

Si mai e o smecherie/limitare cind mergi peste ODBC, dar iarasi sa nu anticipam.

June 7, 2008 9:57 AM
 

geto_dacul said:

you know better :)

June 8, 2008 10:34 AM
 

MrSmersh said:

I hope so! Smile

If not always willing to learn.

June 8, 2008 9:09 PM
 

tudor.t said:

As zice ca independenta de database server la ora actuala e un "holy grail" cam greu de atins, cu exceptia unor aplicatii simple, sau daca ne limitam la 2 - 3 baze de date mai cunoscute... In rest, diferentele sunt prea mari pentru a fi acoperite complet cu un layer de abstractizare in plus (fie ca e ADO.NET, O/RM sau altceva), cat timp standardele existente raman doar pe hartie si nu sunt implementate 100% ..

Inca mai exista servere de baze de date care nu au notiunea de tranzactie, tipurile de date suportate difera deseori, sunt servere care nu au notiunea de stored procedure, delimitatorii la constante difera si ei deseori etc..

June 10, 2008 10:14 AM
 

MrSmersh said:

OK... Nu e simplu, e ceva de studiu, si citeodata sigur nu e frumos, dar e posibil.

Si merge, am vazut cam toti providerii (identitiy, aia de workflows etc) implementati multi database.

June 10, 2008 11:49 AM
 

Catalin's Blog said:

Desi aveam in plan WF putin, intimplator am avut kef si inspiratie pentru seria de articole care a adus

October 2, 2009 5:24 PM
Anonymous comments are disabled

This Blog

Syndication

Tags

Home     Blogs     Forums     Photos     Downloads
Copyright © 2007 ITBoard.ro. Toate drepturile rezervate.