Berkeley DB Reference Guide:
Programmer Notes

PrevRefNext

RAM-only configurations

Berkeley DB supports RAM-only configurations, however, Berkeley DB does not guarantee writes will never be attempted to disk.

(¹öŬ¸® µðºñ´Â ·¥ µðºñ¸¦ Áö¿øÇÑ´Ù.)

You can configure RAM-only databases by not specifying a physical file name to the DB->open method. Databases created in this way will never be written to disk unless Berkeley DB runs out of cache space. Running out of cache space happens when the application attempts to create a new database page and there is no spare room in the cache, nor is there a clean page which can simply be evicted from the cache, and a dirty page must be written from the cache to disk to make room to create the new page. When Berkeley DB runs out of cache space, it will attempt to create a temporary backing file to make new room in the cache, which is not what you want.

(·¥ µðºñ¸¦  DB->open ¸Þ¼ÒµåÀÇ ¹°¸®Àû ÆÄÀÏ À̸§À» ÁÖÁö ¾ÊÀ½À¸·Î½á ¼³Á¤ÇÒ ¼ö ÀÕ´Ù.Äɽð¡ Â÷±â Àü±îÁö´Â ·¥µðºñ´Â µð½ºÅ©¿¡ ½áÁöÁö ¾Ê´Â´Ù.ij½Ã¸¦ ³Ñ¾î¼­´Â°ÍÀº ¾ÖÇø®ÄÉÀ̼ÇÀÌ »õ·Î¿î µðºñÆäÀÌÁö »ý¼ºÀ» ½ÃµµÇÒ¶§ Äɽÿ¡ °ø°£ÀÌ ¾øÀ»¶§ ¹ß»ýÇÑ´Ù.±×¸®°í dirtyÆäÀÌÁö´Â »õ·Î¿î ÆäÀÌÁö»ý¼ºÀ» À§ÇÑ °ø°£À» ¸¸µé±â À§ÇØ Äɽ÷κÎÅÍ µð½ºÅ©¿¡ ½áÁ®¾ß ÇÑ´Ù.¹öŬ¸®µðºñ°¡ Äɽðø°£À» ³Ñ¾î¼³¶§ ÀÌ°ÍÀº Àӽà ij½Ã¿¡ »õ·Î¿î °ø°£À» ¸¸µé±â À§ÇØ Àӽà ¹éÅ·ÆÄÀÏÀ» »ý¼ºÇÑ´Ù.ÀÌ°ÍÀº ¿©·¯ºÐÀÌ ¿øÇÏÁö ¾Ê¾Ò´ø °ÍÀÌ´Ù. )

You can create RAM-only database environments (in which you can work with both RAM-only and disk-backed databases) in two different types of memory: in heap memory or in system shared memory. To create the database environment in heap memory, specify the DB_PRIVATE flag to the DB_ENV->open method. Database environments created in heap memory are only accessible to the threads of a single process, however. To create the database environment in system shared memory, specify the DB_SYSTEM_MEM flag to the DB_ENV->open method. Database environments created in system memory are accessible to multiple processes. However, database environments created in system shared memory do create a small (roughly 8 byte) file in the file system read by the processes to identify the system shared memory segments to use.

(·¥µðºñ ȯ°æ(ÀÌȯ°æ¾È¿¡¼­ ·¥ µðºñ,µð½ºÅ© ¹éÅ· µðºñ°¡ ÀÛµ¿)Àº ¸Þ¸ð¸®ÀÇ µÎ°³ÀÇ ´Ù¸¥Å¸ÀÔ°ú µ¿ÀÛÇÒ ¼ö ÀÖ´Ù: Èü°ú ½Ã½ºÅÛ °øÀ¯¸Þ¸ð¸®.µðºñȯ°æÀ» Èü¿¡ »ý¼ºÇϱâ À§Çؼ­´Â DB_ENV->open ( DB_PRIVATE flag )¸¦ ¼³Á¤ÇÑ´Ù.»ý¼ºµÈ µðºñȯ°æÀº ½Ì±Û ÇÁ·Î¼¼½ºÀÇ ½º·¹µå¿¡ ÀÇÇØ ¿ÀÁ÷ Á¢±Ù°¡´ÉÇÏ´Ù.±×·¯³ª ½Ã½ºÅÛ °øÀ¯¸Þ¸ð¸®¿¡ µðºñȯ°æÀ» ¸¸µé±â À§Çؼ­´Â DB_ENV->open(DB_ENV->open)À» ¼³Á¤ÇÑ´Ù.½Ã½ºÅÛ°øÀ¯¸Þ¸ð¸®¿¡ »ý¼ºµÈ µðºñȯ°æÀº ¸ÖƼ ÇÁ·Î¼¼½º¿¡ ÀÇÇØ Á¢±Ù°¡´ÉÇÏ´Ù.±×·¯³ª ÀÌ°ÍÀº »ç¿ëµÇ´Â ½Ã½ºÅÛ °øÀ¯ ¸Þ¸ð¸®¼¼±×¸ÕÆ®¸¦ ±¸º°Çϱâ À§ÇØ ÇÁ·Î¼¼½º¿¡ ÀÇÇØ ÀоîµéÀÌ´Â 8¹ÙÀÌÆ®ÀÇ ÀÛÀº ÆÄÀÏÀ» ÆÄÀϽýºÅÛ¿¡ »ý¼ºÇÑ´Ù.)

¡¡

Finally, if your database environment is intended to be transactionally protected or recoverable after application or system failure (that is, if you configure either the locking or transaction subsystems in the database environment), both the databases and database environment log files must be written to disk. There is currently no way in the Berkeley DB database environment to support transactions without writing log files to disk.

(¸¶Áö¸·À¸·Î ¸¸¾à µðºñȯ°æÀÌ Æ®·¢Àè¼ÇÀ¸·Î º¸È£µÇ¾î¾ß Çϰųª ¾ÖÇø®ÄÉÀ̼ǶǴ ½Ã½ºÅÛ ½ÇÆÐÈÄ¿¡ º¹±¸¸¦ ¿øÇÑ´Ù¸é(Áï ¶ôÀ̳ª Æ®·¢Á§¼ÇÀ» °É¾ú´Ù¸é) µðºñ¿Í µðºñȯ°æ·Î±×ÆÄÀÏÀº µð½ºÅ©¿¡ ½áÁ®¾ß ÇÑ´Ù.µð½ºÅ©¿¡ ÆÄÀÏÀ» ¾²´Â°Í ¿Ü¿¡´Â ÇöÀç Æ®·£Á§¼ÇÀ» Áö¿øÇÏ´Â ´Ù¸¥ ¹æ¹ýÀº ¾ø´Ù.)

¡¡


PrevRefNext

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.