Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Potion Store on MySQL?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andy Kim  
View profile  
 More options Jun 24 2007, 12:25 pm
From: Andy Kim <andyki...@gmail.com>
Date: Sun, 24 Jun 2007 09:25:39 -0700
Local: Sun, Jun 24 2007 12:25 pm
Subject: Re: Potion Store on MySQL?
Hi Jon,

I'm CCing the mailing list so that my reply can be on record. I hope  
you don't mind.

When I first wrote the store code it was actually running on MySQL. I  
ported it over to Postgresql because when I started deploying to a  
VPS (best solution for rails apps, IMO), I found out that MySQL  
running on InnoDB actually takes more RAM than Postgresql. If you run  
it on MyISAM the RAM issue goes away, but there is no transaction and  
foreign key support. MySQL still has some gotcha behavior too,  
especially when you start using tools such as Cocoamysql. My overall  
experience has been that I wouldn't trust MySQL with an application  
that deals with other people's money.

That said, the good news is that porting it back to MySQL is really  
easy. Rails abstracts away database systems for the most part. Off  
the top of my head, I think the only code that depends on Postgresql  
is in app/controller/admin_controller.rb, in the index and find_order  
methods. You'll find it if you keep scrolling down until you see big  
SQL queries. I left notes on how to port back to MySQL too.

Cheers,

Andy Kim
Potion Factory LLC

On Jun 24, 2007, at 5:56 AM, Jon Flowers wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
seoxys@gmail.com  
View profile  
 More options Jul 4 2007, 5:34 pm
From: "seo...@gmail.com" <seo...@gmail.com>
Date: Wed, 04 Jul 2007 21:34:42 -0000
Local: Wed, Jul 4 2007 5:34 pm
Subject: Re: Potion Store on MySQL?
Andy,

I've got some basic SQL knowledge, decent Rails knowledge and good PHP
knowledge... But your SQL queries in admin_controller.rb are WAY too
advanced for me!

Can you give us the abstracted (SQL-independent) way to do this, with
no SQL? I don't really care about the performance loss, since I'm the
only one that every going to feel it (it's an Admin interface, after
all!).

Or could you translate it into MySQL?

My web host doesn't support PostgreSQL...

Kenneth

On Jun 24, 6:25 pm, Andy Kim <andyki...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Kim  
View profile  
 More options Jul 4 2007, 10:36 pm
From: Andy Kim <andyki...@gmail.com>
Date: Wed, 4 Jul 2007 19:36:43 -0700
Local: Wed, Jul 4 2007 10:36 pm
Subject: Re: [Potion Store] Re: Potion Store on MySQL?
Hi Kenneth,

> I've got some basic SQL knowledge, decent Rails knowledge and good PHP
> knowledge... But your SQL queries in admin_controller.rb are WAY too
> advanced for me!

Don't get too scared of the big SQL statements. They are easily  
ported to MySQL using the notes provided in the source code.

> Can you give us the abstracted (SQL-independent) way to do this, with
> no SQL? I don't really care about the performance loss, since I'm the
> only one that every going to feel it (it's an Admin interface, after
> all!).

To do it without the SQL statements, ActiveRecord will have to fetch  
every row from the orders and the line_items table for all orders in  
the last one year period, one row at a time. When you get a decent  
amount of orders in the system, you'll have to wait tens of seconds  
(if not minutes, depending on your system) for the admin page to  
load. Can you guess why I know this? :)

> Or could you translate it into MySQL?

Well, give it a go first. If you can't get it to work, get back to me.

> My web host doesn't support PostgreSQL...

Sorry about that.

Sincerely yours,
Andy Kim
Potion Factory LLC


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Gruby  
View profile  
 More options Jul 5 2007, 12:52 am
From: Scott Gruby <sgr...@gmail.com>
Date: Wed, 04 Jul 2007 21:52:22 -0700
Local: Thurs, Jul 5 2007 12:52 am
Subject: Re: Potion Store on MySQL?
It didn't take me long to convert the queries to MySQL, however, some
of the queries just didn't work properly for me as I use percentage
based coupons and the calculations were off. So I ended up beating up
the admin controller and referencing a secondary database I use to get
statistics (I use a combination of the orders database and my user
database). You might just strip out the scary stuff and go for the
simple like order and product count; those work well.

On Jul 4, 7:36 pm, Andy Kim <andyki...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kenneth  
View profile  
 More options Jul 5 2007, 9:46 am
From: Kenneth <seo...@gmail.com>
Date: Thu, 05 Jul 2007 13:46:55 -0000
Local: Thurs, Jul 5 2007 9:46 am
Subject: Re: Potion Store on MySQL?
Andy,

Thanks for the tips. I finally got it working with MySQL. One thing I
learnt from this is that the MySQL.org docs absolutely suck...

Kenneth

On Jul 5, 4:36 am, Andy Kim <andyki...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »