Skip to content

Commit 19f9bb8

Browse files
authored
feat(go): Add MySQL registry store support for Go feature server (#5933)
* feat(go): Add MySQL registry store support for Go feature server This adds support for reading Feast registry data from a MySQL database in the Go feature server, enabling parity with the Python SDK's SQL registry store. - `mysql_registry_store.go`: MySQL registry store implementation - Parses SQLAlchemy-style URLs (mysql://user:pass@host:port/db) - Reads all registry tables (projects, entities, feature_views, etc.) - Uses generics for type-safe protobuf unmarshaling - Configurable connection pool settings - `mysql_registry_store_test.go`: Unit tests using in-memory SQLite - Tests registry loading with schema matching Python SQLAlchemy - Tests scheme routing for mysql:// URLs - `registry.go`: Added mysql scheme routing and MySQLRegistryStore factory - `repoconfig.go`: Added MySQL connection pool configuration options - mysql_max_open_conns (default: 20) - mysql_max_idle_conns (default: 10) - mysql_conn_max_lifetime_seconds (default: 300) - `repoconfig_test.go`: Added tests for new MySQL config options Users can configure the MySQL registry in feature_store.yaml: ```yaml registry: path: mysql://user:password@localhost:3306/feast_registry mysql_max_open_conns: 20 mysql_max_idle_conns: 10 mysql_conn_max_lifetime_seconds: 300 ``` The Go implementation reads from the same schema as the Python SQLAlchemy registry (sdk/python/feast/infra/registry/sql.py). When the Python schema evolves, the Go queries must be updated. Signed-off-by: PepeluDev <joseluislobell@gmail.com> * docs(go): Clarify MySQL registry store package documentation Signed-off-by: PepeluDev <joseluislobell@gmail.com> --------- Signed-off-by: PepeluDev <joseluislobell@gmail.com>
1 parent 06e0ad8 commit 19f9bb8

File tree

7 files changed

+632
-33
lines changed

7 files changed

+632
-33
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.43.3
1313
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.3
1414
github.com/ghodss/yaml v1.0.0
15+
github.com/go-sql-driver/mysql v1.8.1
1516
github.com/golang/protobuf v1.5.4
1617
github.com/google/uuid v1.6.0
1718
github.com/mattn/go-sqlite3 v1.14.23
@@ -40,6 +41,7 @@ require (
4041
cloud.google.com/go/compute/metadata v0.9.0 // indirect
4142
cloud.google.com/go/iam v1.5.3 // indirect
4243
cloud.google.com/go/monitoring v1.24.2 // indirect
44+
filippo.io/edwards25519 v1.1.0 // indirect
4345
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect
4446
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 // indirect
4547
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 // indirect
@@ -81,7 +83,7 @@ require (
8183
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
8284
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
8385
github.com/klauspost/asmfmt v1.3.2 // indirect
84-
github.com/klauspost/compress v1.17.9 // indirect
86+
github.com/klauspost/compress v1.18.0 // indirect
8587
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
8688
github.com/mattn/go-colorable v0.1.13 // indirect
8789
github.com/mattn/go-isatty v0.0.20 // indirect

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ cloud.google.com/go/storage v1.58.0 h1:PflFXlmFJjG/nBeR9B7pKddLQWaFaRWx4uUi/LyNx
2020
cloud.google.com/go/storage v1.58.0/go.mod h1:cMWbtM+anpC74gn6qjLh+exqYcfmB9Hqe5z6adx+CLI=
2121
cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4=
2222
cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI=
23+
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
24+
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
2325
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 h1:UQUsRi8WTzhZntp5313l+CHIAT95ojUI2lpP/ExlZa4=
2426
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0/go.mod h1:Cz6ft6Dkn3Et6l2v2a9/RpN7epQ1GtDlO6lj8bEcOvw=
2527
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 h1:lhhYARPUu3LmHysQ/igznQphfzynnqI3D75oUyw1HXk=
@@ -110,6 +112,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
110112
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
111113
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
112114
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
115+
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
116+
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
113117
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
114118
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
115119
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -135,8 +139,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnV
135139
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs=
136140
github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4=
137141
github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE=
138-
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
139-
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
142+
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
143+
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
140144
github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
141145
github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
142146
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=

0 commit comments

Comments
 (0)