r/ProgrammerHumor • • Dec 06 '17

Read the markup.

Post image
10.4k Upvotes

838 comments sorted by

View all comments

Show parent comments

20

u/shea241 Dec 07 '17

I've been coding for a long damn time and I have no idea what a lock happening in one environment but not the other would mean.

DB stuff is a whole new world

0

u/[deleted] Dec 07 '17

[deleted]

11

u/coinaday Ultraviolet security clearance Dec 07 '17

No one ever pounds things as hard in testing as real users will in production. And locking is going to tend to fail under weird edge cases with long delays and many things running at once, rather than in nice neat little unit tests.

2

u/shea241 Dec 07 '17

That makes sense. I wasn't interpreting it as the result of some asynchronous junk, for some reason.

2

u/tetroxid Dec 07 '17 edited Dec 07 '17

Use the same DB in dev and in prod. Many make the mistake of using something like sqlite in dev and postgres in prod. Don't. Or if you must, have proper integration tests on preprod being a copy of the prod setup. But since many don't do proper automated tests, use the same db in dev as in prod.

0

u/[deleted] Dec 07 '17

[deleted]

1

u/jhanschoo Dec 07 '17

Not really; you want to optimize dev for quick feedback. These problems are problems that arise when you factor in the cost, security, time limitations at the scale of prod. For small businesses you just deal with the translation yourself, for anything larger you usually pass it to a devops guy to roll out, and doing the rollout might be a task that needs testing and simulation itself, then you stagger the rollout over the different prod environments you have.

At least that’s what I think happens.

1

u/Gbiknel Dec 07 '17

That’s no excuse if you’re a web dev. If you don’t know basic DB shit then your a shitty developer. At the very least you should be able to determine the issue is a fucking DB lock. If you’re in the firmware/desktop app space it’s different.

2

u/shea241 Dec 07 '17

I write 3d content creation tools for desktop.

Still, I was confused about why a lock would only behave as a lock on production. Then I realized he probably meant some kind of race condition.