yahoo / fili

Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and SQL Databases.
http://fili.io
Apache License 2.0
173 stars 96 forks source link

Dimension Restructure RFC #713

Open michael-mclawhorn opened 6 years ago

michael-mclawhorn commented 6 years ago

Dimension Restructure RFC

Dimensions in 0.9 and before have several responsibilities. They serve as a config entity for table schemas and representing metadata. They are used as the hook for query serialization. They serve as a client for dimension value (domain) loading. They act as a gateway to search dimension values.

This refactor is oriented toward simplifying and structuring Dimensions. The existing Dimension interface will continue to provide the core access point for query and schema planning.

New interfaces:

DomainSchema/ApiDimensionSchema: Anything to do with dimension fields.

DimensionDescriptor: Name, description, category, etc.

Domain: Schema, cardinality, finderByKey

IndexedDomain: Domain, findByFilters, findAll

MutableKeyValueStore: not all KVS are mutable by default anymore

cdeszaq commented 6 years ago

Major +1 for the more type-driven "no count" concept and general "immutable unless named otherwise" notions.

The "New interfaces" summary section at the bottom is great, but could you expand it with the existing dimension (or otherwise participating / changing) interfaces so that the full scope of the change and responsibilities are more clear? A diagram may help, but I think the text of interface names and summary of what it is / owns is enough.

Calling out the "indexed" notion as surfacing the behaviors of being searchable is great.

The fact that DimensionDescriptor is essentially just metadata doesn't come through clearly enough (ie. I'm not 100% sure that's it's job), and I'm also not clear on if it applies to Dimension or Domain.

Making the distinction between Dimension and Domain, and how they relate, that will exist due to this RFC would be good. It's in there I think, but I'm having trouble getting it clear in my head.