Sunday, November 08, 2009

GAE data storage

GAE data storage is pretty basic. Relationships are especially weak (guess this is inherited from both Java (JDO and such) and XML as a data store). Sure it works for simple object persistence but for more or less serious stuff it won't cut it. Let's consider simplest of them all bi-directional one-to-many. Data integrity aside it ain't worth it because of inflexibility. For managed one-to-many (read storing everything in one XML file) there are just two ways of resolving relationship - either doing nothing (default) or prefetching all (by setting @Persistent(defaultFetchGroup = "true")). That inflexibility comes at a cost of fetching all children just to add another one since there is no way of adding a child with some sort of foreign key and thus parent.getChildren().add(child) is the only way to add a child. Unmanaged one-to-many solve "foreign key issue", but come at a cost of updating parent any time child is added. The bottom line is - relationships should never be part of a class or data storage. They need to be modeled "orthogonally" to both objects and data storage in "data model" similar to EOF. When it comes to GAE and Java in general this implies same old - same old - very basic objects (XML documents as storage) with no JDO relationships. Relationships need to be modeled and implemented as part of data logic (read all relationship management needs to be implemented in getters and setters) - stone age or yet another way Java is Cobol of XXI century. N.B. Encoded string PK defined as
@PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String encodedKey; @Persistent @Extension(vendorName="datanucleus", key="gae.pk-name", value="true") private String pk;
are equivalent to Key and key generation using pk field as follows
@PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key id; ... this.id = KeyFactory.createKey(InAppPurchase.class.getSimpleName(), pk);

Thursday, July 09, 2009

Hyundai is assaulting

Kia Rondo is the cheapest 7 seater that has the best value. It is a Hundai/Kia, i.e. similar to Toyota the car is no fun to drive, but overall package is actually quite good especially considering that after 40+% in initial depreciation in two years from $21K down to $11K it is the only econo-box that could be had with leather and V6. Rondo cloth interior has "autostain" feature, i.e. seats stains all by themselves, thus cloth seats are no go. Engine wise both I4 and V6 are adequate and more or less have the same fuel economy due to I4 coming with 4speed auto and V6 paired to 5speed auto. Base trims (I4+cloth) might not have 3rd row of seats, while V6+leather almost always come as 7 seater and this is the trim to get. Waranty wise, Kia 10yr/100K powertrain warranty is not transferable, yet 5yr/60K bumper to bumper is. 5/60K is standard these days, making any car build 2007 and later same as new built in 2006 (i.e. with only 3/36 that was the standard back then). Mazda 5 is the only other 7 seater that apart from minivan doors and useless 3rd row seats is pretty much the same, alas more expensive and available in leather only with later models... The rest of 7 seaters are minivan 200+ inches long (vs. 180- inches) or fullsize SUVs guzzling way bellow 20mpg. Both Rondo and Mazda 5 do 19/25/22mpg with Rondo's I4 outputing a hair more then Mazda 5 and doing a hair more mpg on a highway... Those fuel consumtion figures are your average for 5 seater compact wagons with germans giving more performace and fun for the same MPG and japanese giving 30+% more MPG for the same performance.
L/W/H/groundweightcargoturnengineMPG
2007 Rondo$11K179/71.7/65/6.135116.5/31.736.1V6 192/18418/26/21
2009 Rondo$20K179/71.7/65/6.133336.5/31.735.6I4 162/16419/26/22
2006 Mazda 5$11.5K181.5/69.1/64.2/5.54572/4434.8I4 157/14819/25/22
2000 323iT$7.5K176.3/68.5/55.5/335125.7/34.42.5L 170/18118/26/21
2003 525iT$11K189/71/56.7/368232.7/6537.12.5L 184/17517/24/19
2006 A4$20K???180.6/69.8/56.2/4.2367127.8/5936.42.0T 200/20720/28/23
2009 Jetta TDI$24K179.4/70.1/59.2/5.4432432.8/6735.8140/23630/41/34
Insight$20.5+K172/66.7/56/272315.9/3236.198/12340/43/41
2007 Fit$12K157.4/66.2/60/247121.3???35.6109/10528/34/31
Soul$15K161/70.3/63.4/6.5280019.3/5334.42L 142/13724/30/26
2007 Vibe$11K171.9/69.9/62.2/5.9270019.3/5436.71.8 126/12226/33/29
2009 Elantra Touring$15K*176/69.5/59.8/5.9293724.3/6534.2I4 138/13623/31/26
First let's look at the performance group split between BMW and Audi/VW (Volvo V50 has way to many problems to be considered). In summer 2006 VW finally fixed sludge in 1.8T by updating engine to 2.0T and making A4 worth the look. Alas 2006 A4 is still close to $20K then the rest are close to $10K and $20K could buy many new cars these days. On VW the same engine appeared only in 2009 Jetta together with new TDI, i.e. the priviledge to drive 2.0T would cost $20+K this way or another. In addition to 2.0T in 2009 VW started to put DSG on Jettas and Golfs making it the cheapest DSG out there, yet technology aside the value of DSG is questionable especially on Jetta with TDI where 5-speed should be optimal. This once again leaves BMW as the only performance wagons out there. 3-series is as good as it gets overall, and 5-series is the wagon when 3-series become too small. Suprisingly enough, 5-series is almost the same when it comes to performance/mpg as 3-series being way bigger car (well 19mpg combined is bellow 20mpg and 10% worse then 323iT with 21mpg). 2003 was the last year they sold 5-series wagon before the redesign and any 2000+ 5-series wagon is the best 5-series BMW, same as 4 cylinder E36 being the best 3-series. The bottom line however is that $10K and 20mpg used to move 5+luggage in style thanks to BMW, they still do, but also $10K+20mpg could now move upto 7 and have 2-3 years of warranty left. Also these days other options are not limited to VW with dirty cloth interior. Asian 5 seater wagons are not as fine as germans and hardly could be inspiring to drive, yet they offer far better fuel economy starting from 25-30+% more per gallon and all the way to twice or 100% more for Hybrid Insight. Insight is not quite the same class being smaller and crampier yet even with rear-seats up it could haul more then your average sedan (more then E36). Still the point about Fit being $5K cheaper and more capable for 10 mpg less is a good point. Those $5K even at $4/gallon would buy 1250 gallons of gas (or 3+ years of driving assuming 12K/year or <400 gallons/year), thus to catch up Insight should burn x/31-x/41=1250, or x=1250*41*31/(41-31)~160K miles... (the formula thus is miles_to_catch_up = $*mpg1*mpg2/$pg(mpg1-mpg2)...) Being twice as efficient and twice as expensive to catch up with 21 mpg E46, Insight should drive $10K*21*41/$4*20 or over 100K miles ($3 gallon makes it close to 150K miles, while $5 per gallon still makes it 86K). Clearly fuel-efficiency cannot be major factor in selecting asian econo-box. It gotta be capabilities per aquisition costs and this is what makes slightly used Hyundais and such far better buy then Hondas. Their initial depreciation makes their value shine even more then while new. Thanks to Big 3 crysis thus the only car that could approach Kias "value" when used are Pontiac Vibe. Yet they still have a long way to go when Elantra Touring goes for $15K new *after rebates ($1.5K cash and $1K marketing to dealer). Ultimately this race to the bottom should push 1-2 year old 5 door wagons value bellow $10K and at those price points Vibe vs. Elantra is worth a test drive despite being offered in single trim and cloth only. Overall, Soul appears to be a bastard child in this segment, neither cheap, nor offering utility, and thus test drives are
  • Insight vs. Fit Sport manual - both are Honda, read too expensive.
  • Rondo vs. Soul
  • Vibe I1.8 vs. Elantra Touring. 1.8L Vibe might not be adequate, 2.4L GT could match up a hair more powerful Elantra.
Despite touching $10K with 2 yo cars, asian econo-wagons are no match to 6 years old BMW, so the only news is that there are 7 seaters now.

Monday, March 09, 2009

Mac Mini

Apple came out with the first Mini worth buying. Finally, base model has DVD writer. Alas, despite GF 9400 GPU, Apple again failed to sell me. Apart from even base Mini being over-priced $100 ($599 vs. $499 it should cost to be worthwhile), this time around I have no need for C2D based desktop... What I need is Ion based AppleTV for $199 and while it is not available probably I would roll my own.

In the simplest scenario 10.6x10.4x3.5200W PSU, PCI-e Low profile case for $38.99 (QC is reported to be bad) plus Zotac GF 9300 Mini ITX board for $145 with x16 PCI-e and everything else (but S-Video) including 11b/g is all I need ($184) to build mini PC 3" wider and deeper then Mini. Add to that 2.5GHz E5200 for $70 to match up new Mini at $39+$145+$70=$184+$70=$255 or better yet load it up with Q9550 (2.8GHz 2x6MB vs. 2.4GHz 2x2MB for Q6600) at $280 to make it fastest pre i5 Quad for $464 with CPU cost to be 60%. Newegg has Q9300 (2.5GHz 2x3MB) for $240, so give or take $40 with Q9550 being better option.

AMD CPU should be cheaper. Phenom 2 starts at $170 at MicroCenter and uses AM3 socket and Phenom 9600 is $100 2.3GHz at newegg after $20 rebate. Since AM2+ processors do not work on AM3 motherboards, depending on what type of GF 9400 mobo Zotac come up with for AMD (AM2+ vs. AM3), I could either use Athlon from HP and buy Phenom 9600 later or would have to buy both mobo and Phenom 2 at the same time. So AMD system would run me either $184 upfront, plus $100 later or $284 for 2.3GHz Phenom ($30 extra vs. base C2D) or $184+$170=$355 or $100 cheaper then Q9550.

Well, I have to wait for Zotac GF 9300 Mini ITX for AMD before building Mini PC... and may be by the time they come out with one NVidia would have ION out and old TV could be driven by ION based thingy for less then $200.

P.S. None of the Mini-ITX mobos have S-video out, and none but GF 9400 based have x16 PCI-e. Apple TV in addition to HDMI has just component video out, so only HP+X1550 combo could drive my old TV since it could only take S-video. My TV is showing its age.

Followers