Skip to content

rn2dy/DBEngine525

Repository files navigation

This a C++ Database Engine implementation. Some clever ideas are used to make the whole software easier to create which is the most valuable thing I learned during the work.

Please read the Makefile to see the dependencies of the project, and see how to compile. If you are interested in looking at how I did it, here is a brief introduction of the code structure of the database:

Main program
	(Please read main.c)
    - A while loop with ability to persistent data on exist, benchmark on
      each query
    - You can also supply buffer size to the program

Query Parser 
	(Please read parser.h)
	- This is the part that validates the input queries.
    - This is the part that parse input query string into well-defined data
      structures.

Catalog
	(Please read catalog.h)
	- It is always helpful to store some META data about a table in a 
	  place called catalog, e.g. Summary.
    - It is heavily used to format the input data (get index attr, etc) 

Buffer Management
	(Please read buffer.h)
	- Define BLOCK_SIZE in bytes to be each buffer size
    - Use LRU algorithm to decide who should be kicked off and 
	  who should be swap in
    - Each buffer corresponds to a block in disk. (use block_num) 

File Management
    (Please read file.h)
	- Retrieve block by block_number	
    - Transfer data from buffer to disk, vice versa.

Indexing B+ Tree
    (Please read bplustree.h)
    - This is how I do indexing, data are indexed by inserting nodes to 
      B+ tree, each index has its own file.
    - Duplicate mode(allow duplicate data) and none-duplicate mode
    - It only support insertion now!  


/********** TESTING ************/
Functional Test
	- The unit tests are done on the fly. I used printing MACRO's to do all the debugging ( see debug.h), I didn't use any *unit frameworks.

Non-Functional Test
	- Performance Test
		(Please read the files in directory research/)
        - I used Unix Shell script for benchmarking over a base dataset of 
          10,000 records for each table
       	- The performance of indexing is especially inspected, it is fun!


!!!  Reports/Statistics

     I have very detailed performance report in .doc format that is generated by the tests. If you want to see it, please send me an inquiry email.

     Qiang Han <qjavaswing2009@gmail.com>
	
	 If you are interested in discussing the project email me also. 

	 Enjoy!

By BaboonWorksFine (Qiang Han) 2011/Spring

About

A toy database engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages