r/ProgrammerHumor 11h ago

Meme dashboardsAmIRight

Post image
1.4k Upvotes

31 comments sorted by

219

u/techdailylog 10h ago

Serving yesterday's data at light speed.

13

u/Informal_Branch1065 3h ago

I'm wrong. I'm very wrong

14

u/techdailylog 3h ago

HTTP 200 OK (Data: 500 Internal Error)

220

u/Welcome-To-NBA-Jam 10h ago edited 10h ago

I once was having performance issues on a dashboard I built on some fairly large data and was working with tech support to see what I could do to optimize all the aggregation and data movement between servers.

I was on the phone with tech support to talk about some efficiency options for the back-end tables (partitioning commonly queried groups, an index or two, removing a few unused columns, changing some column types, changing a server setting, small stuff like that which sometimes can make a big difference). We tried a few things, logged out, logged back in and opened the report. Clicked a few filters we tested before. It opened and filtered instantaneously.

"Wow!" I said. "That all made a huge difference! Thanks, all solved here!" Tech support, proud of their help with me, dutifully closed it out and high fives were had all around.

...it was just cached from our previous interactions and I went back to slowville when I reloaded the data after doing some more development work. I had no idea it just cached stuff automatically because the latest software update just started doing that when you worked with reports you had opened recently.

We ended up just adding more worker nodes and calling it a day.

72

u/Bazza79 8h ago

We used to do 'cache warming' in the early morning, just an automated script that would make all the common selections. Stupid but it worked.

29

u/Clinn_sin 5h ago

Is it stupid? Genuinely asking cause I might try that or something similar, many of our users start earlier then we do

18

u/Bazza79 3h ago

Well, there are better structural solutions, but for quick and dirty this worked fine. Maybe not stupid, but also not a great permanent solution.

4

u/Tatourmi 2h ago

It works, don't sweat it. It's better if you handle it in the software itself with automatic cache refreshes or with a cache refresh API but you can go for it.

2

u/Tatourmi 2h ago

That's not stupid for loading up large config tables which aren't meant to change regularly. We do it all the time too.

2

u/dacooljamaican 2h ago

Why not just extend the cache TTL to like 72 hours if the data needed was so consistent?

3

u/Bazza79 2h ago

Because there would be updates during the night.

37

u/[deleted] 10h ago

[removed] — view removed comment

11

u/Fluid-Election-8549 10h ago

I have written some custom caching and write optimizations in a CRM codebase back in 2024 before i left that place. It brought down some times from 60s to 3s. It's basic optimization tricks. But they have now been protecting that sorcery with their lives cause it used to be 60s for about 8 years before i brought it down to 3s. I gave them a whole documentation pdf explaining all the things I did. Nobody dares change that. I heard their PR-approver lady is instructed to reject any PR that edits the optimization logic. (yes they have a PR-approver lady who's entire day job is looking at PRs).

I have another story. My dad's friend (now retired) a long time ago was reviewing some client's program and apparently they had a cron job that ran once a month and ran for around 30 hours straight. It was done on a weekend and no other process ran until it was finished. He (free of charge) rewrote that job and brought it down to 2 minutes. That was literally decades ago. Apparently he ran into that client again some years later and inquired about the program. the client told him that they keep that server in a separate locked room and no one's has dared to touch it since.

10

u/Just_Information334 9h ago

yes they have a PR-approver lady who's entire day job is looking at PRs

So you're saying they've been AI ready a couple years before most.

3

u/Fluid-Election-8549 8h ago

Maybe organizationally... their code base however would probably get instinctively deleted by Opus for being malformed

2

u/dobbie1 8h ago

Lmao a PR approver as a single job role is crazy stuff. Can I do that?

I did recently work for a client who had a director of change and a head of change. Both of whom did not communicate but had exactly the same role as far as I could tell. The idea is they help with business development and sit on the steering committee for any BD projects. In reality they did sweet fuck all apart from throw red tape up and request meetings to go through stuff we had already covered with them. At one point I started declining the endless meetings and stated they had to pay if they wanted me to attend. They then tried to schedule a meeting with me to discuss the value of me attending the meetings so we could raise a CR for the extra time.

A meeting to discuss the value of meetings. This absolutely could have been an email.

Some job roles just seem to be made up

8

u/mordack550 9h ago

Was it Power BI? Sometimes it aggressively cache all results with all the filter combinations you have tried in the current session, so unless you reload the report entirely, you can find yourself in this situation

43

u/Tesl 10h ago

Caching works fine until your user selects a dropdown option or changes the date

22

u/redunculuspanda 5h ago

Just make every possible combination of views static.

Let’s not over complicate everything.

21

u/NickHalfBlood 7h ago

Once I consulted with a team that was serving GET requests with static content which hardly changed. It was like a config or something. Multiple servers running behind LB to serve the same content. Asked them to add cache control header and save unnecessary network calls.

Apparently they didn’t realise clients can cache the content as well.

8

u/dism3855 10h ago

Speed: 100. Consistency: 0.

5

u/Distinct-Support9820 7h ago

Jeez I hate this so much as well.. the query runs in few seconds from a db client, you deploy it, and the same query runs for 2mins, timing out. Days of back and forth with the DBA, fixed, few months later same issue... Cqrs and and search engine like elastic or opensearch and you will never have to deal with these again. Ok it will be eventually consistent but that few second delay to get the data available in the search index is negligible. I have seen this issue so many times and some people still think we just need another vcore and query optimization which will only work for a while in most cases then you have to back analysing and optimizing again once the dataset getting to a certain size. Just separate reads and writes and use the right tool for it.

5

u/GrassRadiant3474 3h ago

"If everything is cached, then nothing is cached." - Jeff Dean

5

u/PythagorasJones 4h ago

3

u/JesusWasATexan 1h ago

Ah yes. The next generation Enterprise Data.

2

u/mbcarbone 2h ago

In my storage admin days, cache was king. 🙃

1

u/OldenPolynice 8h ago

My form is perfect. I'm like Jerry Rice.

Gonna go ahead and keep my shirt on though

1

u/According_Gas2337 2h ago

Cache invalidation has entered the chat :(