Migration of data from existing tables to new tables
Implementation plan
- Consistency between old and new data
- Create: If any new destinations are being added for non-consolidated destinations then create the same data in new tables too.
- Update: Check if the non-consolidated destination being updated also exist in new table then update data for that destination too.
- Delete: Check if the non-consolidated destination being deleted also exist in new table then delete data for that destination too.
- How will we find out the link between non-consolidated and consolidated destination?
-
name
field is unique for destinations belonging to same namespace id and for an instance, so we can treatname
as the bridge between old and new data tables.
-
- Where should we add these checks for create, update and delete?
- We can do it by creating hooks in ExternallyCommonDestinationable for
after_create, after_update and after_destroy
. - Or We can do it in the mutations for the non-consolidated destinations where we are creating updating and deleting the records.
- We need to do this with a feature flag.
- We can do it by creating hooks in ExternallyCommonDestinationable for
- Migration for moving all the data from non-consolidated tables to new tables and let step 1 make sure the data is consistent.
- Once the consistency of the data is ensured.
- We can start using the new tables for streaming.
- Start using new apis on frontend with feature flag.
- Start deprecating old apis and table.
- Cleanup of old tables.
Table information:
Legacy Tables (12):
- HTTP
- audit_events_external_audit_event_destinations
- audit_events_instance_external_audit_event_destinations
- headers:
- audit_events_streaming_headers
- instance_audit_events_streaming_headers
- event type filters:
- audit_events_streaming_event_type_filters
- audit_events_streaming_instance_event_type_filters
- namespace filters:
- audit_events_streaming_http_group_namespace_filters
- audit_events_streaming_http_instance_namespace_filters
- AWS
- audit_events_amazon_s3_configurations
- audit_events_instance_amazon_s3_configurations
- GCP
- audit_events_google_cloud_logging_configurations
- audit_events_instance_google_cloud_logging_configurations
Streaming Tables (6):
- audit_events_group_external_streaming_destinations
- audit_events_group_streaming_event_type_filters [http only]
- audit_events_streaming_group_namespace_filters [http only]
- audit_events_instance_external_streaming_destinations
- audit_events_instance_streaming_event_type_filters [http only]
- audit_events_streaming_instance_namespace_filters [http only]