How We Created a Multi-site Setup for a Vehicle Marketplace: Part 3
Tags: webdev, showdev, ruby, programming
Published: 2019-05-06 07:21:31

---
title: How We Created a Multi-site Setup for a Vehicle Marketplace: Part 3
published: true
description: Codica team created a marketplace platform including 89 independent websites. How do we easily localize, configure, test, deploy, monitor them all? Check our article.
tags: webdev, showdev, ruby, programming
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pfv64tb54yaw5cbwzo2h.jpg
---

*This article was originally published on [Codica Blog](https://www.codica.com/blog/time-tracking-with-slack-bot/).*

Today, we want to provide you with the final part of our article dedicated to [Creating a Multi-site Setup for a Vehicle Marketplace](https://www.codica.com/blog/multisite-vehicle-marketplace/). Here we cover the last challenges like **adding new websites** and **monitoring**. If you missed the second part, here is the [link]() for your convenience.

Let's get this show on the road.

## Adding new websites
**Goal: Develop a simple process of websites addition**

Then the platform was growing rapidly, so we understood that websites’ addition issue would emerge quite often. But when you want to add/remove a certain site - it is not so difficult and time-devouring as if you add/delete over 80 sites.

Thus, our primary goal was to develop an effective way to quickly add new websites when required. To achieve this goal, we have taken two steps. 

**Step 1. Fresh database preparation**

Firstly, our development team has built a script that generates a new website database and fills it with starting information.

**Step 2. Develop easy website addition process**

Secondly, we wanted to clarify this process. To achieve this goal, our development team has built a Rails generator - a script including templates that produces a new website configuration. Actually, we have saved much time with the help of this generator. Currently, the new site addition takes only 1-2 hours, not 1-2 days.

The script produces:
* Locales
* Configs (for example <code>newsite.yml</code>)
* CSS files with automatic colour matching based on logo colours
* Puts images to the right folders structure
* A watermark by repainting the logo into white colour.

After developing the script, we only needed to adjust third-party services like [AWS](https://aws.amazon.com), [Mailchimp](https://mailchimp.com), and add the website URL to the Facebook whitelist.

In case we need to delete some website, then we should run <code>rails destroy site *hostname*</code>.

## Monitoring
**Goal: Implement automated monitoring**
It is important to monitor such a big platform working capacity and check it for bugs as a number of websites is quite large. The main challenge for our team was to organize monitoring in the most time-efficient way. We used to manually check the websites or monitor them daily.

With the platform growth, our developers decided to use [Uptime Robot](https://uptimerobot.com)  - an automated tool which provides us with 4 monitoring types:

* **HTTP(S)**: that's perfect for website monitoring. The service regularly sends requests (which are the same as if a visitor was browsing your website) to the URL and decides if it is up or down depending on the HTTP statuses returned from the website (200-success, 404-not found, etc.).
* **ping**: this is good for monitoring a server. Ping (ICMP) requests are sent and up/down status is decided according to if responses are received or not. Ping is not a good fit for monitoring websites, as a website (its IP) can respond to ping requests while it is down (which means that the site is down but the server hosting the site is up).
* **keyword**: checks if a keyword exists on a web page.
* **port**: good for monitoring services like SMTP, DNS, POP, as all these services run from a specific port and Uptime Robot decides their statuses if they respond to the requests or not.

To be precise, you can find many options to get notifications from Uptime Robot.

Due to the fact we use Slack for corporate communication, we have adjusted alerts directed to Slack chat. The coder who is responsible for the platform support receives notifications immediately if any website is down. Here is an example of this notification:

![](https://thepracticaldev.s3.amazonaws.com/i/o7n44mtbcdduaey9nzc4.png)

Thus, we are always up-to-date and prepared to immediately solve any problem.

## Conclusion

To summarize, we want to point out that a multisite setup is a perfect solution for business people trying to build a marketplace which should cover many geographic areas.

This option is pretty time- and cost-effective because you have a possibility to control and administrate all the sites easily and efficiently. The configuration system gives you an opportunity to improve a certain website and gain the results across the whole platform.

**We are proud of the result we have achieved and here are the outcomes**:

* 89 local vehicle marketplaces successfully operating (and the number is still growing!)
* 15 languages and 72 currencies are implemented for localization
* Mobile-first approach implemented
* The regular server response is 100-150 ms
* Average page loads within 2-3 seconds
* High stability and security of the platform
* Reduced effort - our developers have found or created tools for fast and easy localization, configuration, testing, deployment, monitoring, and adding new websites.

Want to know more about software development and marketplaces in particular? Check [our blog](https://www.codica.com/blog) for more content from our experienced team.