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.
 
  • Post
  • Reply
Zombywuf
Mar 29, 2008

tef posted:

I've been using it in production for a year, so I know it works. I still don't think it is ready.

application/vnd.glyph; version=1.0

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

BonzoESC posted:

this is why you implement and version all the database changes with the app, because unlike java soap developers, web devs are actually trusted with the database structure and don't need a dba to babysit them

lol no. i write most of my sql anyways, but i do it in procs because its correct. direct object mapping always results in bad databases or tons of code to combine object relationships that you should have done in the proc.

Shaggar
Apr 26, 2006
also lmao @ nosql users. congrats on discovering lotus notes.

All Hat
Jul 11, 2008

He that is without int among you, let him first cast a long

tef posted:

I've been using it in production for a year, so I know it works. I still don't think it is ready.

:ocelot::spidey:

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

application/vnd.glyph; version=1.0

it isn't even version .5 yet. currently I need to add a few data types (form input types) , specify a few options and the format should be frozen.

Zombywuf
Mar 29, 2008

Why are they not version 1.1 features?

tef
May 30, 2004

-> some l-system crap ->
because I don't plan on having a version 1.1

tef
May 30, 2004

-> some l-system crap ->
ok that's a lie, but 1.0 -> 1.1 should have no underlying format changes.

1.0 is when I promise i'm not going to break it

Nomnom Cookie
Aug 30, 2009



read my lips: no new APIs

owenkun
Feb 26, 2007

The scent of strawberry milk.

Shaggar posted:

i write most of my sql anyways, but i do it in procs because its correct.

so do you write a proc for any operation that touches the db, even cases where it's data from a single table? seems like you'd be replacing the overhead of setting up an or map with the overhead of creating a proc.

quote:

tons of code to combine object relationships that you should have done in the proc.
shaggar was right

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shaggar posted:

lol no. i write most of my sql anyways, but i do it in procs because its correct. direct object mapping always results in bad databases or tons of code to combine object relationships that you should have done in the proc.

the "tons of code" is a one-line declaration in the model

code:
class Customer < ActiveRecord::Base
  has_many :orders
end
 
class Order < ActiveRecord::Base
  belongs_to :customer
end
with that you can just do some_customer.orders and it'll automatically select from orders with customer_id=?

if you want to grab a customer with all their orders you can do Customer.find(555, include: :orders)

Shaggar
Apr 26, 2006

owenkun posted:

so do you write a proc for any operation that touches the db, even cases where it's data from a single table? seems like you'd be replacing the overhead of setting up an or map with the overhead of creating a proc.

shaggar was right

yeah sometimes i end up with single line procs but the security benefits and ease of potential future changes outweigh the extra few minutes it costs.


BonzoESC posted:

the "tons of code" is a one-line declaration in the model

code:
class Customer < ActiveRecord::Base
  has_many :orders
end
 
class Order < ActiveRecord::Base
  belongs_to :customer
end
with that you can just do some_customer.orders and it'll automatically select from orders with customer_id=?

if you want to grab a customer with all their orders you can do Customer.find(555, include: :orders)

none of that belongs in code. at worst it belongs in the map config, but it really should be in ur procs. otherwise its yet another thing you need to test.

Zizzyx
Sep 18, 2007

INTERGALACTIC CAN CHAMPION

i think shaggar's implying that the sql schema and queries generated by the ORM to satisfy those requests isn't optimal. but for what definition of optimal and how big a performance penalty are we talking here?

it's just so easy

Shaggar
Apr 26, 2006
if its hibernate, the performance penalty is pretty big. hibernate makes some lovely sql and does alot of dumb crap.

also you've gotta worry about it not loving up things like locks. something thats v easy to handle in a proc w/ the added benefit of removing the concern from your application code.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.
i don't like hibernate a lot but its performance and locking characteristics are basically fine but like everything else, if you just slap it on an app and don't understand what you are doing you will make a worse piece of poo poo than you would have just using straight sql

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shaggar posted:

none of that belongs in code. at worst it belongs in the map config, but it really should be in ur procs. otherwise its yet another thing you need to test.

stored procs are just code that's deployed into the db instead of the app server

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Condiv posted:

I've been looking into databases recently, and I was curious about ORMs. Please correct me if I'm wrong, but they're basically just a bad way of treating a RDBMS like an OODBMS right?

i've just started working with core data and it is ftw

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
what do you guys use to manage your database source code?

i don't mean source control because obv you're using that but rather how do you store it and deploy it?

i used to use an in-house homegrown data dictionary solution back in my oracle days which sucked then for sql server i used a homegrown batch solution which made you code deltas for each release by hand which also sucked

now i use team system database projects (aka datadude) because i'm all on the MS stack and current system is database first not code first and filled with sprocs it's pretty good and generates deploy scripts automatically but a bit on the slow side if your database is complex (more about datadude if you have no idea what i'm talking about : http://msdn.microsoft.com/en-us/library/aa833292(v=vs.100).aspx)

are there other similar solutions out there? bc i haven't seen any and i want to try getting off the ms stack

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
I've posted about it before, but I use liquibase for versioning our database. I love it because it's pretty much fool proof as long as we go through our staging environment to catch any bugs that might not be caught on developers machines.

I really like that the changesets live in the same source tree as our normal server code, so that way the two are never out of sync. We use Postgres and it runs the changesets as transactions, so if any of them fail it automatically rolls back and keeps everything safe. :awesome:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

MEAT TREAT posted:

I really like that the changesets live in the same source tree as our normal server code, so that way the two are never out of sync. We use Postgres and it runs the changesets as transactions, so if any of them fail it automatically rolls back and keeps everything safe. :awesome:

that sounds cleaner than what we do

in theory datadude should be able to do a backup and rollback but i never really had much luck with it and our dbas wouldn't trust it anyway so manual backups ahoy

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Arnold Yabenson posted:

what do you guys use to manage your database source code?

i don't mean source control because obv you're using that but rather how do you store it and deploy it?

i used to use an in-house homegrown data dictionary solution back in my oracle days which sucked then for sql server i used a homegrown batch solution which made you code deltas for each release by hand which also sucked

now i use team system database projects (aka datadude) because i'm all on the MS stack and current system is database first not code first and filled with sprocs it's pretty good and generates deploy scripts automatically but a bit on the slow side if your database is complex (more about datadude if you have no idea what i'm talking about : http://msdn.microsoft.com/en-us/library/aa833292(v=vs.100).aspx)

are there other similar solutions out there? bc i haven't seen any and i want to try getting off the ms stack

android has some stupid halfassed builtin versioning system where you have to do everything by hand but who cares it's a phone and my database is simple

coaxmetal
Oct 21, 2010

I flamed me own dad
who cares its a phone is pretty much the android m.o.

ninjeff
Jan 19, 2004

orms, stored procs, etc alone will never give you the advertised decoupling from your database. figure out what your data access needs are and put those behind interfaces, a data access "layer" if you will. you can implement those interfaces with whatever technology you want, even using different technologies for different calls if you need to

arguing about which technology dictates the rest of your code is a huge red herring. it's poor architecture that causes your data access technology to impinge on your code, not the tech itself

personally i like cqrs as a way of dividing up my data access layer interfaces. but that's a separate issue

don't fall into the trap of calling your orm or database directly from business logic or ui code, put that interface in there and you'll thank yourself later

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

ninjeff posted:

orms, stored procs, etc alone will never give you the advertised decoupling from your database. figure out what your data access needs are and put those behind interfaces, a data access "layer" if you will. you can implement those interfaces with whatever technology you want, even using different technologies for different calls if you need to

arguing about which technology dictates the rest of your code is a huge red herring. it's poor architecture that causes your data access technology to impinge on your code, not the tech itself

personally i like cqrs as a way of dividing up my data access layer interfaces. but that's a separate issue

don't fall into the trap of calling your orm or database directly from business logic or ui code, put that interface in there and you'll thank yourself later

Or you can be the super meat boy guy and make direct MySQL calls all over your code to the online leaderboard with a privileged account and claim its not a problem even though it's continuously abused

Zombywuf
Mar 29, 2008

Arnold Yabenson posted:

what do you guys use to manage your database source code?

SQL code:
if not exists (select * from pg_tables where tabname='butts') then
  create table butts ...

EVGA Longoria
Dec 25, 2005

Let's go exploring!

Gonna putz around with ruby on rails and couchdb. See how the other side lives.

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
rails is great unless you want to do anything outside of rails g website

and couchdb is great unless you want to actually write data. or have some horizontal scaling. or do anything really.

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
*inhales sharply* coreo data ftw *is pelted by disembodied penises*

EVGA Longoria
Dec 25, 2005

Let's go exploring!

tinselt0wn posted:

rails is great unless you want to do anything outside of rails g website

and couchdb is great unless you want to actually write data. or have some horizontal scaling. or do anything really.

i don't know what you mean rails g website

and i decided on mongodb since it looks like it has binary data types and poo poo.

this is p much just to expand my horizons

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Casao posted:

i don't know what you mean rails g website

and i decided on mongodb since it looks like it has binary data types and poo poo.

this is p much just to expand my horizons

into the trash

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Casao posted:

i don't know what you mean rails g website

and i decided on mongodb since it looks like it has binary data types and poo poo.

this is p much just to expand my horizons

rails is good but mongo is trash

everything mongo does postgres does better (except the part where mongo's idiotic manual sharding procedure brings your poo poo down)

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
the widespread acceptance of mongodb into production is frankly embarassing

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

tinselt0wn posted:

the widespread acceptance of mongodb into production is frankly embarassing

web developers get worked into a lather about pretty much all new technologies and frequently run beta software in production. look at php

EVGA Longoria
Dec 25, 2005

Let's go exploring!

BonzoESC posted:

rails is good but mongo is trash

everything mongo does postgres does better (except the part where mongo's idiotic manual sharding procedure brings your poo poo down)

i want to understand mongo before i dismiss it, i've heard good things from people who aren't terrible hipster developers that say it has some good performance for specific use cases

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
fwiw i know one of the original architects of mongo and he uses hadoop in his new company for what is allegedly a textbook use case for mongo

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.
riak + postgres, use these two

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

trex eaterofcadrs posted:

riak + postgres, use these two

just use postgres, your app probably isn't big enough to use riak

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
its not the size of the database...

wait, yes it is.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tinselt0wn posted:

its not the size of the database...

wait, yes it is.

with riak you really have to think carefully about how you want to query it and how to denormalize your poo poo because you can't retroactively add indices without loading and resaving literally every object you want to index

and with bitcask (the default backend) you simply can't do indexes

so use postgres until you get stupid popular like voxer and then you'll know what's popular about your app and can make an informed decision about how to design your data model

Adbot
ADBOT LOVES YOU

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
i dunno ive dealt with sql databases up to about half a billion rows and it was ok and at least people understand it rather than the nosql du jour so whatever works for your particular application i guess

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply