Subject Re: generate report for POS
Author Adam
--- In firebird-support@yahoogroups.com, bill_lam <bill_lam@...> wrote:
>
> Adam wrote:
> > MGA makes this possible. Readers don't block writers and writers don't
>
> What is MGA?

Multi-generational architecture.
(Some other databases have called the same thing MVCC)

In a nutshell, updates and deletes leave the old data of a record in
the database. When no transaction is interested in that old data any
more, the garbage collection marks the space taken up by the old data
as available to be reused. In practical terms, when running your
report, Firebird will ignore changes that were made after your
transaction started. As far as your report can see, the database has
not changed one bit from when the transaction started, so you can
generate meaningful reports.

There are other advantages to the Firebird implementation, such as
immediate recovery from a failure (no transaction logs to undo to get
a consistent state).

Firebird started from the Interbase 6 betas, so it shares this
property with Interbase, and information regarding MGA from Interbase
is largely the same for Firebird. The latest version of SQLServer has
only just introduced the capability.

The following article is helpful (they call MGA 'versioning')
http://www.dbginc.com/tech_pprs/IB.html

The following article explains more:
http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_expert5

You need to understand that 'dirty reads' are NOT a good thing. They
are actually a band aid work around for databases that use a locking
architecture, so that it is actually possible to run reports and do
hot backups without stopping your POS from collecting transactions.

IBDeveloper Magazine (issue 3/2005) also has an article that compared
working with SQL Server and FB/IB. Where the author was curious how
some popular accounting software handled the tradeoff between locking
a lot of records to do a report without preventing new records, and
dirty reads was the method used, also worth a read.

http://ibdeveloper.com/issues/issue-3-dec-6/

Adam