Page 232 - Kỷ yếu hội thảo khoa học lần thứ 12 - Công nghệ thông tin và Ứng dụng trong các lĩnh vực (CITA 2023)
P. 232

216


                     technologies like Flash memory are shown like the low power consumption, the fast
                     access,  and  the  long  write  endurance.  The  concept  of  "univeral  memory"  is  also
                     introduced. univeral al memory allows flexible partitioning of the memory for code and
                     data: the same type of memory can be used for both data and program storage that are
                     "traditionally" kept in separate memories: RAM for data and flash or ROM for program
                     storage.
                       SQLite[6]  is  an  in-process  library  that  implements  a  self-contained,  serverless,
                     zero-configuration,  transactional  SQL  database  engine.  Unlike  most  other  SQL
                     databases, SQLite does not have a separate server process. SQLite reads and writes
                     directly to ordinary disk files. A complete SQL database with multiple tables, indices,
                     triggers , and views, is contained in a single disk file.
                       Prior to making any changes to the database file, SQLite first creates a separate roll-
                     back journal file[7] and writes into the rollback journal the original content of the data-
                     base pages that are to be altered. The idea behind the rollback journal is that it contains
                     all information needed to restore the database back to its original state.
                       Creating rollback journal files causes a lot of flash memory operations leading to
                     reduction of overall performance of SQLite and Nand flash memory. Therefore, a new
                     solution should be proposed to address above problem. Next, section 3 will present the
                     design of the new solution.



                     3     The design and implementation of BBS


                     3.1   The design of BBS
                     This section presents a novel buffer based scheme and a hybrid storage system for
                     SQLite on flash memory using FRAM, called BBS, to efficiently store the journal file
                     when  inserting, updating  or deleting  data  from  SQLite  database.  Its  objective  is  to
                     significantly  reduce  the  overhead  of  writing  journal  file  onto  flash  memory  when
                     database is modified. In order to achieve the aforementioned goal, we deploy a hybrid
                     storage  of  FRAM  and  flash  memory  to  store  journal  file  and  data.  FRAM  has  no
                     erase-before-write feature, so it is used to store journal file while flash memory is used
                     to store data. Figure 1 shows the architecture of BBS comprising all components of a
                     traditional  androi  system,  hybrid  driver  and  a  hybrid  storage  of  FRAM  and  flash
                     memory.
                       The hybrid driver module basically manages and decides which storage medium is
                     used to write data onto. If the journal file is created or modified, hybrid driver will flush
                     data of journal file to FRAM driver. On the other hand, the modified data will be flushed
                     to flash memory driver. FRAM driver and flash memory driver manage and write data
                     to FRAM and flash memory according to their policies.
                       FRAM is used in company with flash memory to improve the overall performance
                     of SQLite on Android smart phone system. Since data can be overwritten on FRAM, it
                     is able to avoid the limitation of erase-before-write of flash memory. Whenever journal
                     file is created, BBS writes the journal file onto FRAM instead of flash memory that the
                     conventional android systems do. This lead to a significant reduction of overhead of






                     CITA 2023                                                   ISBN: 978-604-80-8083-9
   227   228   229   230   231   232   233   234   235   236   237