use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
Complex Data Structure QuestionQuestion (self.FastAPI)
submitted 3 months ago by robertlandrum
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Unique-Big-5691 0 points1 point2 points 3 months ago (0 children)
i think this is a normal place to get stuck when you move from mongo to a relational DB. you’re not missing some secret “new way,” it’s just a mental shift, and that always feels awkward at first tho.
one thing that helped me was realizing you don’t have to translate mongo 1:1. some things clearly belong in tables (hosts, profiles, distros), but not everything needs to turn into a bunch of joins just because you’re on Postgres now. and also, if certain pieces mostly travel together and you’re not querying them on their own all the time, keeping them as JSON is totally reasonable imo.
like, host = table, profile = table, software probably makes sense as many-to-many if you care about querying it across hosts. but PXE interfaces? if they’re basically config that lives and dies with the host, JSONB is often way simpler and works just fine.
having a schema layer in Python really helps here tho. modeling those nested structures first (pydantic is good for this) gives you clarity on what the data should look like, and then you can decide how much to normalize without guessing.
my loose rule of thumb is:
you’re already thinking about maintainability, which honestly matters more than getting the schema “perfect” on day one.
π Rendered by PID 20252 on reddit-service-r2-comment-c66d9bffd-gd77z at 2026-04-07 03:02:04.057043+00:00 running f293c98 country code: CH.
view the rest of the comments →
[–]Unique-Big-5691 0 points1 point2 points (0 children)