Skip to content
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

Refactor camouflage data structure #38

Closed
carlssonemil opened this issue Nov 28, 2022 · 4 comments
Closed

Refactor camouflage data structure #38

carlssonemil opened this issue Nov 28, 2022 · 4 comments
Labels
icebox Issues or features that should be addressed at a much later date

Comments

@carlssonemil
Copy link
Owner

As discussed in #34 ideally we should refactor the data structure of the camouflages (and preferably the weapons too) by adding unique IDs to completely circumvent the possible name-change (or misspell) issues that might arise down the line.

Preferably this new structure would have some sort of logic to handle IDs automatically so we won't have to manually keep track when adding new camouflages, or weapons.

Maybe even going as far as adding a completely separate Postgres database instance to handle all data-storage (except progress) for us, with an API that fetches all available data upon page load? Adding a database will make it harder to contribute changes though 🤔

Putting this in the backlog for now for future reference.

@carlssonemil carlssonemil added the icebox Issues or features that should be addressed at a much later date label Nov 28, 2022
@sol3uk
Copy link
Contributor

sol3uk commented Nov 28, 2022

To be fair, hosting a DB is taking everything to the next level and incurs additional complexity (storing and deploying secrets, managing DB uptime and query speed), cost and legality (storing user data, keeping it "anonymous", GDPR etc) which I've always tried to avoid with side projects and never actually got around it doing in most cases. And because most recently heroku have stepped down from offering DB hosting, it's clear that the market for free DB hosting is getting less, soon we might not have much choice for free DB hosting at all.

So since this app will only have a fixed number of camouflages in it's lifetime, I would suggest keeping with the fixed file storage you already have.

In terms of ID's, we wouldn't really need to auto-gen them on every add (how often would that really be anyway? maybe 1-2 new weapons per quarter, maximum?), we can generate them in bulk and attach them to the data models manually. In the past I have used an ID system like nanoId to generate really small (5-6 character long), user friendly IDs that aren't a hassle and still have a miniscule chance of duplication.

@sol3uk
Copy link
Contributor

sol3uk commented Nov 28, 2022

If a worry is contribution and making it easy, I know it sounds stupid but something as simple as google sheets is actually an option. Probably the simplest solution next to a normal document store. I wouldn't use an SQL DB for this really, there's not enough complexity in the entity relationships to justify it.

@carlssonemil
Copy link
Owner Author

We would only host the default data, not the user's progress. It sucks that Heroku has turned off their free-tier but there are still free alternatives. But yes, I agree with you completely. We should probably be fine just having simple numerical IDs as well, but nanoid is a good alternative!

@sol3uk
Copy link
Contributor

sol3uk commented Nov 28, 2022

Yeah I assumed the default would be fine by itself, but didn't want to assume that would be all you would want to do!

I had ideas previously for other apps of wanting to be able to store user progress anonymously as a shared "magic link" style system, where a user would have a store ID assigned to them when they began saving progress, then that would be parsed into maybe their unique progress "link" in another URI which would be a super simple document store which could be accessed by any client with the ID and sync up/share progress. It wouldn't inherently link any user data to any person (avoiding legality and complexity for things like user profiles), but would still give people a way to share progress between clients (i.e. web, tablet, mobile, or even between users)

@carlssonemil carlssonemil closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
icebox Issues or features that should be addressed at a much later date
Projects
None yet
Development

No branches or pull requests

2 participants