473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

serverless postgres, embedded firebird, etc.

Tom,

Actually, I've never had a corrupted firebird database. There were
two bugs in an older version of InterBase that produced income for me.
The first was a failure to realize that a file had just gone over 4Gb
and therefore the word holding the offset had rolled over and the system
had begun writing at the beginning of the file. Nasty. The second was
a case that allowed a server to open a single database twice, thinking
it was two different databases. That lead to doubly allocated pages
which lead to wrong page types, etc. Both problems were fixed before
the first version of firebird shipped.

On the larger question of embedded database code, yes, there is
certainly the possibility of user data overwriting database data
structures, accidentally or intentionally. The intentional part is a
question for the builders and users of the application. Only trusted
programs should ever run with an embedded engine. The accidental part
rarely, if ever corrupts a database for two reasons.

First, there's quite a lot of checking internally. A trashed data
structure is recognized quickly and shuts down the connection without
writing anything. Reestablishing the connection creates an entirely new
set of internal structures, disposing of the corruption.

Second, the database is always (in almost all circumstances)
consistent, even if uncommitted data must be written. Our goal, from
the beginning, was to allow the database to restart instantly from a
crash caused by tripping over the power cord of the server. It works,
except in one actual and one theoretic case.

We offer an asynchronous write mode because flushing files on Unix
systems is too expensive. (The system was originally written for VMS,
which didn't have a page cache.) On Unix systems, the careful write is
almost always successful enough even asynchronously because pages
aren't kept in the system cache for long. That's the theoretic case.
The actual case is on windows which, by default, keeps pages in cache
until process shutdown. Pulling the plug on a windows system that's
using asynchronous writes is the actual problem.

Fortunately, people have learned not to run power cords from their
servers across corridors and such, so the "tripped over the power cord"
problem is much reduced from years past. However, in areas with
frequent power failures, there are occasional broken databases caused by
pages that were in the cache and not written. Generally, that happens
in less developed countries where the cost of a UPS is significant.
Needless to say, the cost of having me repair the database is also
significant. Often, after the user pleads and grovels on the subject of
not having a UPS or a database backup, I fix those for free. Harrison's
campaign for world harmony. Don't tell my boss.

Firebird and InterBase have been used in "embedded" mode since 1985
and don't seem to corrupt data except in the cases described above. The
next version of Firebird also forces Windows to flush its cache
regularly, which should be a boon for our Latin American users.

Best regards,

Ann
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 22 '05 #1
0 3773

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

59
by: Jeff Bowden | last post by:
For ease of configuration and other reasons, I would like for my single-user GUI app to be able to use postgresql in-process as a library accessing a database created in the users home directory. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.