Redesign with FastAPI and a simple event sourced model#167
Draft
kiancm wants to merge 50 commits intocomocheng:masterfrom
Draft
Redesign with FastAPI and a simple event sourced model#167kiancm wants to merge 50 commits intocomocheng:masterfrom
kiancm wants to merge 50 commits intocomocheng:masterfrom
Conversation
now models are: * hashable * comparable * frozen * JSON serializable * collections are frozen sets with constraints (confrozenset)
Member
|
Looks intriguing. Can you put some explanation in the pull request description? |
Member
|
OK... reading about FastAPI I can see some nice reasons to use it. What would we use for the front end UI? |
Contributor
Author
|
I think this is a good idea because the front end can rely on the API for presentation, so we can choose any frontend framework we like. Like Django, FastAPI also supports HTML templating, so we can still do that if we want. I think for now I will focus on the API and backend |
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
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.
What
This change redesigns the project with the FastAPI framework for significantly faster and simpler iteration. To start, data is structured as a simple collection of denormalized kinetic models, represented by a hierarchy of pydantic types (which are fully JSON-serializable) with application-level field validation.
Why
This design also makes the assumption that most kinetic model data will be ingested in bulk through scripts or perhaps a data pipeline. By storing a log of kinetic models added we can focus on validating kinetic models in isolation and gain the flexibility of a working set of data that we can manipulate into useful views for the API and for analytical purposes.
Next Steps
We will need to think of views and storage technologies that are useful for the API and a read model for the data that is useful for ad-hoc querying that the SQL schema from before was also intended for.