Single platform to launch multiple ecommerce sites
Category: E-Commerce Software As a Service | Industry: Trade & Retail
We built one Ruby on Rails application in early 2008 to become a platform to launch multiple online stores with ease.
Technically speaking, we have multiple views/ directory that hosts the different layouts among the online stores.
We also use different databases for each stores.
So, the Rails app connects to multiple databases and generate different views depending on the domain that sends the request.
The rest (controllers, models, etc) are the same.
The advantage is obvious. Our client can have many customers in a fast and scalable way.
There is no need to code anything if there is a new client. Simply HTML / CSS.
This is a big project, taking about 6 months to do both the frontend application and the backend. And it's worth it.
Other interesting technologies in this project include:
- The use of Active Resource when it's not yet included in the default Rails package
- Using memcached because the app is potentially hit by many visitors. We use multiple memcached servers to cache sessions, page fragments, variables and objects.
- Securing certain pages and form submissions with HTTPS
- Shopping cart system handles reservation of a quantity of products that's in the cart for a period of time
- Writing a custom Rake task that enables us to migrate multiple databases at one run
- With the warehouse in a certain city, and we need to give accurate shipping estimate to customer, we have to take the customer's timezone and the warehouse's timezone into calculation
- Integration with Orderwave to handle their inventory, ordering, and shipping.
- Extracting the uploaded zipfile and processes each files within. We use rubyzip in this case
- Because the specs are complex, and attachment_fu's features are limited, we code the image manipulation logic ourselves. For example, it asks to resize first and then crop exactly in that order
- Convert PNG to JPEG, and give a background color to the previously transparent area