Giter Club home page Giter Club logo

bigdataproj's Introduction

BigdataProj

KV Nosql数据库,支持CRUD,数据落盘,ACID特性,可并发执行

如何并发执行?

上一个总锁,对kv的修改和trans同时只能进行一个,只有获得锁的client才能对kv进行操作。 由client维护交易状态,保证一个client只能同时进行一个交易。

如何满足ACID特性?

利用Trans锁,保证同时只能有一个交易进行操作。 因为不会有任何掉电的操作,只需在内存里维护一个操作日志记录,当发现ABORT,就逐条回退记录即可。 只有Trans才需要日志记录。

如何落盘?

每进行一个操作,就进行一次落盘,保证每个时刻内存数据和磁盘数据的一致

落盘文件格式

key_mapping.db

4 key_count
8 + L 
    L key 
    4 start_byte 
    4 del_flag
... ... ...

记录key在数据文件的第几字节开始(每个value是4个字节),32个bit。 del_flag为0表示未被删除,为1表示已被删除。

data.db

data1 data2 ...

记录了每个value的值。被删除的key的值没有意义。

bigdataproj's People

Contributors

wxr1998 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.