mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-26 20:35:56 +00:00
add files, intro
This commit is contained in:
parent
bf00b44260
commit
86017f3291
28 changed files with 87 additions and 28 deletions
|
@ -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)
|
||||
|
|
1
books/architecture/src/storage/db/backends/intro.md
Normal file
1
books/architecture/src/storage/db/backends/intro.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Backends
|
1
books/architecture/src/storage/db/intro.md
Normal file
1
books/architecture/src/storage/db/intro.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Database abstraction
|
1
books/architecture/src/storage/db/issues/copy.md
Normal file
1
books/architecture/src/storage/db/issues/copy.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Copying unaligned bytes
|
1
books/architecture/src/storage/db/issues/endian.md
Normal file
1
books/architecture/src/storage/db/issues/endian.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Endianness
|
|
@ -0,0 +1 @@
|
|||
# ⚪️ Extra table data
|
1
books/architecture/src/storage/db/issues/hot-swap.md
Normal file
1
books/architecture/src/storage/db/issues/hot-swap.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Hot-swappable backends
|
1
books/architecture/src/storage/db/issues/intro.md
Normal file
1
books/architecture/src/storage/db/issues/intro.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Known issues and tradeoffs
|
1
books/architecture/src/storage/db/issues/traits.md
Normal file
1
books/architecture/src/storage/db/issues/traits.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Traits abstracting backends
|
1
books/architecture/src/storage/db/layers/backend.md
Normal file
1
books/architecture/src/storage/db/layers/backend.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Backend
|
1
books/architecture/src/storage/db/layers/concrete_env.md
Normal file
1
books/architecture/src/storage/db/layers/concrete_env.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ ConcreteEnv
|
1
books/architecture/src/storage/db/layers/intro.md
Normal file
1
books/architecture/src/storage/db/layers/intro.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Layers
|
1
books/architecture/src/storage/db/layers/ops.md
Normal file
1
books/architecture/src/storage/db/layers/ops.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ ops
|
1
books/architecture/src/storage/db/layers/service.md
Normal file
1
books/architecture/src/storage/db/layers/service.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Service
|
1
books/architecture/src/storage/db/layers/trait.md
Normal file
1
books/architecture/src/storage/db/layers/trait.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Trait
|
1
books/architecture/src/storage/db/resizing.md
Normal file
1
books/architecture/src/storage/db/resizing.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Resizing
|
1
books/architecture/src/storage/db/schema/intro.md
Normal file
1
books/architecture/src/storage/db/schema/intro.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Schema
|
1
books/architecture/src/storage/db/schema/multimap.md
Normal file
1
books/architecture/src/storage/db/schema/multimap.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Multimap tables
|
1
books/architecture/src/storage/db/schema/tables.md
Normal file
1
books/architecture/src/storage/db/schema/tables.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Tables
|
1
books/architecture/src/storage/db/serde.md
Normal file
1
books/architecture/src/storage/db/serde.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ (De)serialization
|
|
@ -0,0 +1 @@
|
|||
# ⚪️ Initialization
|
1
books/architecture/src/storage/db/service/intro.md
Normal file
1
books/architecture/src/storage/db/service/intro.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ The service
|
1
books/architecture/src/storage/db/service/requests.md
Normal file
1
books/architecture/src/storage/db/service/requests.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Requests
|
1
books/architecture/src/storage/db/service/responses.md
Normal file
1
books/architecture/src/storage/db/service/responses.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Responses
|
1
books/architecture/src/storage/db/service/shutdown.md
Normal file
1
books/architecture/src/storage/db/service/shutdown.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Shutdown
|
|
@ -0,0 +1 @@
|
|||
# ⚪️ Thread model
|
1
books/architecture/src/storage/db/syncing.md
Normal file
1
books/architecture/src/storage/db/syncing.md
Normal file
|
@ -0,0 +1 @@
|
|||
# ⚪️ Syncing
|
|
@ -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 │ │ │
|
||||
│ └──────────────────────────────┘ │ └────────────────┘ │ │
|
||||
└──────────────────────────────────┘ │ │
|
||||
└─────────────────┘
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue