You often read "ISAM" in newsletters and other communications from Alaska Software. And many people have heard it or know it from the inside out, but someonly have a vague idea of what it means. If you belong to this group, then it's worth reading this short article.

The good news first: if you have come to Xbase++ from Clipper or VFP, then you already know ISAM without even thinking about it. You use it as a matter of course.

So, what does it mean?

Below you will find a technical description of ISAM, supplemented by a commentary from us in Italic and the associated features of Xbase++.

ISAM stands for "Indexed Sequential Access Method". It is a data access method used in databases (DBF, DBT, ADT, ...) and file systems (the physical files) to efficiently access records or data. Here is a brief explanation of how ISAM works:
  1. Indexing: ISAM organizes data using an index structure. This index contains pointers or references to the records stored in the file. The index is usually sorted to enable efficient searches and queries.
    Xbase++: this includes procedures and functions such as SET INDEX ON, SET ORDER TO, dbSetOrder(), ... in calls to find or display data in the order you need it. Xbase++ manages these sorts for new data records or changes.

  2. Sequential Access: ISAM enables both sequential and direct access to data records. With sequential access, data records are read or written in the order in which they are stored in the file. Direct access enables access to specific data records based on their position in the index.
    Xbase++: sequential access is the opening of a table/DBF without an index/sorting, i.e. the order in which the data is entered. This includes concepts such as managing a record number, RecNo(), dbGoto(), dbGoTop(), dbGoBottom(), ... Depending on your requirements, you can navigate through the dataset in the natural, saved order or in a sorted order defined by you, the index expression you have specified.

  3. Efficiency: ISAM is designed to provide efficient access to data, especially for applications that require frequent search and retrieval operations. By maintaining a sorted index, ISAM minimizes the number of disk accesses required to find a particular record.
    Xbase++: as an example, I would like to cite an international customer table that has an index on a Country field. The index is active (SET ORDER TO country), you search for a specific country ES (SEEK "ES") and then you navigate through the table as long as the content of the field country is "ES" or the end of the table is reached (DO WHILE country = "ES" or EOF() ... do something ... SKIP ...). By creating the index, you have efficient access to your data without having to search through all data records from start to finish.

  4. Data Integrity: ISAM ensures data isolation by using techniques such as locking mechanisms to prevent simultaneous access to the same data by multiple users and thus avoid inconsistencies or data corruption.
    Xbase++: so that you can change a data record or add a new data record in a SHARED environment, secure these changes with RLock(), DbRLock(), UNLOCK, .... This procedure ensures data integrity. This guarantees that indexes are properly maintained and that data is not "broken".
Overall, ISAM provides a balance between efficient data access and complexity of data management and is therefore suitable for various applications where fast access to structured data is required. Today this is sometimes called NoSQL.

Do you know all this down to the last detail? Of course, you do! So you are an experienced ISAM programmer.

And what use is this knowledge? This knowledge of efficiency and data integrity, coupled with the knowledge of the business processes you have implemented with it, is the knowledge you have gained over the years, which is contained in your applications and makes your application unique.

Looking into a future with Xbase++: ISAM is therefore the building block to SQL. With ISAM, you must take care of every detail: Indexing, choosing sort order, record locks, navigating from one record to the next, and much more. With SQL, much of this does not exist. For example, there are no record numbers/recno(). No locking is required. SQL is set-oriented, it is not about individual data records. Xbase++ combines both worlds.

With the ISAM emulation of the PGDBE of Xbase++, you no longer need to manage your data in DBF files on a file system, but with a PostgreSQL server. With the same commands that you have used up to now with DBF tables. PGDBE can therefore execute your previous ISAM data access and manipulation code on a PostgreSQL server. This is the first step towards a modern database management system (DBMS) for your existing applications. And if you even familiarize yourself with SQL - because that certainly makes sense for some implementations of your application - then you can use the best of both worlds as required: ISAM .OR. SQL, but both on a state-of-the-art SQL server.
  • Like
Reactions: Osvaldo Ramirez