Thursday, 2014-03-20

*** krotscheck has quit IRC00:29
cody-somervilleOne may be able to make a good argument against using foreign key constraints but I don't think storyboard has a need to be so progressive. Besides, I'd trust the sql server to ensure consistency over vs. the ORM or the scheme migration engine alembic or raw sql statements that might get used to work around ORM limitations/complexity. I think there is something to be said for the data layer protecting it's own consistency and in00:36
cody-somervilletegrity.00:36
cody-somervilleFrankly, data is valuable. It's worth the extra protection. Data usually lasts a longer longer than the application code.00:39
*** miqui has quit IRC02:28
*** david-lyle has joined #storyboard03:50
*** saju_m has joined #storyboard04:12
mordredI'm reading the scrollback in spurts - so my responses may be weird05:17
mordredok. I've read the whole scrollback. I don't think the idea of doing reverse patches on the migrations is a bad one - we aRE still young, and we haven't gotten everything fully right yet05:25
mordredwhile I do think it's valuable to do migrations right now (even though it's painful - we have to learn them at some point) - I don't think we need to stand on principle when we run into something crazy05:26
mordredlike postgres05:26
SergeyLukjanovmordred, ++05:26
mordredas for foreign keys - they're a bad idea for scale05:28
mordredperiod05:28
mordredin the mysql world05:28
mordredhowever - the way I've always wanted to attack that thoguh is to make a patch to sqlalchemy that lets you set an option to not actually emit foreign key DDL for the mysql dialect05:29
mordredI believe they are more important in postgres, so doing deletes in migrations seems likea  lot of work on our part -and I do not believe we're at that scale yet - and we may never be05:30
*** saju_m has quit IRC06:02
*** saju_m has joined #storyboard06:04
*** saju_m has quit IRC06:07
*** saju_m has joined #storyboard06:08
*** saju_m has quit IRC06:35
openstackgerritNikita Konovalov proposed a change to openstack-infra/storyboard: [WIP] Comments controller  https://review.openstack.org/8150507:32
openstackgerritNikita Konovalov proposed a change to openstack-infra/storyboard: [WIP] Comments controller  https://review.openstack.org/8150507:55
*** saju_m has joined #storyboard07:56
*** jcoufal has joined #storyboard08:19
*** hashar has joined #storyboard08:44
*** hashar has quit IRC09:18
*** hashar has joined #storyboard09:38
openstackgerritA change was merged to openstack-infra/storyboard: Added db_api for comments  https://review.openstack.org/8123209:41
*** jcoufal has quit IRC10:06
*** hashar has quit IRC11:16
*** david-lyle has quit IRC11:52
*** saju_m has quit IRC12:09
openstackgerritNikita Konovalov proposed a change to openstack-infra/storyboard: Comments controller  https://review.openstack.org/8150512:10
*** saju_m has joined #storyboard12:26
*** saju_m has quit IRC12:53
*** saju_m has joined #storyboard13:06
*** saju_m has quit IRC13:23
*** saju_m has joined #storyboard13:39
openstackgerritThierry Carrez proposed a change to openstack-infra/storyboard: Remove Branch and Milestone legacy tables  https://review.openstack.org/8156213:44
ttxOK, *that* will hopefully work13:45
*** saju_m has quit IRC13:48
*** hashar has joined #storyboard13:51
openstackgerritThierry Carrez proposed a change to openstack-infra/storyboard: Remove Branch and Milestone legacy tables  https://review.openstack.org/8156213:58
ttxor this.13:58
*** mfer has joined #storyboard14:11
*** jcoufal has joined #storyboard14:16
jeblairmordred: sorry i'm fuzzy on this because i haven't used alembic -- but is the schema always created with alembic?  and in that case, does that mean we can skip the sqlalchemy change you were talking about?14:29
jeblairor is alembic only used in migrations of an existing schema and the schema is created by sqla if you're starting from scratch?14:30
jeblairif the latter, then the change to sqla you describe would be required in order to not create fk's in the db while still informing the orm of them, right?14:31
mordredjeblair: the schema is always created by alembic14:40
mordredjeblair: hrm. I hadn't thought of that...14:41
mordredjeblair: however - the unittesting of the migrations will suffer14:41
jeblairmordred: ooh, okay.  so is it possible to just omit the FK instructions to alembic but retain them in sqla?14:41
jeblairwhy's that?14:42
mordredbecause what we're doing now is running the migrations and then making sure that matches what the model thinks it wants14:42
mordredand then in the other unittests, just using the model14:42
jeblairwhat does the matching?14:42
mordredone sec14:42
mordred(loking)14:42
mordredah... sorry, I lied14:44
mordredthe migrations don't test for consistency with the model - they run migration unittests - but just run against mysql14:45
mordredso when you write a migration, you should also write a unittest for the migration14:45
mordredso yeah - just not doing foreign keys is fine14:45
jeblairah yeah, those migration tests already look like they don't care about fks14:46
mordredwoot14:48
*** miqui has joined #storyboard14:59
* ttx finally beats Alembic15:03
*** david-lyle has joined #storyboard15:16
*** jcoufal has quit IRC15:50
*** krotscheck has joined #storyboard16:00
krotscheckEhn? Meeting time?16:01
NikitaKonovalovlooks like so16:02
krotscheckttx: You there? Or am I running this?16:03
*** hashar has quit IRC16:22
*** krotscheck has quit IRC17:00
mordredcody-somerville: aroudn?18:54
cody-somervillemordred: yup19:10
mordredcody-somerville: I just read the meeting logs and figured we should chat about foreign keys :)19:10
mordredcody-somerville: basically, I don't feel STRONGLY about it - other than that I feel that they're pointless in a system that's using an ORM19:13
mordredcody-somerville: I disagree that the data will outlive the app19:13
mordredI mean - the data will19:13
mordredbut I do not believe that another app will be written to access the database in its current from19:13
mordredform19:13
mordredas much as, if a new app will be written, it will have a new database and there will be a migration19:13
mordredif we were to get large enough to hit scaling issues, we'd most likely shard, which most likely happens by spinning off separate database instances with their own data apis in front of them and then doing a dump/transform/repliacte to the new instances19:14
mordredand, behind a data api that defines the constraints and relationships, they don't add any benefit other than overhead19:15
mordredthat said - you are right, they do not provide a noticable performance hit at our current scale19:15
mordredso it's not important to remove them19:15
mordredI mostly just wish that sqlalchemy had a "production mode" flag you could flip to just have it ignore them as no-op on mysql19:16
mordredbut clearly no-one has ever run a sqlalchemy app at massive scale yet19:16
mordredand we probably will not either19:16
cody-somervilleI suppose you could just set foreign_key_checks = 0 in mysql configuration file if you wanted to19:17
mordredhrm. not a bad idea.19:18
cody-somervilledb seems like a good place to store the scheme, including the foreign relationships, even if you don't enforce the checks for some crazy reason19:18
cody-somervilleyou say it's just additional overhead19:18
mordredwhy - when you're storing it in the model in git already?19:18
mordredI mean, in ruby on rails the ORM is inferred from the schema, so you _have_ to have them there19:19
mordredotherwise active record does not know what to do19:19
cody-somervilleIt's not difficult to imagine bugs in application layer (sure, a bug could happen in database but the risk there is much more contained due to separation of concerns)19:19
cody-somervilleit's also not difficult to imagine someone resorting to some manual SQL19:20
mordredwell, it is, in that most people do not have access to do that. :)19:20
cody-somervilleapplication developers do19:20
cody-somervillesqlalchemy lets you do raw statements just fine19:20
mordredsure. well, listen - like I said - I don't feel strongly about it19:21
mordredI'm just trying to explain why they're a bad idea19:21
cody-somervilleI doubt the writers of sqlalchemy wrote it in such a way to be defensive enough about being responsible for the integrity of the data19:21
mordredI mean, they're not as bad an idea as stored procedures or function indexes19:23
mordreds/they're a bad/I think they're a bad/19:24
cody-somervillemordred: I think calling them a bad idea is being a bit too broad. I get that sometimes it makes sense to not use them. And I understand the value in maybe having such a hard line position as a db person to get people to really think about it.19:25
mordredyah. the second sentence19:26
mordredI agree - they're not always a bad idea19:26
mordredI, myself, would actually never use them in a database19:26
mordredand never have19:26
mordredbut that does not mean that they are a bad idea19:26
mordredacross the board19:26
mordredI _Do_ mainly want to point out that just because the relational algebra enjoys them, and just because the big-iron databases rely on them19:27
mordredthose actually _do_ tend to be databases that are accessed by mutliple different app developers independently19:27
mordredwith a DBA who maintains things like relationships and views19:27
cody-somervilleand some people probably feel similarly about type safety or garbage collection ;)19:28
mordredin many ways - I see the DB ORM layer of an API app as filling the same space as the DBA-run views and relationships19:28
mordredwell, garbage collection is a bad idea too19:28
mordredbut only if you care about consistent performance at high scale :)19:28
cody-somervillemaybe we should rewrite openstack entirely in C ;)19:29
mordredwell, C++19:29
mordredcompile-time type safety actually allows for more efficient code to be generated by the compiler19:30
mordredrun-time type safety is a performance hit19:30
mordredI love compile-time type safety for that reason19:31
mordred(which, btw, is one of the benefits of ORM-generated queries- they are compile-time checked - as opposed to the run-time check of throwing a query against the db and then checking to see if it violates a constraint)19:31
cody-somervillefrom the sqlalchemy website "All object-relational patterns are designed around the usage of proper referential integrity, and foreign keys are an integral part of its usage."19:33
mordredsure19:34
mordredthey're wrong19:34
cody-somervilleI think that's in reference to how sqlalchemy works with relational models, not commentary on information theory19:35
mordredif sqlalchemy, as a query generator, relied on the database to throw integrity violation errors to be able to produce proper sequencing, we wouldn't us it for anything19:36
*** hashar has joined #storyboard20:02
*** mfer has quit IRC21:25
*** krotscheck has joined #storyboard21:36
*** david-lyle has quit IRC21:37
openstackgerritMichael Krotscheck proposed a change to openstack-infra/storyboard: Added paging to list endpoints  https://review.openstack.org/7975722:03
openstackgerritMichael Krotscheck proposed a change to openstack-infra/storyboard: Added paging to list endpoints  https://review.openstack.org/7975722:07
openstackgerritA change was merged to openstack-infra/storyboard: Remove Branch and Milestone legacy tables  https://review.openstack.org/8156222:13
*** hashar has quit IRC22:18
*** krotscheck has quit IRC22:30
*** krotscheck has joined #storyboard22:31
*** david-lyle has joined #storyboard22:38
openstackgerritMichael Krotscheck proposed a change to openstack-infra/storyboard: Added paging to list endpoints  https://review.openstack.org/7975722:39
*** krotscheck has quit IRC22:46
*** krotscheck has joined #storyboard22:47
*** david-lyle has quit IRC23:31

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!