Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Thursday, May 7, 2009

Beginnings of an RIA ECommerce solution

Another round of tests and some interesting results. I have successfully stubbed the mySQL database into Flex via .Net procedures created by WebORB. Also, I have added fields to the mySQL tables of interest without any unique key violations in the Miva CMS. I had to add primary keys to several tables in the database, but as stated, no adverse affects, meaning the db queries in miva's cms are fairly fast and loose. In this case that is a good thing.

Still working on the details, but so far it seems possible to do the following:
  • Use Miva Merchant 5.5 as a backend solution for a rich ecommerce (web) application
  • Use Flex 3 as a client frontend with RPC enabled products arriving from Miva
  • Add custom fields as needed to elaborate on the data the Miva CMS typically allows
That's a good start. The test verifies an architecture consisting of Miva -> MySQL -> .NET -> Flex on the incoming side.

Now I'm looking into solutions for the Flex -> Google Checkout -> Miva on the shopping cart transaction side. For now, going to checkout will out of necessity pop out of the RIA window and open another. It's a small price to pay, especially considering there are virtually no single-state checkouts anywhere on the web. It hasn't hit the production line yet.

Since Miva is stable with additional fields in its DB but cannot administer the extra fields, my wishlist of useful add-ons now includes a secure Flex-based CRUD-enabled CMS to manage the custom fields added to Miva DB tables. It would be great to be able to post images and data through a form in Flex, and very possible time-permitting. For now, the method is direct DB data injection and FTP posting. Not good for a client admin, but fine for a developer at this point.

And the point is, it works!

Wednesday, May 6, 2009

More Miva Merchant

There have been some interesting revelations here. What I've found can be summarized thus:
  • Miva Merchant up to vers 4 uses a proprietary form of SQL called MIVA SQL. While it uses Structured Query Language, it does not share compatibility with MS SQL. Thus it is locked in its own fishbowl.
  • Miva Merchant 5 and on to current 5.5 gives resellers the option of configuring their product to reposit with MySQL instead of MIVA SQL, which provides a substantial performance boost. My webhost of choice for this project opted for the MySQL configuration. This is good.
  • Miva Merchant offers a range of export options for financials, including .dat files and the like. They do not currently offer any RESTful services of any kind. Thus the question of whether to REST or RPC for Miva is conclusively RPC or bust.
Contacting both HostMySite and Miva Tech Support in CA has confirmed the above. They recommend using Miva forums, but there is but scant info on this topic that I have found. The webhost tech department has been very cool and receptive to my questions and has custom configured my Miva-driven MySQL DB to allow me to connect and read data directly from it. This means there is finally a way to export data from the CMS portion of Miva and feed it to my custom Flex front end.

Now then.

The question remains, how will WebORB interpret the schema of this Miva-built DB? I hope well. Hand-coding RPC is out of the budget and timeline for this project. I am relying on the savvy of WebORB to translate the schema into useful server and client side code libraries such that, if all goes well, I can pull the inventory on the fly from Miva to my Flex application.

Between this and a lack of experience working with a MySQL .NET hybrid, I'm hoping it will go smoothly. I'm now creating the DSN to allow ODBC between the weborbconsole and MySQL, so I'll let you know what happens.

MIVA MERCHANT

Working on a Flex ecommerce solution. Need to provide the client with a full suite of merchant tools including:
  • Pre-provided tax rate data on orders within the US
  • Price and quantity inventory info
  • Fulfillment and basic CRM features
  • Analytics
  • Easy-to-use content management
  • API to Google Checkout
  • Portable to external spreadsheets and financial software
  • Secure credit card transactions (natch)
Plenty of solutions offer the above. The catch is, in order to provide my own client side in Flex I require a direct db connection, preferably to SQL, to supply a stream of remote data to my shopping UI. I have created my own CMS that will do the job, but there are ornery caveats associated with an architecture including 2 repositories of data, my CMS and the ecommerce CMS, namely:
  • consistency of state across tiers
  • concurrency
  • locking
  • transactions
  • rollback
Dual databases for one application is seldom if ever ideal, and certainly not in this case. Trouble is, unless there is some way to communicate between Flex and the Ecommerce solution, 2 databases are the only way to roll it out. But what form would this communication take? In the case of Flex, there are three services available for accessing data:
  • HTTPService: Passes textual data over HTTP. This is often used to fetch RSS feeds, read XML generated by a server, or simply pass text-based data from server to client.
  • WebService: Allows a Flex application to invoke server-side web services using SOAP and handle the results of web service calls. These web services may reside on the server that has served the rich Internet application or may call third-party web services through a proxy on the server.
  • RemoteObject: Allows a Flex application to directly invoke methods on Java classes residing on the application server that has served the RIA. Data is transferred in binary format (Adobe Action Message Format or AMF) over HTTP or HTTPS, with the server translating Java and ActionScript objects as they pass over the wire.
That's a pretty rich options list. I can use RSS feeds, XML, Web services or even direct DB access via RemoteObject. Lots of options, yes, options galore. As for the custom CMS I mentioned, it is .NET and uses RemoteObject to pull from the SQL database. Now I seek a similar means of pulling data from the ecommerce system. Any will do. But as it appears, there are few options.

I have thorougly scoured practical ecommerce, a website devoted to ecommerce application vendors. Practical ecommerce website has a Cart of the Week feature in which they interview principals of a web ecommerce provider each week, weighing the pros and cons of their service. There are open source solutions, Microsoft solutions, Adobe solutions, many variants. They can be hosted or licensed options. I've read through many of them.

In addition, I have signed up for Miva Merchant 5.5 with the reseller that hosts my client site. They are one of the 800 pound gorillas of ecommerce, Google Checkout being the reigning heavyweight, but not a full service solution as Miva offers.

Miva Merchant offers database integration now, as of 5.5, via the services of MIVA SQL and optional MySQL support, but here's the rub. Try a google search for "miva sql" and venture a guess at the richness of answers google will provide. At my last search...462 pages. A pathetic level of information out there to say the least, and equally untenable are the docs offered by Miva. Here are a few plaintive queries that died on the vine on my hosting account forums:
I've put in a support request ticket and will continue to pursue the issue. For my stake in this, at the root of the matter lies a question of Flex and Ecommerce integration. I ask the ecommerce vendor community collectively, is there a solution that offers a full set of features as well as database access? Has any of the companies seen the value in offering a solution that can serve as a data feed and cms, or conversely are they all template-and-markup-based solutions? I'll post more once I have some concrete answers to this.

Wednesday, April 8, 2009

ASP.NET MVC is the last gasp

I started web development with open source as long as 10 years ago. Then it was PHP on an Apache server and I've continued through PHP 5 creating everything from mySQL databases to custom frameworks and CMS. Not too long ago, a new client project required ASP.NET technology, so I learned how to use .NET too. Here are some pros and cons.

Pros: Lots of documentation. Large developer community. Many adopters in the corporate realm.

Cons: Several. One particular blog I found nailed the issue. It's a matter that parallels the PC vs Mac debate. In more abstract terms, it's a question of

Goal-Oriented vs Process-Oriented

Stripping away the layers of good arguments on all sides, I have found Microsoft solutions tend to favor process over goal orientation. That's not good for independence and it's not good for speed.

A specific example.
You're a developer intent on deploying a web application quickly using whatever tools are best.
With Apache and PHP, the process is contained discretely within the server environment.
With Windows and .NET, there is a ripple effect requiring the expertise of the IT department. You need to know all about system permissions, a great deal about SQL management. Really, lots of peripheral management issues come to drag your process to a crawl.

That aside, there are a lot of smart people using .NET, and I'm interested in learning more about quick ramp-ups for .NET solutions. I'm a fan of Visual Studio's GUI and the xml DataSet system in .NET. I only wish they were quicker to adopt the DRY principles of RoR in their framework.

Since most of my clients fall into the small to medium category, unless they are running 100% enterprise solutions, I recommend a PHP or RoR orientation.

I will still be looking at .NET MVC resources to see what they've done to address quicker CRUD deployment. It begs the question, what open-source solution will Microsoft roll out years after the competition next? That is why edgy developers tend toward Apple and Open Source.