Live data from Hacker News

Ask HN: What problem are you close to solving and how can we help?

news.ycombinator.com

21–30 of 486 posts

Re: Ask HN: What problem are you close to solving and how can we help?

#21
post #17
post #10

Earlier quoted context omitted.

I don't know about PG, but with MariaDB, a nice way to find bottlenecks is to run SHOW FULL PROCESSLIST in a loop and log the output. So you see which queries are actually taking up the most time on the production server. If you post those queries here, we can probably give tips on how to improve the situation.

Interesting. I believe I noted a similar function in the Postgres docs I was scouring through Friday. I’ll give it a look and see what I can find. Tangentially related for those who have experience, I am using Django-silk for latency profiling.

also, never trust orms. they make it easier to query but they do not use/output the most optimized quries

Re: Ask HN: What problem are you close to solving and how can we help?

#23
post #20
post #19

Earlier quoted context omitted.

Hangs when I click "Try the example".

Just Refresh the page : it will succesfully play (known bug)

Now it works.

I wish AirBnBs and hotel rooms would offer this type of preview of their premises.

Re: Ask HN: What problem are you close to solving and how can we help?

#24
post #2

We are having atrocious READ/WRITE latency with our PG database (api layer is django rest framework). The table that is the issue consists of multiple JSON BLOB fields, with quite a bit of data— I am convinced these need to be abstracted to their own relational tables. Is this a sound solution? I believe it is the deserialization in these fields of large nested JSON BLOBS that is causing latency. Note: this database…

Are you just doing primary key lookups? If so, a new index won’t do much as Postgres already has you covered there.

If you have any foreign key columns, add indexes on them. And if you’re doing any joins, make sure the criteria have indexes.

Similarly, if you’re filtering on any of the nested JSON fields, index them directly.

This alone may be sufficient for your perf problems.

If it isn’t, then here’s some tips for the blobs.

The JSON blobs are likely already being stored in TOAST storage, so moving them to a new table might help (e.g. if you’re blindly selecting all the columns on the table) but won’t do much if you actually need to return the JSON with every query.

If you don’t need to index into the JSON, I’d consider storing them in a blob store (like S3). There are trade offs here, such as your API layer will need to read from multiple data sources, but you’ll get some nice scaling benefits here and your DB will just need to store a reference to the blob.

If your JSON blobs have a schema that you control, deprecate the blobs and break them out into explicit tables with explicit types and a proper normalized schema. Once you’ve got a properly normalized schema, you can opt-in to denormalization as needed (leveraging triggers to invalidate and update them, if needed), but I’m betting you won’t need to do any denorm’ing if you have the correct indexes here.

And since you have an API layer, ideally you’ve also already considered a caching layer in front of your DB calls, if you don’t have one yet.

Re: Ask HN: What problem are you close to solving and how can we help?

#26
This may already be solved, but one of the last pieces remaining in my quest to be Google-free is an interoperable way to sync map bookmarks (and routes, etc) between different open source mapping apps. I can manually import/export kmz files from Organic Maps and OsmAnd, and store them in a directory synced between different devices with Nextcloud, but there's no automatic way to keep them updated in the apps, and so far I haven't found a great desktop app for managing them either. The holy grail would be to also have them sync in the background to my Garmin Fenix, but I am not aware of a way to sync POIs to a Garmin watch in the background.

Related: I'd love to have an Android app with a shortcut that allows me to quickly translate Google Maps links into coordinates, OSM links or other map links. There is a browser extension that does this on desktop, so if anyone is looking for a low hanging fruit idea for an Android app, this might be a fun idea (if I don't get around to it first).

Re: Ask HN: What problem are you close to solving and how can we help?

#27
We are experiencing very high CPU load caused by tinc [0], which we use to ensure all communication between cloud VMs is encrypted. This is primarily affecting the highest traffic VMs, including the one hosting the master DB.

I am starting to consider alternative tools such us wireguard to reduce load, but I am concerned of adding too much complexity. Tinc's mesh network makes setup and maintenance easy. The wireguard ecosystem seems to be growing very quickly, and it's possible to find tools that aim to simplify its deployment, but it's hard to see which of these tools are here to stay, and which will be replaced in a few months.

What is the best practice, in 2021, to ensure all communication between cloud VMs (even in a private network) is encrypted?

[0]https://www.tinc-vpn.org/

Re: Ask HN: What problem are you close to solving and how can we help?

#29
post #26

This may already be solved, but one of the last pieces remaining in my quest to be Google-free is an interoperable way to sync map bookmarks (and routes, etc) between different open source mapping apps. I can manually import/export kmz files from Organic Maps and OsmAnd, and store them in a directory synced between different devices with Nextcloud, but there's no automatic way to keep them updated in the apps, and so…

Have you documented your replacements for various Google technologies somewhere? I'm particularly interested in a good calendar.

Re: Ask HN: What problem are you close to solving and how can we help?

#30
post #11

How to get my kids to bed to bed.

By no means am I an expert, but just another parent on HN.

1. Ritualize

I notice a pattern with my kids: going to bed is a ritual, and any deviation is reason enough for them to leave the bed.

2. Slow down in advance

Going to bed after playtime is impossible. So cut screens, playtime, play/listen some quiet music, read books or newspaper (again, no tablet/reader), at least 1h before bed time.

3. Recap the day

Remind your kids of their day, activities and make them aware of the fatigue. Works better when in bed, with mine.

4. Stay with them if they're afraid

Learn why they're afraid, teach them why there's no reason to be afraid. I've had to hang a sock to the door every night for months to scare tigers away :D It just works ^^

Every parent knows the pain and every kid has their own back story and the relationship with the parent(s) is key to finding a way into bed.

Eventually, they will sleep.

In our case, we settled that unless exceptional situations, our kids had to fall asleep in their own bed, because we wanted/needed our intimacy. To get that, I had to stay in my kids' room for as long as 2hrs for months, but didn't let go. Today, going to bed is thankfully not a situation anymore.

I'm not sure this is in any way helpful, but here's my shared experience and learnings. YMMV.

Post reply on HN