Re: how does one trap for out-of-memory errors?
nc@iname.com (Nikolai Chuvakhin) wrote in message[color=blue][color=green]
> > I am not hell bent. I asked for alternatives.[/color]
>
> I think looking for an altermative in your situation was the right
> thing to do. Note also that you didn't have a compelling reason
> to do it "your" way in the first place; at least, my question to
> that extent:
>[color=green][color=darkred]
> > > But let me ask you: what will the application do
> > > with a PHP array that contains all entries in the weblog? Output
> > > them? Then the entries don't have to be in memory at all, they
> > > can be output straight from the DB buffer. Sort them? Again,
> > > they don't have to be in the memory for that, you should have
> > > taken care of it on the database level. Search through them?
> > > Same thing; too late to do it efficiently, had to be done on the
> > > database level.[/color][/color]
>
> went unanswered...[/color]
I'm not sure what you mean when you say I didn't answer your question.
I explained that I was trying to hide the database from the client
code. Putting the database return into a PHP array had been my answer
to that. You can, and have, argued that it is the wrong answer, but I
certainly answered your question about what it was that I was trying
to accomplish.
[color=blue][color=green]
> > Well, this code is being written first to work with MySql, but I'm
> > supposed to write it in such a way that would make it easy to switch
> > to PostGre.[/color]
>
> This is yet another reason why database abstraction layers are
> such a bad idea... PostgreSQL has a whole slew of features
> that are not available in MySQL: views, rules, triggers, stored
> procedures, etc. Database abstraction forces you to stick to
> the lowest common denominator, which robs you of opportunities
> to use the more advanced, higher-performance features...[/color]
Engineering of any kind is often about goals and tradeoffs.
Programmers would, in general, be delighted if, by magic, there was
some way to both take advantage of all the features of any database
and yet also easily port software from one database to another.
However, there is no easy way to achieve both these goals, so one
generally has to choose one. Either software can take advantage of the
special features of one piece of software, or it can be easily ported
from one database to another.
In our case, portability trumps advanced feature use. For another
project the opposite decision might be a wise one.
nc@iname.com (Nikolai Chuvakhin) wrote in message[color=blue][color=green]
> > I am not hell bent. I asked for alternatives.[/color]
>
> I think looking for an altermative in your situation was the right
> thing to do. Note also that you didn't have a compelling reason
> to do it "your" way in the first place; at least, my question to
> that extent:
>[color=green][color=darkred]
> > > But let me ask you: what will the application do
> > > with a PHP array that contains all entries in the weblog? Output
> > > them? Then the entries don't have to be in memory at all, they
> > > can be output straight from the DB buffer. Sort them? Again,
> > > they don't have to be in the memory for that, you should have
> > > taken care of it on the database level. Search through them?
> > > Same thing; too late to do it efficiently, had to be done on the
> > > database level.[/color][/color]
>
> went unanswered...[/color]
I'm not sure what you mean when you say I didn't answer your question.
I explained that I was trying to hide the database from the client
code. Putting the database return into a PHP array had been my answer
to that. You can, and have, argued that it is the wrong answer, but I
certainly answered your question about what it was that I was trying
to accomplish.
[color=blue][color=green]
> > Well, this code is being written first to work with MySql, but I'm
> > supposed to write it in such a way that would make it easy to switch
> > to PostGre.[/color]
>
> This is yet another reason why database abstraction layers are
> such a bad idea... PostgreSQL has a whole slew of features
> that are not available in MySQL: views, rules, triggers, stored
> procedures, etc. Database abstraction forces you to stick to
> the lowest common denominator, which robs you of opportunities
> to use the more advanced, higher-performance features...[/color]
Engineering of any kind is often about goals and tradeoffs.
Programmers would, in general, be delighted if, by magic, there was
some way to both take advantage of all the features of any database
and yet also easily port software from one database to another.
However, there is no easy way to achieve both these goals, so one
generally has to choose one. Either software can take advantage of the
special features of one piece of software, or it can be easily ported
from one database to another.
In our case, portability trumps advanced feature use. For another
project the opposite decision might be a wise one.
Comment