add files, intro

This commit is contained in:
hinto.janai 2024-09-03 17:22:15 -04:00
parent bf00b44260
commit 86017f3291
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
28 changed files with 87 additions and 28 deletions

View file

@ -27,33 +27,33 @@
---
- [⚪️ Storage](storage/intro.md)
- [⚪️ Database abstraction](storage/db/intro.md)
- [⚪️ Backends](storage/db/backends/intro.md)
- [⚪️ Layers](storage/db/layers/intro.md)
- [⚪️ Backend](storage/db/layers/backend.md)
- [⚪️ ConcreteEnv](storage/db/layers/concrete_env.md)
- [⚪️ Trait](storage/db/layers/trait.md)
- [⚪️ `ops`](storage/db/layers/ops.md)
- [⚪️ Service](storage/db/layers/service.md)
- [⚪️ The service](storage/db/service/intro.md)
- [⚪️ Initialization](storage/db/service/initialization.md)
- [⚪️ Requests](storage/db/service/requests.md)
- [⚪️ Responses](storage/db/service/responses.md)
- [⚪️ Thread model](storage/db/service/thread-model.md)
- [⚪️ Shutdown](storage/db/service/shutdown.md)
- [⚪️ Syncing](storage/db/syncing.md)
- [⚪️ Resizing](storage/db/resizing.md)
- [⚪️ (De)serialization](storage/db/serde.md)
- [⚪️ Schema](storage/db/schema/intro.md)
- [⚪️ Tables](storage/db/schema/tables.md)
- [⚪️ Multimap tables](storage/db/schema/multimap.md)
- [⚪️ Known issues and tradeoffs](storage/db/issues/intro.md)
- [⚪️ Traits abstracting backends](storage/db/issues/traits.md)
- [⚪️ Hot-swappable backends](storage/db/issues/hot-swap.md)
- [⚪️ Copying unaligned bytes](storage/db/issues/copy.md)
- [⚪️ Endianness](storage/db/issues/endian.md)
- [⚪️ Extra table data](storage/db/issues/extra-table-data.md)
- [🟢 Storage](storage/intro.md)
- [🟢 Database abstraction](storage/db/intro.md)
- [🟢 Backends](storage/db/backends/intro.md)
- [🟢 Layers](storage/db/layers/intro.md)
- [🟢 Backend](storage/db/layers/backend.md)
- [🟢 ConcreteEnv](storage/db/layers/concrete_env.md)
- [🟢 Trait](storage/db/layers/trait.md)
- [🟢 Syncing](storage/db/syncing.md)
- [🟢 Resizing](storage/db/resizing.md)
- [🟢 (De)serialization](storage/db/serde.md)
- [🟢 Schema](storage/db/schema/intro.md)
- [🟢 Tables](storage/db/schema/tables.md)
- [🟢 Multimap tables](storage/db/schema/multimap.md)
- [🟢 Known issues and tradeoffs](storage/db/issues/intro.md)
- [🟢 Traits abstracting backends](storage/db/issues/traits.md)
- [🟢 Hot-swappable backends](storage/db/issues/hot-swap.md)
- [🟢 Copying unaligned bytes](storage/db/issues/copy.md)
- [🟢 Endianness](storage/db/issues/endian.md)
- [🟢 Extra table data](storage/db/issues/extra-table-data.md)
- [🟢 The layers](storage/db/layers/intro.md)
- [🟢 `ops`](storage/db/layers/ops.md)
- [🟢 `tower::Service`](storage/db/service/intro.md)
- [🟢 Initialization](storage/db/service/initialization.md)
- [🟢 Requests](storage/db/service/requests.md)
- [🟢 Responses](storage/db/service/responses.md)
- [🟢 Thread model](storage/db/service/thread-model.md)
- [🟢 Shutdown](storage/db/service/shutdown.md)
- [⚪️ Blockchain](storage/blockchain.md)
- [⚪️ Transaction pool](storage/transaction-pool.md)
- [⚪️ Pruning](storage/pruning.md)

View file

@ -0,0 +1 @@
# ⚪️ Backends

View file

@ -0,0 +1 @@
# ⚪️ Database abstraction

View file

@ -0,0 +1 @@
# ⚪️ Copying unaligned bytes

View file

@ -0,0 +1 @@
# ⚪️ Endianness

View file

@ -0,0 +1 @@
# ⚪️ Extra table data

View file

@ -0,0 +1 @@
# ⚪️ Hot-swappable backends

View file

@ -0,0 +1 @@
# ⚪️ Known issues and tradeoffs

View file

@ -0,0 +1 @@
# ⚪️ Traits abstracting backends

View file

@ -0,0 +1 @@
# ⚪️ Backend

View file

@ -0,0 +1 @@
# ⚪️ ConcreteEnv

View file

@ -0,0 +1 @@
# ⚪️ Layers

View file

@ -0,0 +1 @@
# ⚪️ ops

View file

@ -0,0 +1 @@
# ⚪️ Service

View file

@ -0,0 +1 @@
# ⚪️ Trait

View file

@ -0,0 +1 @@
# ⚪️ Resizing

View file

@ -0,0 +1 @@
# ⚪️ Schema

View file

@ -0,0 +1 @@
# ⚪️ Multimap tables

View file

@ -0,0 +1 @@
# ⚪️ Tables

View file

@ -0,0 +1 @@
# ⚪️ (De)serialization

View file

@ -0,0 +1 @@
# ⚪️ Initialization

View file

@ -0,0 +1 @@
# ⚪️ The service

View file

@ -0,0 +1 @@
# ⚪️ Requests

View file

@ -0,0 +1 @@
# ⚪️ Responses

View file

@ -0,0 +1 @@
# ⚪️ Shutdown

View file

@ -0,0 +1 @@
# ⚪️ Thread model

View file

@ -0,0 +1 @@
# ⚪️ Syncing

View file

@ -1 +1,34 @@
# ⚪️ Storage
# Storage
This section covers all things related to the long-term on-disk storage of data within Cuprate.
## Overview
The quick overview is that Cuprate has a [database abstraction crate](./database-abstraction.md)
that handles "low-level" database details such as key and value (de)serialization, tables, transactions, etc.
This database abstraction crate is then used by all crates that need on-disk storage, i.e. the
- [Blockchain database](./blockchain.md)
- [Transaction pool database](./transaction-pool.md)
## Service
The interface provided by all crates building on-top of the
database abstraction is a [`tower::Service`](https://docs.rs/tower), i.e.
database requests are sent, and database responses are received asynchronously.
As the interface details are similar across databases (threadpool, read operations, write operations),
the interface itself is abstracted in the [`cuprate_database_service`](./db/layers/intro.md) crate,
which is then used by the crates.
## Diagram
This is a roughly how database crates are set up.
```text
┌─────────────────┐
┌──────────────────────────────────┐ │ │
│ Some crate that needs a database │ ┌────────────────┐ │ │
│ │ │ Public │ │ │
│ ┌──────────────────────────────┐ │─►│ tower::Service │◄─►│ Rest of Cuprate │
│ │ Database abstraction │ │ │ API │ │ │
│ └──────────────────────────────┘ │ └────────────────┘ │ │
└──────────────────────────────────┘ │ │
└─────────────────┘
```