{"id":13471577,"url":"https://github.com/vanilladb/vanillacore","last_synced_at":"2025-04-07T07:08:36.771Z","repository":{"id":39628196,"uuid":"61269853","full_name":"vanilladb/vanillacore","owner":"vanilladb","description":"The core engine of VanillaDB","archived":false,"fork":false,"pushed_at":"2023-06-26T06:10:53.000Z","size":1498,"stargazers_count":196,"open_issues_count":6,"forks_count":41,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T05:07:19.280Z","etag":null,"topics":["databases","rdms","sql"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanilladb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-06-16T07:01:25.000Z","updated_at":"2025-02-27T09:52:32.000Z","dependencies_parsed_at":"2023-01-23T04:30:32.828Z","dependency_job_id":"e2b13f8e-1eb7-4f52-8b9b-d321e04f1ff6","html_url":"https://github.com/vanilladb/vanillacore","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilladb%2Fvanillacore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilladb%2Fvanillacore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilladb%2Fvanillacore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanilladb%2Fvanillacore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanilladb","download_url":"https://codeload.github.com/vanilladb/vanillacore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["databases","rdms","sql"],"created_at":"2024-07-31T16:00:46.860Z","updated_at":"2025-04-07T07:08:36.741Z","avatar_url":"https://github.com/vanilladb.png","language":"Java","funding_links":[],"categories":["Java","数据库"],"sub_categories":[],"readme":"﻿# VanillaCore\r\n\r\n[![Build Status](https://travis-ci.org/vanilladb/vanillacore.svg?branch=master)](https://travis-ci.org/vanilladb/vanillacore)\r\n[![Apache 2.0 License](https://img.shields.io/badge/license-apache%202.0-orange.svg)](https://www.apache.org/licenses/LICENSE-2.0)\r\n[![Maven Central](https://img.shields.io/maven-central/v/org.vanilladb/core.svg)](https://maven-badges.herokuapp.com/maven-central/org.vanilladb/core)\r\n\r\nVanillaCore is a single node, multi-threaded relational database engine that partially supports the SQL-92 standard and offers connectivity via JDBC, embedding, or (Java-based) stored procedures.\r\n\r\n## Required Tools\r\n\r\nYou will need the following tools to compile and run this project:\r\n\r\n- Java Development Kit 1.7 (or newer)\r\n- Maven\r\n\r\n## Getting Started\r\n\r\nThis tutorial will teach you how to start up a database server and interact with it.\r\n\r\n### Compiling the source and package them to a jar\r\n\r\nThis project is a maven project. You can compile the source and package the classes to a jar file via a single command using Maven:\r\n\r\n(Note that this command also triggers testing phase, which will run all test cases in this project. You can skip testing phase using the next command.)\r\n\r\n```\r\n\u003e mvn package\r\n```\r\n\r\nRunning the test cases may take very long time (about 3 minutes in our case). If you want to skip the testing phase, use the this command instead:\r\n\r\n```\r\n\u003e mvn package -Dmaven.test.skip=true\r\n```\r\n\r\nThe jar file will be named as `core-0.7.0.jar` and in the `target` folder of the project.\r\n\r\n### Starting up a VanillaCore server\r\n\r\nTo start up a VanillaCore server, use the following command:\r\n\r\n(Please replace `{DB Name}` with **your database name**, which will be the name of the folder of your database files)\r\n\r\n```\r\n\u003e java -classpath core-0.7.0.jar org.vanilladb.core.server.StartUp {DB Name}\r\n```\r\n\r\nIf it works correctly, you should see `database server ready` like this:\r\n\r\n```\r\nAug 09, 2016 3:27:55 PM org.vanilladb.core.server.StartUp main\r\nINFO: database server ready\r\n```\r\n\r\nAfter starting up, VanillaCore creates a directory named as `{DB Name}` for the databases under your home directory (which is `C:/Users/{Your Username}` in Windows, `/home/{Your Username}` in Mac or most Linux distribution).\r\n\r\n### Using SQL Interpreter\r\n\r\nLet’s try to connect to your database server.\r\n\r\nThe server provides a JDBC interface, which you can connect to with any JDBC client. Or, you can use our simple interpreter to send the SQL commands to the server.\r\n\r\nTo start up a SQL interpreter, use the following command:\r\n\r\n```\r\n\u003e java -classpath core-0.7.0.jar org.vanilladb.core.util.ConsoleSQLInterpreter\r\n```\r\n\r\nNow you should see a console prompt like:\r\n\r\n```\r\nSQL\u003e _\r\n```\r\n\r\nAfter you enter the SQL console, you may start to give some SQL commands for interaction with the server. VanillaCore supports basic commands defined in SQL-92 standard. To see what exactly commands you can use, please check out [VanillaDB SQL](doc/vanilladb-sql.md) document.\r\n\r\n## System Configurations\r\n\r\nVanillaCore provides some configurable settings. These settings can be found in properties file `vanilladb.properties` which located in `src\\main\\resources\\org\\vanilladb\\core`. After you compile and package the classes using Maven, the properties file will be copied to `target\\properties\\org\\vanilladb\\core`. When a VanillaCore server starts up, it will search the properties file in `properties\\org\\vanilladb\\core` under the same directory. Therefore, if you want to adjust the settings after packaging the classes, you have to modify the one in the `target\\properties\\org\\vanilladb\\core`.\r\n\r\nWe assume that the jar file and the properties files are always in the same directory. If they are not, VanillaCore will use the default values for all settings.\r\n\r\nYou can also put the properties file at other location. To make VanillaCore know where the file is, you need to specify the path as an argument of the JVM while starting up a server:\r\n\r\n```\r\n\u003e java -Dorg.vanilladb.core.config.file={path to vanilladb.properties} -classpath core-0.7.0.jar org.vanilladb.core.server.StartUp {DB Name}\r\n```\r\n\r\nRemember to replace `{path to vanilladb.properties}` to **the path of the file**.\r\n\r\n### Modifying Configurations\r\n\r\nFirst, find an editor to open properties file `vanilladb.properties`. Each line in the file is a key-value pair for a configuration. To modify a configuration, just update the value behind `=`.\r\n\r\n### Commonly Used Configurations\r\n\r\nHere are some commonly used configurations:\r\n\r\nVanillaCore stores records in files. To adjust the size of physical blocks used by the database (default: 4096 bytes):\r\n\r\n```\r\norg.vanilladb.core.storage.file.Page.BLOCK_SIZE=4096\r\n```\r\n\r\nTo adjust the location of the database files (default: the home directory of the current user):\r\n\r\n```\r\norg.vanilladb.core.storage.file.FileMgr.DB_FILES_DIR=\r\n```\r\n\r\nTo adjust the number of the buffers which cache the blocks of the files in the memory (default: 1024):\r\n\r\n```\r\norg.vanilladb.core.storage.buffer.BufferMgr.BUFFER_POOL_SIZE=1024\r\n```\r\n\r\nTo enable the periodically checkpointing (default: true):\r\n\r\n```\r\norg.vanilladb.core.server.VanillaDb.DO_CHECKPOINT=true\r\n```\r\n\r\nYou can find more available configurations and corresponding descriptions in `vanilladb.properties`.\r\n\r\n## Supported Syntax\r\n\r\nPlease checkout our [VanillaDB SQL](doc/vanilladb-sql.md) document.\r\n\r\n## Architecture Tutorials\r\n\r\nWe have a series of educational slides to make the people who are not familiar with database internal architecture understand how a database works. Here is the outline of the our slides:\r\n\r\n- [Background](http://www.vanilladb.org/slides/core/Background.pdf)\r\n\t- Why relational database systems? ER- and relational-models, transactions and logical schema design and normal forms, etc.\r\n- [Architecture overview and interfaces](http://www.vanilladb.org/slides/core/Architecture_and_Interfaces.pdf)\r\n\t- Client-server interfaces, embedding, storage interfaces, etc.\r\n- Query engine\r\n\t- [Server, threads and JDBC](http://www.vanilladb.org/slides/core/Server_and_Threads.pdf)\r\n\t\t- Threads v.s. connections v.s. transactions, thread-local v.s. thread-safe components, etc.\r\n\t- [Query Processing](http://www.vanilladb.org/slides/core/Query_Processing.pdf)\r\n\t\t- SQL parsing and validation, planning, algebra, plan/scan trees, etc.\r\n- Storage\r\n\t- [Data access and file management](http://www.vanilladb.org/slides/core/Data_Access_and_File_Management.pdf)\r\n\t\t- Block-level v.s. file-level access, O_DIRECT on Linux, etc.\r\n\t- [Memory management](http://www.vanilladb.org/slides/core/Memory_Management.pdf)\r\n\t\t- Buffering user data, write-ahead-logging (WAL), log caching, etc.\r\n\t- [Record](http://www.vanilladb.org/slides/core/Record_Management.pdf) and [metadata management](http://www.vanilladb.org/slides/core/Metadata_Management.pdf)\r\n\t\t- Physical schema design, efficient buffer utilization, etc.\r\n- Transaction management\r\n\t- [Concurrency](http://www.vanilladb.org/slides/core/Transaction_Concurrency.pdf)\r\n\t\t- Strict Two-Phase Locking (S2PL), deadlock detection/avoidance, lock granularity, phantom, isolation levels, etc.\r\n\t- [Recovery](http://www.vanilladb.org/slides/core/Transaction_Recovery.pdf)\r\n\t\t- Physical logging, transaction rollback, UNDO-only recovery, UNDO-REDO recovery, logical logging, physiological logging, ARIES, checkpointing, etc.\r\n- Efficient query processing\r\n\t- [Indexing](http://www.vanilladb.org/slides/core/Indexing.pdf)\r\n\t\t- Hash and B-tree indexing, index locking, etc.\r\n\t- Materialization and sorting (TBA)\r\n\t- Effective buffer utilization (TBA)\r\n\t- Query optimization (TBA)\r\n\r\n## Linking via Maven\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n  \u003cgroupId\u003eorg.vanilladb\u003c/groupId\u003e\r\n  \u003cartifactId\u003ecore\u003c/artifactId\u003e\r\n  \u003cversion\u003e0.7.0\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n## Contributing\r\n\r\nTo contribute to VanillaCore, please see [CONTRIBUTING](CONTRIBUTING.md).\r\n\r\n## Contact Information\r\n\r\nIf you have any question, you can either open an issue here or contact [vanilladb@datalab.cs.nthu.edu.tw](vanilladb@datalab.cs.nthu.edu.tw) directly.\r\n\r\n## License\r\n\r\nCopyright 2016-2022 vanilladb.org contributors\r\n\r\nLicensed under the [Apache License 2.0](LICENSE)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanilladb%2Fvanillacore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanilladb%2Fvanillacore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanilladb%2Fvanillacore/lists"}