MySQL Blackhole Engine

Поиск
Список
Период
Сортировка
Искать

MySQL Blackhole Engine

От:
Deron <fecastle@gmail.com>
Дата:
Hello,

We are looking at integrating a 3rd party application.  They currently use MySQL for their database solution.  We are asking them to see about porting to PostgreSQL.   One of the issues they are running into is that they use MySQL "BLACKHOLE" storage engine.

I don't honestly know what this is used for.   Of course I did know what /dev/null was used for until I started using it.   So maybe this has some merit?  Is there some sort of equivelent structure in PG?


Thanks,

Deron

Re: MySQL Blackhole Engine

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Deron  writes:
> We are looking at integrating a 3rd party application.  They currently use
> MySQL for their database solution.  We are asking them to see about porting
> to PostgreSQL.   One of the issues they are running into is that they use
> MySQL "BLACKHOLE" storage engine.

Really?  I've always assumed that was utterly useless except as a
template for writing new mysql storage engines.  What are they using it
for?

You could presumably approximate the behavior by attaching a BEFORE
INSERT trigger to a table that just always returns NULL.

			regards, tom lane

Re: MySQL Blackhole Engine

От:
Sergey Konoplev <gray.ru@gmail.com>
Дата:
On Tue, Nov 6, 2012 at 3:07 PM, Deron  wrote:
> We are looking at integrating a 3rd party application.  They currently use
> MySQL for their database solution.  We are asking them to see about porting
> to PostgreSQL.   One of the issues they are running into is that they use
> MySQL "BLACKHOLE" storage engine.
>
> I don't honestly know what this is used for.   Of course I did know what
> /dev/null was used for until I started using it.   So maybe this has some
> merit?  Is there some sort of equivelent structure in PG?

You can create a row-level BEFORE INSERT trigger on a table that does
nothing but RETURN NULL. In this case all the inserts into this table
will be ignored.

>
> http://dev.mysql.com/doc/refman/5.0/en/blackhole-storage-engine.html
>
> Thanks,
>
> Deron



--
Sergey Konoplev

a database and software architect
http://www.linkedin.com/in/grayhemp

Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +14158679984

Re: MySQL Blackhole Engine

От:
Simon Riggs <simon@2ndQuadrant.com>
Дата:
On 6 November 2012 23:25, Tom Lane  wrote:
> Deron  writes:
>> We are looking at integrating a 3rd party application.  They currently use
>> MySQL for their database solution.  We are asking them to see about porting
>> to PostgreSQL.   One of the issues they are running into is that they use
>> MySQL "BLACKHOLE" storage engine.
>
> Really?  I've always assumed that was utterly useless except as a
> template for writing new mysql storage engines.  What are they using it
> for?

I had also assumed that they were useless.

The docs say that the actions are binary logged, but the actual INSERT ignored.

Which is exactly what Hannu is asking for with LOG ONLY TABLEs.

-- 
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Re: MySQL Blackhole Engine

От:
Deron <fecastle@gmail.com>
Дата:
Yes,  I can't really find a good use case for it.   I am meeting with some of them in the next few days to find out exactly what they are using it for.  If there is a legitimate use case for this, I will forward that information.

Thanks for the suggestions.  I will pass this information along as well if they really need the behavior.

Deron



On Tue, Nov 6, 2012 at 3:25 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Deron <fecastle@gmail.com> writes:
> We are looking at integrating a 3rd party application.  They currently use
> MySQL for their database solution.  We are asking them to see about porting
> to PostgreSQL.   One of the issues they are running into is that they use
> MySQL "BLACKHOLE" storage engine.

Really?  I've always assumed that was utterly useless except as a
template for writing new mysql storage engines.  What are they using it
for?

You could presumably approximate the behavior by attaching a BEFORE
INSERT trigger to a table that just always returns NULL.

                        regards, tom lane

Re: MySQL Blackhole Engine

От:
Scott Ribe <scott_ribe@elevated-dev.com>
Дата:
On Nov 6, 2012, at 4:56 PM, Deron wrote:

> Yes,  I can't really find a good use case for it.   I am meeting with some of them in the next few days to find out exactly what they are using it for.  If there is a legitimate use case for this, I will forward that information.
> 
> Thanks for the suggestions.  I will pass this information along as well if they really need the behavior.

From the docs, half a page down:

Inserts into a BLACKHOLE table do not store any data, but if the binary log is enabled, the SQL statements are logged (and replicated to slave servers). This can be useful as a repeater or filter mechanism. Suppose that your application requires slave-side filtering rules, but transferring all binary log data to the slave first results in too much traffic. In such a case, it is possible to set up on the master host a “dummy” slave process whose default storage engine is BLACKHOLE


-- 
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





FAQ