-
Notifications
You must be signed in to change notification settings - Fork 12
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
Decide on the data storage management directory name #85
Comments
Can I suggest that this is devolved to technology-specific overlays? Just thinking about Rails and Django, those two alone do quite different things and moving the defaults would be a world of pain and sadness. If it's a question of having a common interface into these things, might we want to think about having standard |
The "technology-specific overlays" is certainly an option. It would be good to chat it through how we would see it working bearing in mind that increasing our range of options may also increase our maintenance burden. One potential solution to manage this could be an automated repository synchronisation via GitHub actions. Alternatively, or in addition to that we could use a tool that merges these layers/overlays together to create a desired template that is applied to a new repository, similar to this one https://start.spring.io/ (this is just an example, as it has slightly different purpose) |
The way I've done it in the past is to provide a CLI tool that Does The Right Thing(™️). That way the user-facing interface is in your control, not a third party's. It can call out to whatever repositories it needs to build the initial structure. The basic structure was a repository full of cookiecutter templates that got merged into a single output directory. That tool was also the entry-point into local docker setup and so on. An example session might look like this:
Again, the benefit of doing it this way is that you can completely abstract away whether someone prefers github+aws or the azure stack other than a flag to Pulling the initial templates into the project is relatively painless: you start with an existing project, rip out anything that isn't infrastructure, apply naming conventions, and add An interface like Maintenance burden is definitely a thing, but it's also unavoidable. There's no one-size-fits-all for issues like this one so we either accept there's going to be a per-tech cost and standardise at the |
Side-stepping the technology-specific overlays conversation above (which feels like it could run for a while) and returning to the naming... This doesn't feel entirely straightforward. I might have prefered datastore over database. Is there any reason why some of the others could be optional directories nested under that ? |
The reason you need the overlays is that it's not something you can sidestep. Again, Rails vs Django as an example:
The difficulty is that because frameworks differ in how much control they assume over your database schema, they also differ in how coupled they are to a specific directory layout. In Django's case, because it generates migrations from models directly, you can't realistically detach the database definition from where the domain logic is defined. It's all under that top-level I just don't think directory structure organisation standardisation can fly as an up-front specification for this specific case. I think it's more tractable to ask what are the operations we want to perform on the database and provide those operations as top-level commands, leaving the specific implementation of those commands to the frameworks. Stealing wholesale from Rails (and deleting some of the more boring ones), a starting point would be:
For projects that aren't on a framework which does those things for them, it's not beyond the bounds of possibility that we could knock up some sort of wrapper for alembic that gets them off the ground (other tools are also available), and that wrapper could use the directory structure above as its own living standard. That's where Footnotes
|
There is no data storage technology endorsed by the repository template. There are options with trade-offs.
Some common directory names for the purpose of managing data storage creation, upgrades and migrations are:
database
: Simple and straightforward name that clearly indicates that the directory contains database-related code.db
: This is a shorter version of the above. Feels lazy.migrations
: If the directory is specifically for managing database upgrades and migrations, this name could be more appropriate. It's commonly used in frameworks like Django and Rails, which have built-in database migration functionality.sql
: If the database code is primarily written in SQL, you might choose this name to indicate the nature of the code but in most cases this would be too narrow.schema
: This could be a good name if the directory contains just the schema definition for your database which is not the case for larger projects.data
: This name might be appropriate if the directory contains not only code but also data files, such as seed data for your database.The text was updated successfully, but these errors were encountered: