Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
cinci zoo sniper
Mar 15, 2013




Kilometres Davis posted:

To each their own I suppose, entertaining and thought provoking works for me.

for me that works too

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
they’re good posts, I read them, but I understand why not everyone would bother!

MononcQc
May 29, 2007

anthonypants posted:

yes, this is why your argument is loving stupid when you're trying to compare it to sql vs nosql. if the user can't decide whether they want the green one or the orange one, or if the nurse hasn't sent the prescription from the doctor's office to the pharmacy yet, that's not what you'd call an inconsistency as it relates to databases.

my argument in a nutshell (and non-condescendingly) is this:
  • The inconsistencies the users perceive can run much deeper than what the software exposes. They include realities of communication processes between people who interact with each other as well as with the system
  • Inconsistencies can also arise on the technical components of the system we often conveniently disregard as not being part of the system itself (clients, sensors, etc.)
  • Sticking with SQL when the problems your users and tech stack face are deeply inconsistent means you might be locking down on a model that is not as adjusted to the problem domain as you could have otherwise chosen
  • The additional complexity of coping with the system's maladjustment to the real world is pushed onto the users, who evolve coping mechanism and procedures to keep repairing what the maladjusted system does, and could instead have benefited from a better solution that helps them had the tech folks taken a more holistic view.
That's it.

In the spirit of conciseness (read this post, skip the rest), here's a reworked list of examples of real systems where non-relational and non-ACID semantics can be important and embracing that fact could yield better experiences to users:
  • log and ledger-like structures that can better show the history of decisions made by people (and their conflicts), as well as keep track of further edits and corrections brought by themselves or other practitioners, as opposed to showing a more final case in isolation from which users have to reverse-engineer how the state came to be what it is
  • event-based systems where time-series and ability to query ranges efficiently may work better over a log-merge immutable structure than over a SQL engine's b-tree if only in terms of efficiency
  • graph storage and querying, representing loosely-structured many-to-many relationships with possibly widely incoherent levels (i.e. an area may have a city -> province -> country relationship and another one arrondissement -> commune -> department -> region -> country), which exposed to an app means the system better adapts to circumstances of the real world unexpected by the devs, but encountered by the users frequently
  • source control tools, which allow the users to resolve state conflicts on the client side when they started diverging from the server (unlike say a blog post edit where if two edits conflict, one always crushes the other and you lose what you had written) and can keep an annotated history of changes and move forwards and backwards in time with them

cinci zoo sniper
Mar 15, 2013




MononcQc posted:

my argument in a nutshell (and non-condescendingly) is this:
  • The inconsistencies the users perceive can run much deeper than what the software exposes. They include realities of communication processes between people who interact with each other as well as with the system
  • Inconsistencies can also arise on the technical components of the system we often conveniently disregard as not being part of the system itself (clients, sensors, etc.)
  • Sticking with SQL when the problems your users and tech stack face are deeply inconsistent means you might be locking down on a model that is not as adjusted to the problem domain as you could have otherwise chosen
  • The additional complexity of coping with the system's maladjustment to the real world is pushed onto the users, who evolve coping mechanism and procedures to keep repairing what the maladjusted system does, and could instead have benefited from a better solution that helps them had the tech folks taken a more holistic view.
That's it.

In the spirit of conciseness (read this post, skip the rest), here's a reworked list of examples of real systems where non-relational and non-ACID semantics can be important and embracing that fact could yield better experiences to users:
  • log and ledger-like structures that can better show the history of decisions made by people (and their conflicts), as well as keep track of further edits and corrections brought by themselves or other practitioners, as opposed to showing a more final case in isolation from which users have to reverse-engineer how the state came to be what it is
  • event-based systems where time-series and ability to query ranges efficiently may work better over a log-merge immutable structure than over a SQL engine's b-tree if only in terms of efficiency
  • graph storage and querying, representing loosely-structured many-to-many relationships with possibly widely incoherent levels (i.e. an area may have a city -> province -> country relationship and another one arrondissement -> commune -> department -> region -> country), which exposed to an app means the system better adapts to circumstances of the real world unexpected by the devs, but encountered by the users frequently
  • source control tools, which allow the users to resolve state conflicts on the client side when they started diverging from the server (unlike say a blog post edit where if two edits conflict, one always crushes the other and you lose what you had written) and can keep an annotated history of changes and move forwards and backwards in time with them

now this is a good read, thanks!

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
distributed systems without the possibility of durability are really hard to build and trying to reason through all the edge cases without having had the experience of working on them and watching how and where they can fail is akin to trying to teach a fish how to ride a bike

or trying to teach shaggar anything

Bloody
Mar 3, 2013

distributed systems are cool but watching people slowly rediscover important tidbits (like cap) is very painful

Progressive JPEG
Feb 19, 2003

cassandra lets you configure replication on a per-table basis, and consistency on a per-query basis. as a result its docs give pretty good coverage of different behaviors you could get across different configurations in an ACID context:
- overview of consistency tuning
- list of consistency levels

so for example, lets say there was a table ('keyspace') that's configured with replication = 3. the writers can tune their durability, and the readers can tune their consistency:

the writer could be configured to wait for 1, 2, or 3 nodes to have the data before a given write operation is considered complete
- 1 (high availability, low consistency/durability): the writer could be configured to only write to the nearest node and then return. the data is then replicated to two other nodes in the background.
  - if the node receiving the data crashes before the data is replicated, the data is silently lost (where the writer is concerned)
  - if two of the three nodes were down during the write, then the write is still going to succeed, but if that remaining node goes down then the data is again silently lost
- 2: the writer writes to two nodes before returning, and then the data is written to the third node in the background
  - if only one of the two nodes goes down, the replication completes to the third node and the data survives
  - any writes will automatically fail if two of the three nodes are down at a time
- 3 (low availability, high consistency/durability): the writer waits for all three nodes to have the data before returning
  - if any of the nodes crashes, the writer is notified and can try again
  - any writes will automatically fail if any of the three target nodes is down

the reader can similarly be configured to query 1, 2, or 3 nodes before assuming that the result is correct:
- 1 (high availability, low consistency): the reader just checks with one of the three nodes, and returns whatever it said
  - the result may be out of date depending on the last time that node was updated
- 2: the reader returns the result that two of the three nodes agrees is the right answer (quorum)
  - one of the three nodes can be down, as long as the other two agree on the answer. if they dont agree then the read fails
  - if two of the three nodes is down then the read fails
- 3 (low availability, high consistency): the reader returns the result that all three nodes agree is the right answer
  - results are only returned if all three nodes agree
  - if any of the three nodes is down, all reads fail

any of the above permutations may make sense depending on the context of what you're doing, and what you want to have happen when nodes fail

oh and this is all done in cassandra's sql-like query language

disclaimer: its been a while since i looked at cassandra specifically so the above probably has a bunch of inaccuracies but you get the idea

Shaggar
Apr 26, 2006

Progressive JPEG posted:

eh that stuff is v complicated so i think the length is warranted, and its good material despite the condescending start


oic. given how busted merging anything is in svn, i'd have assumed its users would be even more knowledgeable than git users about the perils of inconsistent state

uncommitted code is not valid code. git adds a bunch of uncertain state by giving you no authoritative repo so everyone's repos are both correct and wrong at all times. with subversion there is one authoritative repo and everyone else is wrong. You can make changes to the authoritative repo to change its state, but whatever its state is is always correct. branching is included in the state of the repo.

Shaggar
Apr 26, 2006
eventual consistency is fine for a lot of stuff as long as the delay is acceptable for the use case. ex: atm withdrawls (or card payments in general) can be eventually consistant because the money going in and out isn't critical and/or the consumer has been informed of the delay. eventual consistency doesn't work at all for something like an inventory system where the delay can and will result in overutilization of inventory during peak usage. At that point delaying the user's ability to access the inventory through apparent application slowness is more acceptable than promising the user an item you don't actually have in inventory.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


lmao

https://www.rockpapershotgun.com/2018/07/14/a-single-typo-wrecked-aliens-colonial-marines-and-people-are-handling-it-fine/#more-566113 posted:


Inside your games config file (My Document\My Games\Aliens Colonial Marines\PecanGame\Config\PecanEngine.ini) is the following line of code :

ClassRemapping=PecanGame.PecanSeqAct_AttachXenoToTether -> PecanGame.PecanSeqAct_AttachPawnToTeather

I’m sure you’ll notice the spelling mistake

ClassRemapping=PecanGame.PecanSeqAct_AttachXenoToTether -> PecanGame.PecanSeqAct_AttachPawnToTether

If you fix it to look like the above and then play the game, the difference is pretty crazy!

...

“Knowing full well how absurd this sounds on the surface, I took it upon myself to reinstall the PC version of the game, look at the .ini file and check myself. Sure enough, a single letter typo was found exactly where he claimed. I was in disbelief. As recommended, I fixed the typo, saved it in Notepad and booted the game up.

“The improvement is immediately recognisable in your first encounters with the Xenos. While they still charge you perched on their hind legs, they now crawl far more often, flank you using vents and holes in the environment and are generally far more engaged and aggressive. Five years after release, a single letter managed to overhaul the entirety of the enemy AI behaviour in the game.”


who defines AI behaviour in an ini file???

Chalks
Sep 30, 2009

Powerful Two-Hander posted:

lmao



who defines AI behaviour in an ini file???

It's not even that AI weights were defined in an ini file, it was some inheritance thing where apparently if you inherit something that doesn't exist everything just carries on without any errors.

Good job to the developer who's job it was to program this behaviour and managed to overlook the fact that it was literally never getting executed.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Chalks posted:

It's not even that AI weights were defined in an ini file, it was some inheritance thing where apparently if you inherit something that doesn't exist everything just carries on without any errors.

Good job to the developer who's job it was to program this behaviour and managed to overlook the fact that it was literally never getting executed.

i guarantee you that somewhere in the actual code base there's something like:


code:

Switch(typeof(config.aimapping)
Case
....
Default:
//todo is this an exception? 
Break;

kugutsu
Dec 31, 2008
it's common to define ai behaviors in data files, e.g behavior trees, and you don't really want the whole game to grind to a halt every time someone makes a typo in a single data file. not being attached to a tether might well be a perfectly valid state for xenomorphs or other enemies in some cases, as well

it may well have spit out an error message on dev builds for all we know, but from everything I've heard about the development of that game it would have been one of ten thousand different errors they were trying to deal with and shove the game out the door before they got sued

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
Love when the worst programmers in the thread call posts by the best programmers "loving stupid" to excuse themselves from ever learning anything.

akadajet
Sep 14, 2003

a guy at work is taking the whole code review thing seriously and is giving me good feedback. i've never had this happen before.

jony neuemonic
Nov 13, 2009

akadajet posted:

a guy at work is taking the whole code review thing seriously and is giving me good feedback. i've never had this happen before.

cherish them. good feedback is real hard to come by.

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

jit bull transpile posted:

Love when the worst programmers in the thread call posts by the best programmers "loving stupid" to excuse themselves from ever learning anything.

hmm... i don't remember calling any posts "loving stupid"

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine

jit bull transpile posted:

Love when the worst programmers in the thread call posts by the best programmers "loving stupid" to excuse themselves from ever learning anything.

Progressive JPEG
Feb 19, 2003

akadajet posted:

a guy at work is taking the whole code review thing seriously and is giving me good feedback. i've never had this happen before.

always good to have a couple of those around for when youre doing something that feels iffy

more likely than not theyll have an idea on how to at least make it less iffy

cinci zoo sniper
Mar 15, 2013




Fiedler posted:

hmm... i don't remember calling any posts "loving stupid"

Xarn
Jun 26, 2015

jit bull transpile posted:

Love when the worst programmers in the thread call posts by the best programmers "loving stupid" to excuse themselves from ever learning anything.

But I don't remember you calling any of the posts "loving stupid". :shrug:

Chalks
Sep 30, 2009

kugutsu posted:

it's common to define ai behaviors in data files, e.g behavior trees, and you don't really want the whole game to grind to a halt every time someone makes a typo in a single data file. not being attached to a tether might well be a perfectly valid state for xenomorphs or other enemies in some cases, as well

it may well have spit out an error message on dev builds for all we know, but from everything I've heard about the development of that game it would have been one of ten thousand different errors they were trying to deal with and shove the game out the door before they got sued

Yeah, but it was someone's job to assign this behaviour and not noticing that it did literally nothing at all seems like a pretty big oversight - not to mention the QA process not flagging this behaviour and/or the developers not noticing this problem.

It's not like this is one random NPC, it's the behaviour for pretty much every enemy in the game.

gonadic io
Feb 16, 2011

>>=

Chalks posted:

Yeah, but it was someone's job to assign this behaviour and not noticing that it did literally nothing at all seems like a pretty big oversight - not to mention the QA process not flagging this behaviour and/or the developers not noticing this problem.

It's not like this is one random NPC, it's the behaviour for pretty much every enemy in the game.

what's a qa process?

cinci zoo sniper
Mar 15, 2013




cjs: im dumping ad hoc tables from our dwh locally to my machine since we apparently have no backups in place for our dwh :stonklol:

CPColin
Sep 9, 2003

Big ol' smile.

gonadic io posted:

what's a qa process?

Not much, what's a qa process with you?

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
I really like the discussion about consistency vs. availability and I agree that kneejerk reductive thinking is a bad thing, usually.

But jfc mongo is such a loving joke. It's held up as the poster child of NoSQL and there are so many better implementations. Mongo has had issues beyond just inconsistency, and if I was working or interviewing somewhere that was using mongo in production for anything remotely important I would just walk out.

MononcQc
May 29, 2007

MongoDB is to NoSQL what MySQL is to SQL.

Shaggar
Apr 26, 2006
nah MySQL can be used successfully for basic stuff even if there are better options.

cinci zoo sniper
Mar 15, 2013




mysql 8 is usable, in the broadest sense of that word, yea. still have no idea why would you use it over postgres

MononcQc
May 29, 2007

Stripe uses MongoDB in prod. Mongo can be configured with different storage engines, and while I wouldn't use it anyway, they have made improvements since the first version that used MMAPed files for storage (which is now deprecated) and have moved to an MVCC journaled (checkpointed) storage that can support at-rest encryption and compression. It's still not the safest thing for data integrity, but given enough years, their tech is slowly narrowing the gap with their marketing material. Like it's not great, but it's not as stunningly bad as it used to be.

Uber made a definite choice to switch from Postgres to MySQL because the k/v pattern they had with it is better served by the MyISAM storage of MySQL than Postgres' MVCC for what they do with it.

gonadic io
Feb 16, 2011

>>=
Tps:

I have a program which reads from a ttyUSB running inside a docker container. I have another docker container which uses pymodbus to write to a tty. How can I get the two to talk to each other? As far as I can tell docker compose's --volumes don't work for /dev and --devices only shows the device to the host which is an issue because osx devices are different from the Linux container devices? Idk my other option is running integration tests with two physical pis

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man
run integration tests with two physical pis. especially if it involves their lovely USB ports. sorry

cinci zoo sniper
Mar 15, 2013




MononcQc posted:

Uber made a definite choice to switch from Postgres to MySQL because the k/v pattern they had with it is better served by the MyISAM storage of MySQL than Postgres' MVCC for what they do with it.
interesting

jony neuemonic
Nov 13, 2009

yeah new relic also consciously chose mysql, iirc it was for ease of sharding? there are valid use cases for mysql, it’s just a lousy default choice.

MononcQc
May 29, 2007


I was wrong, they're using InnoDB instead of MyISAM.

Uber blog post on the topic: https://eng.uber.com/mysql-migration/
Postgres Response: http://thebuild.com/presentations/uber-perconalive-2017.pdf

to be noted that iirc MySQL had [for some use cases] better replication mechanisms than Postgres until its latest stable releases. Postgres would use WAL or physical replication using direct block addresses and couldn't do logical replication (based on primary keys) until the latest release, which meant any Postgres switch between major versions had a mandatory downtime period, since you couldn't just do a master (old version) -> follower (new version) switchover on anything other than point releases given they'd change the physical format between major releases. Version 10 fixes that, which was a major hurdle for people wanting to use postgres in environments with high reliability since SLAs could force you onto older versions unless someone broke a server/instance and you could use that downtime as an excuse to do an upgrade.

MononcQc fucked around with this message at 16:48 on Jul 16, 2018

cinci zoo sniper
Mar 15, 2013




MononcQc posted:

I was wrong, they're using InnoDB instead of MyISAM.

Uber blog post on the topic: https://eng.uber.com/mysql-migration/
Postgres Response: http://thebuild.com/presentations/uber-perconalive-2017.pdf

to be noted that iirc MySQL had [for some use cases] better replication mechanisms than Postgres until its latest stable releases. Postgres would use WAL or physical replication using direct block addresses and couldn't do logical replication (based on primary keys) until the latest release, which meant any Postgres switch between major versions had a mandatory downtime period, since you couldn't just do a master (old version) -> follower (new version) switchover on anything other than point releases given they'd change the physical format between major releases. Version 10 fixes that, which was a major hurdle for people wanting to use postgres in environments with high reliability since SLAs could force you onto older versions unless someone broke a server/instance and you could use that downtime as an excuse to do an upgrade.

this is some interesting stuff. need to put some time off to read it proper since all this low level db stuff is not something im too familiar of. thanks for the links!

gonadic io
Feb 16, 2011

>>=

Phobeste posted:

run integration tests with two physical pis. especially if it involves their lovely USB ports. sorry

:(

no but I nearly had it with a third container which ran socat!!!

love ending a day with git reset --hard back to the start of the day

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

gonadic io posted:

love ending a day with git reset --hard back to the start of the day
if it makes you feel any better it looks like github is down right now

cinci zoo sniper
Mar 15, 2013




anthonypants posted:

if it makes you feel any better it looks like github is down right now

really hard reset

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
ctps: had a breakdown and quit my job because I can't face writing another CRUD api (it's still boring no matter how many monads you unnecessarily involve). I've become very interested in doing systems programming (thanks to rust) and I have enough funds to spend ~ 1 year focusing on reorienting my career.

I have no illusions that I'll be able to find a non-dubious rust job, so I'm going to be starting on C++ for the first time -- which I'm pretty excited about. I'm also going to be working through "The Linux Programming Interface" which I own but haven't spent a significant amount of time on. I'm also going to be rigorously studying my algorithms and stuff. Plus working on other goals that I haven't really nailed down yet (part of my motivation for this post).

I also really need to work on nailing down exactly what doing "systems programming" means to me. I don't necessarily mean I want to do work on the linux kernel or embedded. I may be happier working on anything that's slightly "closer to the metal," even if I'm still mostly in the web domain. So yeah, need to nail this down.

  • Locked thread