diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..767bbf0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,42 @@ +name: Bug report +description: Something behaves differently than it should +labels: ["bug"] +body: + - type: textarea + id: what + attributes: + label: What happened + description: What you saw, and what you expected instead. + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: How to reproduce + description: > + The smallest sequence of statements or client calls that triggers it. + A failing test is ideal. + render: sql + validations: + required: true + - type: input + id: version + attributes: + label: Version or commit + placeholder: 0.2.0, or a commit hash + validations: + required: true + - type: input + id: platform + attributes: + label: Platform + placeholder: Linux x86_64, Windows 11, arm64 container, and so on + validations: + required: true + - type: textarea + id: extra + attributes: + label: Anything else + description: > + Server logs, whether it survives a restart, whether it reproduces on a + fresh data directory. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..6481609 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: Security vulnerability + url: https://github.com/martian56/quantadb/security/policy + about: Do not open a public issue. Report it privately instead. + - name: Benchmark methodology + url: https://github.com/martian56/quantadb/blob/main/docs/benchmarks.md + about: How performance is measured here, and why single runs are not trusted. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..c9ced58 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,22 @@ +name: Feature or SQL support +description: Something QuantaDB cannot do yet +labels: ["enhancement"] +body: + - type: textarea + id: need + attributes: + label: What you are trying to do + description: > + The problem, rather than the feature. It often turns out there is a + shorter way to solve it. + validations: + required: true + - type: textarea + id: shape + attributes: + label: What it might look like + description: The SQL, the API, or the protocol behaviour you have in mind. + - type: textarea + id: alternatives + attributes: + label: How you work around it today diff --git a/.github/ISSUE_TEMPLATE/performance.yml b/.github/ISSUE_TEMPLATE/performance.yml new file mode 100644 index 0000000..98ac07b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/performance.yml @@ -0,0 +1,49 @@ +name: Performance +description: Something is slower than it should be +labels: ["performance"] +body: + - type: markdown + attributes: + value: > + Performance work here is decided by measurement, so this template asks + for numbers. A report without them is still welcome, but it will start + by someone trying to reproduce what you saw. + - type: textarea + id: observed + attributes: + label: What you measured + description: > + Throughput or latency, the workload that produced it, and what you + expected instead. + validations: + required: true + - type: textarea + id: how + attributes: + label: How you measured it + description: > + The client, the concurrency, the row count, and how long each run + lasted. If you used loadgen or the field driver, the exact flags. + validations: + required: true + - type: input + id: hardware + attributes: + label: Hardware and storage + description: > + CPU count, memory, and what the data directory sits on. Flush cost + varies by orders of magnitude between an SSD, a spinning disk and a + container volume, and it usually explains the result. + placeholder: 4 vCPU, 8 GiB, NVMe SSD, ext4 + validations: + required: true + - type: dropdown + id: repeated + attributes: + label: Did you run it more than once? + options: + - "Yes, and the runs agreed" + - "Yes, and the runs disagreed" + - "No, one run" + validations: + required: true diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..5812cd9 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,28 @@ + + +## What this changes + + + +## Why + + + +## How it was checked + +- [ ] `cargo test --workspace` +- [ ] `cargo clippy --workspace --all-targets -- -D warnings` +- [ ] `cargo fmt --all` +- [ ] Tests added for the behaviour that changed + +## Anything a reviewer should look at closely + + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..604e213 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,39 @@ +# Code of conduct + +## The short version + +Be decent to people. Argue about code, not about each other. + +## What is expected + +- Assume the person you are replying to is competent and acting in good faith. +- Criticise the design, the benchmark, or the patch. Not the person who wrote it. +- Accept that other people have different priorities, hardware, and workloads. +- When you are wrong, say so plainly and move on. It costs nothing here. + +## What is not acceptable + +- Personal attacks, insults, or demeaning comments. +- Harassment of any kind, public or private, including unwelcome attention. +- Publishing anyone's private information without their explicit permission. +- Sustained disruption of discussions, issues, or reviews. + +## Scope + +This applies in the issue tracker, pull requests, discussions, and anywhere +someone is representing the project. + +## Reporting + +Report anything that needs attention to fuadelizade6@gmail.com. Reports are +read by the maintainer and are not shared further without your agreement. + +Expect an acknowledgement within a few days. Outcomes range from a private +word to a permanent ban, depending on what happened. The maintainer will not +act on a report while personally involved in the dispute without asking a +neutral third party to look first. + +## Attribution + +This is adapted in spirit from the [Contributor Covenant](https://www.contributor-covenant.org), +rewritten to be shorter and to say what it actually means. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..45b6325 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,71 @@ +# Contributing + +Thanks for looking. QuantaDB is a young database and the useful contributions +right now are small, measured, and reviewable. + +## Before you write code + +Open an issue first for anything beyond a fix. It saves you building something +that does not fit, and it saves a review that has to say no. + +If you are looking for somewhere to start, the issue tracker carries the +current performance work with its measurements attached, which is usually the +clearest statement of what the project needs. + +## Getting set up + +Rust 1.96 or newer. + +```bash +cargo build --workspace +cargo test --workspace +cargo clippy --workspace --all-targets -- -D warnings +cargo fmt --all +``` + +All four have to be clean; CI runs them as separate jobs so a formatting slip +does not hide behind a compile. + +## What a good change looks like + +**One issue per pull request**, with several small commits rather than one +large one. Each commit should build and pass tests on its own. + +**Tests that would have caught the bug.** For storage and MVCC work that +usually means a test that survives a reopen, or one that drives the exact +interleaving that broke. + +**Comments only where the code cannot speak.** Keep them short. Explain why +something is the way it is, not what the next line does. + +**Commit messages that say what changed and why.** A subject line under about +seventy characters, a blank line, then prose. No trailing metadata. + +## Performance changes + +This is the part that is different here, and it is not negotiable. + +**A performance claim needs numbers from the bench matrix, not from your +laptop.** Every pull request is benched on five machine profiles against the +previous build running on the same runner, and the result is posted as a +comment. Local timings have repeatedly pointed the opposite way to the truth +on this project, so they do not decide anything. + +**One run is not evidence.** Runner speed varies. A change under about fifteen +percent needs a second run before anyone believes it, and the report says so. + +**Negative results are worth submitting.** Several issues here exist only to +record what did not work and why, so nobody spends the idea twice. If you tried +something reasonable and the matrix rejected it, that is a useful pull request +description even if the code never merges. + +## Licensing + +QuantaDB is Apache-2.0. By opening a pull request you agree that your +contribution is licensed under the same terms, and you confirm you have the +right to contribute it. Commits should carry a `Signed-off-by` line asserting +the [Developer Certificate of Origin](https://developercertificate.org): + +```bash +git commit -s +``` diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..8b61968 --- /dev/null +++ b/NOTICE @@ -0,0 +1,5 @@ +QuantaDB +Copyright 2025 Fuad Elizade + +Licensed under the Apache License, Version 2.0. See the LICENSE file for +the full terms. diff --git a/README.md b/README.md index 3c295f7..58a831e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ + + # QuantaDB +[![Core](https://github.com/martian56/quantadb/actions/workflows/core.yml/badge.svg)](https://github.com/martian56/quantadb/actions/workflows/core.yml) +[![Bench](https://github.com/martian56/quantadb/actions/workflows/bench.yml/badge.svg)](https://github.com/martian56/quantadb/actions/workflows/bench.yml) +[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE) + QuantaDB is an experimental relational database being rebuilt in Rust around three non-negotiable goals: @@ -131,6 +137,21 @@ The target is a Linux-first, durable, single-node OLTP database with PostgreSQL-compatible client support. Distributed operation comes after single-node recovery, transactions, and replication are trustworthy. +## Contributing + +Small, measured changes are the useful ones. [CONTRIBUTING.md](CONTRIBUTING.md) +covers the setup and what a good pull request looks like; the short version is +that performance claims are settled by the bench matrix rather than by a local +run, because local timings on this project have repeatedly pointed the wrong +way. + +Security reports go to the address in [SECURITY.md](SECURITY.md), not the issue +tracker. + +## License + +Apache-2.0. See [LICENSE](LICENSE). + See [the architecture roadmap](docs/architecture.md) for milestone boundaries, [the MVCC design](docs/mvcc.md) for transaction semantics, the [index format](docs/index-format-v1.md) for persistent tree invariants, and diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..3bc25bb --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,39 @@ +# Security + +## Reporting a vulnerability + +Email fuadelizade6@gmail.com. Please do not open a public issue for anything +that could be used against a running database before there is a fix. + +Include what you need to make the problem reproducible: the version or commit, +the platform, and the smallest sequence of statements or client behaviour that +triggers it. A failing test is ideal but not required. + +Expect an acknowledgement within a week. If the report is valid you will get +an assessment and a rough timeline, and credit in the release notes unless you +would rather not be named. + +## What counts + +QuantaDB is experimental and has no authentication yet, so anything reachable +on its listening ports is by design reachable by anyone who can connect. That +is documented, not a vulnerability. + +Reports that are in scope: + +- data loss or corruption from a crash the durability rules say is survivable +- a client that can read or write data outside its own transaction's snapshot +- a query, statement, or protocol frame that panics, hangs, or exhausts memory + in a way a bounded server should not allow +- anything that lets a client escape the server process + +Reports that are out of scope for now, because they are known: + +- no authentication, authorisation, or TLS on any listener +- the HTTP bridge trusting its callers, which is why it is off by default +- denial of service from a client that simply sends a lot of legitimate work + +## Supported versions + +There is one supported version: the current `main`. QuantaDB is pre-1.0 and +carries no support commitment for older commits. diff --git a/web/apple-touch-icon.png b/web/apple-touch-icon.png new file mode 100644 index 0000000..2ab9808 Binary files /dev/null and b/web/apple-touch-icon.png differ diff --git a/web/favicon-16.png b/web/favicon-16.png new file mode 100644 index 0000000..402e203 Binary files /dev/null and b/web/favicon-16.png differ diff --git a/web/favicon-32.png b/web/favicon-32.png new file mode 100644 index 0000000..cb5cc79 Binary files /dev/null and b/web/favicon-32.png differ diff --git a/web/favicon.ico b/web/favicon.ico index d6aa275..3181779 100644 Binary files a/web/favicon.ico and b/web/favicon.ico differ diff --git a/web/favicon.png b/web/favicon.png deleted file mode 100644 index 313f97b..0000000 Binary files a/web/favicon.png and /dev/null differ diff --git a/web/icon-512.png b/web/icon-512.png new file mode 100644 index 0000000..3fb1612 Binary files /dev/null and b/web/icon-512.png differ diff --git a/web/index.html b/web/index.html index d9e5cd0..17da9cc 100644 --- a/web/index.html +++ b/web/index.html @@ -5,14 +5,23 @@ QuantaDB - + + + + + + + + + +
- QuantaDB + QuantaDB v0.2.0, experimental