tailieunhanh - Practical mod_perl-CHAPTER 17:Databases Overview

Tham khảo tài liệu 'practical mod_perl-chapter 17:databases overview', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Page 543 Thursday November 18 2004 12 44 PM CHAPTER 17 Databases Overview What s a database We can use pretty much anything as a database as long as it allows us to store our data and retrieve it later. There are many different kinds of databases. Some allow us to store data and retrieve it years later others are capable of preserving data only while there is an electricity supply. Some databases are designed for fast searches others for fast insertions. Some databases are very easy to use while some are very complicated you may even have to learn a whole language to know how to operate them . There are also large price differences. When we choose a database for our application we first need to define the requirements in detail this is known as a specification . If the application is for short-term use we probably aren t going to use an expensive advanced database. A quick-and-dirty hack may do. If on the other hand we design a system for long-term use it makes sense to take the time to find the ideal database implementation. Databases can be of two kinds volatile and non-volatile. These two concepts pretty much relate to the two kinds of computer memory RAM-style memory which usually loses all its contents when the electricity supply is cut off and magnetic or optical memory such as hard disks and compact discs which can retain the information even without power. Volatile Databases We use volatile databases all the time even if we don t think about them as real databases. These databases are usually just part of the programs we run. In-Memory Databases in a Single Process If for example we want to store the number of Perl objects that exist in our program s data we can use a variable as a volatile database package Book ObjectCounter use strict 543 Page 544 Thursday November 18 2004 12 44 PM my object_count 0 sub new my class shift object_count return bless class sub DESTROY object_count-- In this example object_count serves as a database it

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.