UPB's DB Engine

5 views
Skip to first unread message

Rebles

unread,
May 4, 2008, 4:52:38 AM5/4/08
to MyUPB Developers Forum
Hey guys,

I don't know if any of you realized this, but I added (and commented
out) some HTML coding in the install.php for users to *choose* their
own backend. Now, I'm not saying that it's going to be added, because
I think we should talk about it. I've mostly just done a lot of
thinking about it in my head.

But I think it's important to offer other DB solutions to users, for a
couple of reasons. It will mean we are that much better than other
forums (how many forums let users get to pick their own DB?). In
addition, more people will feel more confident in UPB, because not
only do we offer our own custom database solution, but we offer
multiple ones, which means users can pick which ever ones he or she
feels comfortable with. I don't see it as a kick to the groin to
TextDB, but as an expansion of UPB to a wider audience.

So, how would one implement a forum that has the ability to use an
array of different databases? With all the different syntaxes and
methods to queries, supporting passwords, etc. I thought of the
perfect solution: We use TextDB syntax. TextDB queries are already
written in the forum, so it would require the least amount of code
change and has a lower chance of breaking the forum than trying to use
SQL syntax or something. Also, if we were to switch to another query
structure, we would have to worry about script/record injection into
the database, and then it gets messy. With TDB, there is no chance of
malicious intent to infect or infiltrate the database. TDB provides
superior syntax than the others!

So, how to we translate TDB methods into SQL/other queries seamlessly
into UPB? It is so easy, the answer is right in front of our faces:
Classes. We have one DB abstraction layer class that separates UPB
from the database. That way, you have nice clean, easy to impliment
coding, and this abstraction layer's job is to connect and query the
correct database. It's similar to Jonathan's DB abstraction class,
except my idea uses TDB syntax.

Additionally, php.net also saw the value in a database abstraction
layer, so they built their own, which should help us develop one
ourselves:
http://php.net/pdo
http://php.net/class.pdo

So tell me what you guys think. I am very excited to start this
project, but I won't go for it if we all don't go for it.

--Jerroyd

Clark

unread,
May 4, 2008, 5:43:05 AM5/4/08
to myupb-de...@googlegroups.com
Sounds like an exciting step forward.

I'll set some time aside to read and attempt to understand how PDO works.

I saw it came configured automatically with PHP5.1

We mustn't forget about the people whose hosts still have their heads up
their backsides and run PHP4

Clark

Rebles

unread,
May 4, 2008, 5:49:54 AM5/4/08
to MyUPB Developers Forum
No worries,
If you look at the commented out code on install.php, the options
aren't available if the extension isn't loaded.

But with the classes, I figure we'll need two versions of them, one
for PHP4 and another for PHP5, since they are so different.
Reply all
Reply to author
Forward
0 new messages