this post was submitted on 28 Mar 2025
33 points (100.0% liked)
Programming
19290 readers
148 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would separate concerns. For the scraping, I would dump data as json onto disk. I would consider the folder structure I put them into, whether as individual files, or a JSON document per line in bigger files for grouping. If the website has good URL structure, the path could be useful for speaking author and or id identifiers in folders or files.
Storing json as text is simple. Depending on the amount, storing plain text is wasteful, and simple text compression could significantly reduce storage size. For text-only stories it's unlikely to become significant though, and not compressing makes the scraping process, and potentially validating completeness of scraped data simpler.
I would then keep this data separate from any modifications or prototyping I would do regarding modification or extension of data and presentation/interfacing.
After reading some of the other comments, I'm definitely going to separate the systems. I'll use something like json or yaml as the output for the raw scraped data, and some sort of database for the final program.