如何写一个简单的数据库引擎 [英] How to write a simple database engine

查看:123
本文介绍了如何写一个简单的数据库引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣了解数据库引擎是如何工作的(即它的内部)。我知道CS(树,哈希表,列表等)中教授的大多数基本数据结构以及对编译器理论的很好理解(并且实现了一个非常简单的解释器),但我不明白如何去关于编写数据库引擎。我已经搜索关于这个问题的教程,我找不到任何,所以我希望别人可以指出我的方向正确。基本上,我想了解以下信息:

I am interested in learning how a database engine works (i.e. the internals of it). I know most of the basic data structures taught in CS (trees, hash tables, lists, etc.) as well as a pretty good understanding of compiler theory (and have implemented a very simple interpreter) but I don't understand how to go about writing a database engine. I have searched for tutorials on the subject and I couldn't find any, so I am hoping someone else can point me in the right direction. Basically, I would like information on the following:


  • 数据如何在内部存储(即表格的表示方式等) li>
  • 引擎如何查找所需的数据(例如运行SELECT查询)

  • 如何以快速高效的方式插入数据

以及可能与此相关的任何其他主题。它不必是一个磁盘数据库 - 即使一个内存数据库也不错(如果更容易),因为我只是想了解它的原理。

And any other topics that may be relevant to this. It doesn't have to be an on-disk database - even an in-memory database is fine (if it is easier) because I just want to learn the principals behind it.

非常感谢您的帮助。

推荐答案

如果你善于阅读代码,学习SQLite会教你一个整体关于数据库设计的负载。它很小,所以更容易缠绕你的头。但它也是专业写的。

If you're good at reading code, studying SQLite will teach you a whole boatload about database design. It's small, so it's easier to wrap your head around. But it's also professionally written.

http://sqlite.org/

这篇关于如何写一个简单的数据库引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆