I am going to be designing a database engine for a project. I am starting out with the design and am looking for some help with some pseudo code or something to help me better understand the best way to implement code when the time comes. Again not looking for any coding help just help with designing the engine. Below are the methods I will be using:
I am thinking I would like to design this in a way that stores a folder (DB) on the main drive (C:/) and each file within that folder will be my tables and indexes. Thanks again for any help, I really appreciate and look forward to your responses.
Quote:
DB Methods: Static void createDB(String dbName): static void deleteDB(String dbName): static Database openDB(String dbName) void closeDB() Table createTable(String tableName, long recordSize): Table getTable(String tableName) void deleteTable(String tableName) Index createIndex(String indexName) Index getIndex(String indexName) void deleteIndex(String indexName) Table methods: long getRecordSize() long addRecord(byte[] record) void removeRecord(long primaryKey) byte[] getRecord(long primaryKey) void updateRecord(long primaryKey, byte[] record) void close() Index methods: Void addKey(String key, long value) IteratorgetValues(String startKey, String endKey) long deleteKey(String key) void updateKey(String key, long value) void close() |
I am thinking I would like to design this in a way that stores a folder (DB) on the main drive (C:/) and each file within that folder will be my tables and indexes. Thanks again for any help, I really appreciate and look forward to your responses.