Databases for Free
As I mentioned earlier, there are many choices for relational databases. For the article, I confine my discussion to two: MySQL and PostgreSQL. A web search will reveal many others, including mSQL and InterBase. MySQL and PostgreSQL, however, are the primary contenders in this area.
MySQL is the more compact of the two choices, and its claim to fame is rapid read access. For that reason, MySQL has become very popular with web server applications where many reads and few writes are the norm.
MySQL has two shortcomings. First, because of a rather primitive locking scheme, as the number of writes increases, performance drops substantially. Second, MySQL did not support transactions until the current version, 3.23. This support, by the way, uses the capabilities of the Berkeley DB software from Sleepycat.
Interfaces are available for most programming languages. Many Linux distributions include MySQL, or you can go to http://www.mysql.com/ for the latest version. As of June 2000, MySQL has been available under the GNU Public License.
PostgreSQL is the most advanced open-source database system. It grew out of Dr. Michael Stonebraker's Postgres project at the University of California at Berkeley. PostgreSQL replaced the QUEL query language of Postgres with the more common (and standard) SQL.
Discussion of the advanced capabilities of PostgreSQL could easily be an article and, more likely, a complete book. Rather than try to document all of its features, let me list some of the highlights. If the previously discussed solutions don't offer all you need for your system and this list sparks your interest, you can find more information and the software itself at http://www.postgresql.org/.
Triggers--the ability to execute server-side functions for each modified row in a table.
Temporary tables--tables that exist only for the duration of a database session.
Foreign keys--the ability to constrain values in a column based on columns in other tables.
Like other databases, there are interfaces to PostgreSQL for most programming languages. Server-side functions (which extend PostgreSQL) can be written in SQL, PL/PSQL, PL/TCL, PL/Perl and C.
If your embedded application needs to store tabular data, you are talking about a database. Everything from a flat file to a relational database is on the table. When shopping for the right answer, there is more to consider than code size and reliability. In particular, think about support issues. Working with flat files is very easy, as is using the Berkeley DB routines. On the other hand, using a relational database such as MySQL or PostgreSQL introduces a lot of new code into your system, a new language and a reasonable investment of time in the role of a database administrator.
When you are developing your application, select or design an interface to the database that is flexible. In other words, make sure all the code that offers the actual interface to the database you select is small and self-contained. That way, the replacement of one database with another will not mean a major rewrite of your entire system.
Sid Wentworth prefers animals to people but also sees that computers can be his friend. He has over 20 years of experience working with computers, virtually all without involvement with Microsoft products. Sid can be reached at firstname.lastname@example.org.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Sony Settles in Linux Battle
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Profiles and RC Files
- Maru OS Brings Debian to Your Phone
- Understanding Ceph and Its Place in the Market
- Snappy Moves to New Platforms
- What's Our Next Fight?
- Git 2.9 Released
- The Giant Zero, Part 0.x
- Susan Lauber's Linux Command Line Complete Video Course (Prentice Hall)
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide