-
Notifications
You must be signed in to change notification settings - Fork 48
[SPIKE] Adding all implementations for SqlServer, MySql and Postgresql persistence #5224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
johnsimons
wants to merge
16
commits into
master
Choose a base branch
from
john/more_interfaces
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e9f8cf8 to
b8b61fc
Compare
Refactors the upsert logic in several data stores to leverage EF Core's change tracking more efficiently. Instead of creating a new entity and then calling Update, the code now fetches the existing entity (if any) and modifies its properties directly. This reduces the overhead and potential issues associated with detached entities. The RecoverabilityIngestionUnitOfWork is also updated to use change tracking for FailedMessageEntity updates. This commit was made on the `john/more_interfaces` branch.
Adds data store and entities required for persisting licensing and throughput data. This includes adding new tables for licensing metadata, throughput endpoints, and daily throughput data, as well as configurations and a data store implementation to interact with these tables.
0c8bfe9 to
34b8228
Compare
Also added headers to the serialised entity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SQL Persistence Implementation for ServiceControl
Summary
Implements SQL persistence layer for ServiceControl with support for SQL Server, PostgreSQL, and MySQL. Introduces Entity Framework Core-based implementation as an alternative to the existing RavenDB persistence.
Key Changes
Core Persistence Infrastructure (
ServiceControl.Persistence.Sql.Core)ServiceControlDbContextBasewith 16 entity setsBasePersistence,SqlPersisterSettings)Provider-Specific Implementations
Data Store Implementations
All 19+ persistence interfaces implemented including:
ErrorMessageDataStore,BodyStorage)RetryBatchesDataStore,RetryDocumentDataStore,RetryHistoryDataStore)MonitoringDataStore,CustomChecksDataStore)EndpointSettingsStore,QueueAddressStore,NotificationsManager)Testing
Design Decisions
Data Modeling
FailedMessageEntitystores fullProcessingAttemptsJsonbut denormalizesLastProcessedAt,MessageType,ExceptionTypefor query performanceMessageBodiestable to keep primary tables lean and improve query performanceRetryHistoryEntity,NotificationsSettingsEntity) use fixed IDs as they represent single configuration recordsQuery Optimization
Best Way to Review
1. Start with the abstractions (understand the architecture)
2. Review the data model (entities represent the domain)
3. Check one provider implementation (SQL Server recommended)
4. Review key data store implementations (focus on complex ones)
5. Spot-check tests (verify integration test coverage)
Migration Notes