Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
6821bfd
bugfix: don't publish transaction if it wasn't committed to the database
the-avid-engineer Nov 24, 2022
a6fd6fe
feat: EntityFramework snapshots
the-avid-engineer Nov 20, 2022
74c1cc7
test: EntityFramework snapshots
the-avid-engineer Nov 20, 2022
bd91eae
fix: remove test code
the-avid-engineer Nov 25, 2022
6292a7a
refactor: provide a dbContext which handles the boilerplate
the-avid-engineer Nov 25, 2022
7bb785e
fix(test): update tests to match new structure
the-avid-engineer Nov 25, 2022
bd5fac6
refactor: use ValueConverter for the ValueObjects
the-avid-engineer Nov 26, 2022
2e45753
refactor: make choosing table names mandatory
the-avid-engineer Nov 26, 2022
f33deb3
refactor: use ValueObjects instead of Raw Values
the-avid-engineer Nov 27, 2022
f4512fe
refactor: don't require a named DbSet property
the-avid-engineer Nov 27, 2022
d54256f
refactor: use real transactions for entity framework snapshots in tes…
the-avid-engineer Nov 27, 2022
030514e
refactor: update snapshot reference if one already exists
the-avid-engineer Nov 27, 2022
0d61f8e
chore: coverage for TimeStamp converter
the-avid-engineer Nov 28, 2022
b56aaf4
chore: exclude ToString overrides from coverage
the-avid-engineer Nov 28, 2022
2ed1224
chore: exclude functioning CommitTransaction from tests
the-avid-engineer Nov 28, 2022
f3f6891
chore: remove unused method
the-avid-engineer Nov 28, 2022
0292dab
fix: swap order of methods
the-avid-engineer Nov 28, 2022
e69b30b
fix: working delete method
the-avid-engineer Nov 28, 2022
2e44548
refactor: remove various ITransactionStep concept.. if you want to ad…
the-avid-engineer Dec 20, 2022
c8be665
feat: rework projections
the-avid-engineer Dec 20, 2022
d6b865e
refactor: change name
the-avid-engineer Dec 20, 2022
7161fc5
refactor: RedisSnapshotSessionOptions and RedisSession do not need to…
the-avid-engineer Dec 21, 2022
3b38f91
feat: connection string slot
the-avid-engineer Dec 21, 2022
ff38481
feat: transaction reprocessor queue
the-avid-engineer Dec 31, 2022
a00f92a
fix: need to register the ITransactionProcessor
the-avid-engineer Dec 31, 2022
9a02723
fix: registered ITransactionProcessor the wrong way
the-avid-engineer Dec 31, 2022
d6f4f80
clean: remove redundant try/catch and logging
the-avid-engineer Dec 31, 2022
00201bb
Update global.json
the-avid-engineer Aug 25, 2023
105eb0b
chore: include debug logs
the-avid-engineer Aug 25, 2023
3340585
refactor: SnapshotReference _has one_ Snapshot instead of _owns_ snap…
the-avid-engineer Aug 25, 2023
a95d346
Merge branch 'main' into feat/entity-framework-snapshots
the-avid-engineer Aug 26, 2023
74735a8
Merge branch 'feat/entity-framework-snapshots' into feat/rework-proje…
the-avid-engineer Aug 26, 2023
cfcb721
nit: explicit OnDelete behavior
the-avid-engineer Aug 26, 2023
5b6a94a
fix: IEntityFrameworkSnapshot belongs in its own file, and in the Sna…
the-avid-engineer Aug 26, 2023
cb6f3f7
Merge branch 'feat/entity-framework-snapshots' into feat/rework-proje…
the-avid-engineer Aug 26, 2023
8ae3913
refactor: better snapshot cleanup
the-avid-engineer Aug 26, 2023
9ac9d2d
Merge branch 'feat/entity-framework-snapshots' into feat/rework-proje…
the-avid-engineer Aug 26, 2023
8a275c7
refactor: force a constructor instead of using IDbContextFactory
the-avid-engineer Aug 26, 2023
218c0e5
refactor: force a constructor instead of using IDbContextFactory
the-avid-engineer Aug 26, 2023
4a2251e
fix: somehow this wasn't on this branch originally
the-avid-engineer Aug 26, 2023
272d6fe
refactor: rename bits and bobs
the-avid-engineer Aug 27, 2023
4ca3276
Merge branch 'feat/entity-framework-snapshots' into feat/rework-proje…
the-avid-engineer Aug 27, 2023
91dda92
refactor: IEntityDbContextFactory
the-avid-engineer Aug 27, 2023
2de6819
Merge branch 'feat/entity-framework-snapshots' into feat/rework-proje…
the-avid-engineer Aug 27, 2023
6c38180
refactor: single queue for processing transactions
the-avid-engineer Aug 30, 2023
060b975
chore: upgrade packages, images
the-avid-engineer Aug 30, 2023
3f39506
refactor: generalize source
the-avid-engineer Aug 30, 2023
793b3db
refactor: generalized projections
the-avid-engineer Aug 30, 2023
9ff226c
chore: cleanup
the-avid-engineer Aug 30, 2023
5391af8
fix: InMemory should not instantiate more than one repository factory…
the-avid-engineer Aug 30, 2023
23a18b2
fix: broken tests
the-avid-engineer Aug 30, 2023
114d481
refactor: make these extensions public
the-avid-engineer Sep 17, 2023
ed838e0
Merge branch 'main' into feat/rework-projections
the-avid-engineer Sep 17, 2023
71a027e
refactor: make these source processors public so that they can be ref…
the-avid-engineer Sep 17, 2023
e5f7a1e
refactor: some unsealed classes that should be sealed
the-avid-engineer Sep 17, 2023
31ffa1f
chore: update SDK
the-avid-engineer Oct 7, 2023
19d757e
chore: rider suggestions
the-avid-engineer Oct 7, 2023
0d374c6
refactor: better generic methods (SourceTimeStamp vs TransactionTimeS…
the-avid-engineer Oct 7, 2023
e4c19ff
refactor: projections use mutation instead of reduction
the-avid-engineer Oct 7, 2023
bdf62bf
chore: remove InMemory from test matrix
the-avid-engineer Oct 7, 2023
e634769
refactor: Copy only needed for Projection, not in general for Snapshot
the-avid-engineer Oct 7, 2023
386c557
chore: update Copyright to 2023
the-avid-engineer Oct 7, 2023
6606a5e
refactor: remove Copy, this is the whole problem
the-avid-engineer Oct 7, 2023
4060015
refactor: need IServiceProvider to get logging back
the-avid-engineer Oct 7, 2023
152d4e9
feat: MongoDb snapshots
the-avid-engineer Oct 22, 2023
74394d7
refactor: Lease & Tag Commands can have access to Entity Id / Version…
the-avid-engineer Dec 25, 2023
d9de3fc
refactor: better refactor of Add/Delete Tags/Leases
the-avid-engineer Dec 25, 2023
4ce10ef
big refactor
the-avid-engineer Jan 8, 2024
7eef2e0
feat: message ids for idempotency when using Version.Zero
the-avid-engineer Jan 10, 2024
dae6382
refactor: replace all references to unused branch feature
the-avid-engineer Jan 10, 2024
4234985
chore: clean up words
the-avid-engineer Jan 10, 2024
6b3717e
fix: use interface in doc comment
the-avid-engineer Jan 10, 2024
b1fd33e
format
the-avid-engineer Jan 10, 2024
464d836
chore: better var names
the-avid-engineer Jan 10, 2024
0d7f829
refactor: pull some mocking logic to be re-usable with a more complic…
the-avid-engineer Jan 10, 2024
bc7973b
feat: Event Streams
the-avid-engineer Jan 10, 2024
b176576
remove redundant checks
the-avid-engineer Jan 10, 2024
d7d65e5
refactor: incorporate EntitySourceBuilder into EntityRepository
the-avid-engineer Jan 10, 2024
5f8d36d
another big refactor
the-avid-engineer Jan 10, 2024
4831091
refactor: better object names + entity and stream repos will short-ci…
the-avid-engineer Jan 10, 2024
b42f041
fix: names got messed up
the-avid-engineer Jan 12, 2024
0ca111d
fix: await in test
the-avid-engineer Jan 12, 2024
a3939ee
fix: broken query somehow not caught by tests? will need a regression…
the-avid-engineer Jan 12, 2024
3e8ddc1
chore: sealed/abstract classes
the-avid-engineer Jan 12, 2024
3e4a706
fix: don't access agent until commit
the-avid-engineer Jan 12, 2024
5f27bf5
feat: more stream capabilities
the-avid-engineer Jan 14, 2024
a6b7c91
refactor: change from array to read-only collection
the-avid-engineer Jan 14, 2024
e4ecfcc
chore: change exception name to be similar to the onef or entity
the-avid-engineer Jan 14, 2024
1d3e97a
expect version zero
the-avid-engineer Jan 14, 2024
65ea3c5
fix: Create is void, not async
the-avid-engineer Jan 14, 2024
f1cab06
fix: this Append is void, not async
the-avid-engineer Jan 14, 2024
c77e5fa
refactor
the-avid-engineer Jan 15, 2024
8b46517
Update StateDoesNotExistException.cs
the-avid-engineer Jan 15, 2024
bd1371d
feat: Append that's not async
the-avid-engineer Jan 15, 2024
72b3b03
fix
the-avid-engineer Jan 18, 2024
37d325d
fix:allow for a conditional message key
the-avid-engineer Jan 19, 2024
6338b6c
fix: allow null
the-avid-engineer Jan 20, 2024
e24368f
feat: SQS queue processor
the-avid-engineer Jan 21, 2024
ba4a93f
feat: ability to update assembly names in default partial type resolver
the-avid-engineer Aug 12, 2024
7eef2e2
refactor: update _namespaces_, and cache so that we don't have to rep…
the-avid-engineer Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file removed .DS_Store
Binary file not shown.
File renamed without changes.
13 changes: 7 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Linq.Async" Version="6.0.1"/>
</ItemGroup>
</Project>
44 changes: 10 additions & 34 deletions EntityDb.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Mvc", "src\EntityD
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Redis", "src\EntityDb.Redis\EntityDb.Redis.csproj", "{F7BB95AE-A032-4170-89E3-E8A1D492EFB5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Void", "src\EntityDb.Void\EntityDb.Void.csproj", "{C4239113-18BE-4418-87A8-E9617EF0A2DF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{92484C44-2754-4C1D-BD46-98D83E4020EE}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
Expand All @@ -37,19 +35,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
global.json = global.json
ICON.png = ICON.png
LICENSE.txt = LICENSE.txt
README.md = README.md
SECURITY.md = SECURITY.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.InMemory", "src\EntityDb.InMemory\EntityDb.InMemory.csproj", "{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Npgsql", "src\EntityDb.Npgsql\EntityDb.Npgsql.csproj", "{2AADF21D-4F26-4BD6-852A-B28208863FDD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.SqlDb", "src\EntityDb.SqlDb\EntityDb.SqlDb.csproj", "{F2491666-31D1-47B5-A493-F25E167D1FDF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Json", "src\EntityDb.Json\EntityDb.Json.csproj", "{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.Provisioner", "src\EntityDb.Provisioner\EntityDb.Provisioner.csproj", "{26FCDB9D-0DE3-4BB9-858D-3E2C3EF763E3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityDb.EntityFramework", "src\EntityDb.EntityFramework\EntityDb.EntityFramework.csproj", "{199606BF-6283-4684-A224-4DA7E80D8F45}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityDb.Aws", "src\EntityDb.Aws\EntityDb.Aws.csproj", "{71EF2C8C-F6BF-4CE3-91A4-62F8C7C9FB8B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -77,10 +73,6 @@ Global
{F7BB95AE-A032-4170-89E3-E8A1D492EFB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7BB95AE-A032-4170-89E3-E8A1D492EFB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7BB95AE-A032-4170-89E3-E8A1D492EFB5}.Release|Any CPU.Build.0 = Release|Any CPU
{C4239113-18BE-4418-87A8-E9617EF0A2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4239113-18BE-4418-87A8-E9617EF0A2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4239113-18BE-4418-87A8-E9617EF0A2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4239113-18BE-4418-87A8-E9617EF0A2DF}.Release|Any CPU.Build.0 = Release|Any CPU
{CF316519-525E-4A67-BF12-1FDDF802B878}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF316519-525E-4A67-BF12-1FDDF802B878}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF316519-525E-4A67-BF12-1FDDF802B878}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -97,18 +89,6 @@ Global
{FA2AD2E9-84DA-4667-BF46-140B0B050563}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA2AD2E9-84DA-4667-BF46-140B0B050563}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA2AD2E9-84DA-4667-BF46-140B0B050563}.Release|Any CPU.Build.0 = Release|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643}.Release|Any CPU.Build.0 = Release|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AADF21D-4F26-4BD6-852A-B28208863FDD}.Release|Any CPU.Build.0 = Release|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2491666-31D1-47B5-A493-F25E167D1FDF}.Release|Any CPU.Build.0 = Release|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -117,10 +97,10 @@ Global
{26FCDB9D-0DE3-4BB9-858D-3E2C3EF763E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26FCDB9D-0DE3-4BB9-858D-3E2C3EF763E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26FCDB9D-0DE3-4BB9-858D-3E2C3EF763E3}.Release|Any CPU.Build.0 = Release|Any CPU
{199606BF-6283-4684-A224-4DA7E80D8F45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{199606BF-6283-4684-A224-4DA7E80D8F45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{199606BF-6283-4684-A224-4DA7E80D8F45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{199606BF-6283-4684-A224-4DA7E80D8F45}.Release|Any CPU.Build.0 = Release|Any CPU
{71EF2C8C-F6BF-4CE3-91A4-62F8C7C9FB8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71EF2C8C-F6BF-4CE3-91A4-62F8C7C9FB8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71EF2C8C-F6BF-4CE3-91A4-62F8C7C9FB8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71EF2C8C-F6BF-4CE3-91A4-62F8C7C9FB8B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -131,17 +111,13 @@ Global
{0BEA3379-6637-44F2-8332-7EA81B02BBBF} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{8A485A1A-54E4-48AD-9B35-97D286F432CE} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{F7BB95AE-A032-4170-89E3-E8A1D492EFB5} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{C4239113-18BE-4418-87A8-E9617EF0A2DF} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{CF316519-525E-4A67-BF12-1FDDF802B878} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{8D9C0976-BF78-439A-BBCB-3CFC2EEF1A0F} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{B8B6E5A5-5154-4629-9A38-9F0E65575F30} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{FA2AD2E9-84DA-4667-BF46-140B0B050563} = {92484C44-2754-4C1D-BD46-98D83E4020EE}
{31C5BEDB-9B04-4FE4-9AF5-AE682C0E7643} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{2AADF21D-4F26-4BD6-852A-B28208863FDD} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{F2491666-31D1-47B5-A493-F25E167D1FDF} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{4936FFE0-98E5-43A2-89C9-0415A13CAA9B} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{26FCDB9D-0DE3-4BB9-858D-3E2C3EF763E3} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{199606BF-6283-4684-A224-4DA7E80D8F45} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
{71EF2C8C-F6BF-4CE3-91A4-62F8C7C9FB8B} = {ABACFBCC-B59F-4616-B6CC-99C37AEC8960}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E9D288EE-9351-4018-ABE8-B0968AEB0465}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 - 2022 entitydb.io
Copyright (c) 2021 - 2024 entitydb.io

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
129 changes: 75 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,86 +25,107 @@ information on the statement. (If I'm wrong, you should consider getting a new b

## How does EntityDb.NET implement Event Sourcing?

There are several core objects at the heart of this implementation. Encalsulating these objects are various repositories.
There are several core objects at the heart of this implementation. Encapsulating these objects are various
repositories.

1. Transaction Repository
- Agents
- Commands
- Tags
- Leases
2. Snapshot Repository
- Snapshots
2. Entity Repository
- Transaction Repository
- Optional: Snapshot Repository
3. Projection Repository
- Transaction Repository
- Optional: Snapshot Repository
1. Source Repository
- Agent Signatures
- Deltas
- Tags
- Leases
2. State Repository
- States
3. Stream Repository
4. Entity Repository
5. Projection Repository

### Transactions
### Sources

A transaction represents an atomic operation on multiple entities. A transaction is committed atomically or not
at all. If some step in the transaction fails, the entire transaction should fail.
A source represents an atomic operation on one or more states.
If any message in the source cannot be committed, the entire source
cannot be committed.

### Agents
### Agent Signatures

An agent is an actor that can execute transactions. For example, if a transaction is initiated via an HTTP API, you
might use the `HttpContextAgent` - it's signature includes headers and connection information, and it uses the
ClaimsPrincipal to decide if an agent has a particular role required for authorized commands.
An agent is an actor that can record sources and interact with states. Whenever a source is committed,
the signature of the agent is recorded with it.

### Commands
For example, if a source is initiated via an HTTP API, you
might use the `HttpContextAgent` - it's signature includes headers and connection information.

A command represents the intent to perform some operation on a single entity. Going back to the bank account example,
one command could be `PerformDeposit` while another could be `PerformWithdrawl`. The things that you can do are
commands.
### Deltas

A delta represents a change in state. Literally anything can be a delta.

Going back to the bank account example,
one delta could be `PerformDeposit` while another could be `PerformWithdrawl`. The things that you can do (commands),
as well as things that are done elsewhere (events), are deltas.

### Tags

A tag is a way to index entities by some piece of information. A tag can have a label and a value, both of which are
strings. Many accounts are typed, and you could represent this with a tag where `Label` is `Type` and `Value`
A tag is a way to index sources by some piece of information contained within. A tag can have a label and a value, both
of which are
strings.

Many accounts are typed, and you could represent this with a tag where `Label` is `Type` and `Value`
is `Savings` or `Checking`. You could then run a query to get the account id of all accounts where `Label` is `Type`
and `Value` is `Savings`. The number of savings accounts in the system would be the number of entity ids.
and `Value` is `Savings`. The number of savings accounts in the system would be the number of state ids.

### Leases

A lease is like a tag, except that it has a uniqueness constraint. Many banks have online portals, allowing bank members
A lease is like a tag, except that it has a uniqueness constraint. In addition to a label and value, leases also have
a scope.

Many banks have online portals, allowing bank members
to see their accounts on the internet. From the bank's perspective, all of the accounts should be tied to a member id,
probably a guid. But the member will not want to remember nor lookup this guid - they will want to use a username. What
you can do in EntityDb is make a lease for member entities where the entity id is the member id, the `Label`
is `Username`
and the `Value` is whatever username the member wants to use. If an attempt to commit a transaction is made that would
violate the uniqueness constraint, it will be rejected. (This is obnoxious behavior for the user, though, so the bank
should check before attempting to commit to see if the username is available and give immediate feedback to choose a
probably a guid. But the member will not want to remember nor lookup this id - they will want to use a username. What
you can do in EntityDb is make a lease for members where the `Scope` is `Global`, the `Label`
is `Username`, and the `Value` is whatever username the member wants to use. If an attempt to commit a source is made
that would violate the uniqueness constraint, the commit will fail. (However, this is bad UX, so the bank
should check that the username is available before attempting to commit and give immediate feedback to choose a
different username).

### Snapshots
### State

A snapshot is a stateful object at a given point in time. They always have an identifier and a version number.
Together, the identifier and version number called a pointer. You can request different versions of a given snapshot
by using different pointers!
A state is an object at a given point in time. Each state has a unique identifier, and across time each state
has a multiple versions. Together, the identifier and a single version are called a pointer, and you can refer to a
state
at a given point in time by using the associated pointer.

In the context of snapshots, the reserved version number is reserved for pointing to the latest snapshot.
So if you want the latest version, you use a pointer with the exact id and the reserved version number.
If you want a specific version, you can create pointer with the exact id and version number you want.
The default version, `Version.Zero` is given special meaning in certain scenarios. When attempting to load a state, it
means
that the state does not exist. When attempting to modify a state, it means that the previous version of the state is
irrelevant.

The balance on your bank account is a snapshot. You can build that snapshot by summing all of the deposits and
withdrawls on your account. If you look at the bank statements, you will most likely see the snapshot of each bank
The balance on your bank account is a state. You can build that state by summing all of the deposits and
withdrawls on your account. If you look at the bank statements, you will most likely see the state of each bank
account for that statement, along with all of the deposits, withdrawls, and interest.

### Entities
### Stream Repository

A stream repository is specialized at producing sources when the order of messages
is out of the control of the application.

A great use case for a stream is to capture events coming from 3rd party, or even from
a different domain of your own suite of applications.

Sorry - I have not yet completed my thoughts of how to apply the banking metaphor here.

### Entity Repository

An entity repository is specialized at producing sources when the order of messages
is completely in the control of the application, and consuming sources to generate
a state that determines the validity of requests.

A great use case for an entity is to capture commands.

An entity is conceptually an aggregate root inside of a bounded context, and it extends the concept of a snapshot.
In the banking example, there are multiple entities. You have a membership at the bank. That's an entity. You probably
have a checking account. That's an entity. And you might even have a savings account. That is also an entity!

Which bounded contexts these entiies live in is up to the business.
### Projection Repository

### Projections
A projection repository does not produce sources, it only consumes them.

A projection is an aggregate, but notably _not_ the aggregate root, and it too extends the concept of a snapshot.
In the banking example, one example of a projection could be your entire account balance. It can be anything, though!
In the banking example, one example of a projection could be your entire balance across all accounts. It can be
anything, though!
You are not constrained in what data you want to use for your projection.

### Communications

- Coming Soon!<sup>TM</sup>
11 changes: 6 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

## Supported Versions

Version | Supported
|---|---|
\>= 8.0 | :white_check_mark:
< 8.0 | :x:
Version | Supported
|---------|--------------------|
\>= 8.0 | :white_check_mark:
< 8.0 | :x:

## Reporting a Vulnerability

Please report vulnerabilities [here](https://github.com/entitydb-io/EntityDb.NET/issues/new?assignees=&labels=&template=bug_report.md&title=[VULNERABILITY]%20)
Please report
vulnerabilities [here](https://github.com/entitydb-io/EntityDb.NET/issues/new?assignees=&labels=&template=bug_report.md&title=[VULNERABILITY]%20)
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.201",
"version": "8.0.100",
"allowPrerelease": false,
"rollForward": "disable"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Authors>Chris Philips</Authors>
<Company>entitydb.io</Company>
<Copyright>2021 - 2022 © entitydb.io</Copyright>
<Copyright>2021 - 2024 © entitydb.io</Copyright>
<RepositoryUrl>https://github.com/entitydb-io/entitydb</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<NeutralLanguage>en</NeutralLanguage>
Expand Down
32 changes: 0 additions & 32 deletions src/EntityDb.Abstractions/Annotations/IEntitiesAnnotation.cs

This file was deleted.

36 changes: 0 additions & 36 deletions src/EntityDb.Abstractions/Annotations/IEntityAnnotation.cs

This file was deleted.

Loading
Loading