Best Way to Store and Update a Large JSON File?

0
37
Asked By CraftyBird88 On

I'm building a canvas editor and run into a challenge with storing a large JSON file that's about 50MB in size. The key issue is that I need to frequently mutate small parts of this JSON with minimal cost. I'm debating whether to store it in a database or in object storage (OSS). What would be the best approach for handling this scenario?

4 Answers

Answered By CleverCodeFox On

I feel like it depends on how often you're mutating it. For frequent small updates, a database is the way to go. But if you're making batch updates less often, maybe consider flexible object storage.

WidgetMan123 -

So you're saying a hybrid approach could work?

CleverCodeFox -

Totally! A combination of both methods could help you manage the balance between speed and storage efficiency.

Answered By SunnySideCoder21 On

If you're handling large JSON files like this, think about using a database, especially one that supports JSON types. Databases can handle updates more efficiently compared to object storage since you'd avoid downloading the entire file for small changes.

DataNerd2023 -

This makes sense! But how do you deal with the size limits of certain databases? Like, I heard that MongoDB has a limit on document size.

SunnySideCoder21 -

Good point! You might need to break your JSON into smaller documents for optimal performance—especially if one part is more frequently updated.

Answered By TechSavvyTurtle On

Using a document database could be a good fit here. They allow for partial updates right within the document, so you can change just the part of your JSON that you need, without rewriting everything.

CuriousCoding123 -

That could save a lot of time! But what about the database size limits?

TechSavvyTurtle -

Exactly, you'd just need to manage the size by splitting larger JSON into manageable chunks.

Answered By MysteryDev99 On

Honestly, have you thought about breaking the JSON into multiple tables or using a more structured approach? It could simplify how you store modifications and snapshots separately, so you're not working with that giant blob all the time.

HopefulHacker74 -

That's a solid suggestion! Splitting it could definitely improve performance.

MysteryDev99 -

Right? And you can create relationships in tables that make sense for your app's needs.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.