2 Replies - 3487 Views - Last Post: 30 November 2012 - 11:55 PM Rate Topic: ****- 1 Votes

#1 btjordan23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-November 12

Database Engine Design

Posted 24 November 2012 - 11:02 AM

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:

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Database Engine Design

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5677
  • View blog
  • Posts: 12,209
  • Joined: 02-June 10

Re: Database Engine Design

Posted 24 November 2012 - 01:09 PM

Quote

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.


Instead of trying to simulate a database with a bunch of files, why don't you use an actual database? Visual Studio will let you build a real database internally... or you can use SQL... MySql has a .NET connector...

From my FAQ list:

Q:... how to do x,y,z with a database {probably for the first time}...
A: Read this tutorial
Entire section of tutorials
Parameterizing Your SQL Queries: The RIGHT Way To Query A Database.
Using SqlDependency to monitor SQL database changes
Was This Post Helpful? 0
  • +
  • -

#3 _HAWK_  Icon User is online

  • Master(Of Foo)
  • member icon

Reputation: 1067
  • View blog
  • Posts: 4,175
  • Joined: 02-July 08

Re: Database Engine Design

Posted 30 November 2012 - 11:55 PM

XML would make a simple database design.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1