ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Difference between FEOD and FEOD(N)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Difference between FEOD and FEOD(N)

    Per title, what's the difference? The explanation of (N) here explains how I thought FEOD works? My understand was that it forces records to disk?

    Also: are updates blocked? Or is it just writes?

  • #2
    The difference is whether it is physically forced to disk or simply handed off to the operating system.

    The original FEOD causes RPG to wait until the system confirms that the data has actually been written to disk.

    The (N) extender changes that so that RPG only waits until the system says "got it". "got it" means that the system ensures that any other attempt to read that data, from another program for example, will succeed and see the updated information. Subsequently the data will be actually committed to disk as and when the system has "spare" time to catch up on housekeeping.

    The performance difference between the two can be huge. I guess if there is a complete system failure then the data might not make it to disk - but then neither will other data that was just "lying around".

    Comment


    • #3
      If your disk cache batteries aren't working, you're not on a UPS, and you have a power failure immediately after FEOD, the data will have been written properly to disk. With FEOD(N), it will not have been... (though, it still will be if your disk cache batteries work properly.)

      FEOD(N) performs much, much better because writing to cache is much more efficient than forcing it to physical disks. (and is what everything else does)

      Aside from that, they do exactly the same thing.

      I personally would recommend always using FEOD(N).

      Comment


      • #4
        Thanks for the responses.

        Just to make sure I'm understanding it correctly;
        FEOD - writes the records to storage immediately, the program will wait until this is complete before moving on which naturally impact performances fairly significantly
        FEOD(N) - makes the data available to other programs/jobs but won't force it to disk immediately, kind of a halfway house between blocking and FEOD, significant performance improvements over FEOD



        What about updates? Are the changes done immediate or are they blocked also?


        Cheers,
        R

        Comment


        • #5
          You understand correctly. Updates, writes, and deletes for that matter will all be transparent to applications. Only a system failure can result in a difference in the data that is ultimately stored and even then, as Scott notes, the cache has probably got the correct data. The original FEOD and a force ratio of 1 are in some ways a legacy from the days when there was no cache, no UPS, no nothing to alleviate the risk of data not being on diska and therefore available to other apps.

          Comment


          • #6
            Thanks to you both, very helpful as always!

            Comment

            Working...
            X