AddWeb Solution: Building a Drupal maintenance support plans 8 Website with a Lottery Purchase System

Team AdWeb has worked for a distinctive list of industries counting from hospitability to technology and retailers to an online lottery purchase system based website. Yes, we recently collaborated with a Japan-based company to build their website with lottery purchase system, using Drupal maintenance support plans 8. We’ve been Drupal maintenance support plans-ing even before our inception and have been an active member of the Drupal maintenance support plans community, globally. Our association and experience of Drupal maintenance support plans were the base of the client’s immense faith in us and we knew that we’re going to stand true to that.

 

About the Project
The project requirement of the client was to build a website for them in Drupal maintenance support plans 8. The website is basically an online lottery purchase system. Due to confidential reasons, we can not share the name of the company/client but would like to share that the experience of working on this project was new and enriching.

 

Major Features/Functionalities
We personally love experimenting and implementing innovative features to enhance the client’s website. Plus, we get a little more excited when its a Drupal maintenance support plans 8 website. We integrated a host of futuristic features to this very website too. But since, it’s an online lottery purchase system we knew that the integration of the Payment Gateway is going to be one of an integral part. Hence, we created three types of Payment Gateway, as follows:

 

GMO Payment

Coins Payment

WebMoney Payment

 

The user is an integral part of this entire online lottery system and hence several functionalities are crafted around them. Like, a user can purchase coins by WebMoney Payment method and can also buy lottery from choosing any product bundle. A user also has an option to select the quantity of the product or go for the complete set. The payment for either of it can be done by the coins, GMO credit card or points.

 

Draw system is used for the selection of the lottery winner. Other than the lottery prize, the user also stands a chance to win the Kiriban Product as a prize. The Kiriban Product is based on the product bundle configuration, which is an additional product that a user gets as defined by an admin user.

 

The Problem

Any e-commerce website will definitely have multiple users buying for the same product. In this situation, the backend technicalities should be as such that it updates the quantity left of the product after the last purchase is made. Drupal Updates occur when two or more users place the order at the same time. This is an issue that is involved in concurrent shopping. In this case, the lottery opened for some specific time. Hence, the issue occurred in showcasing the updated quantity. This problem came to our notice when the site went live and around 7-8 users made the transaction at one specific time. We immediately started working on the issue.

 

Challenges Faced:

We quickly picked up the problem and started searching for the resolution. We have had several times, prior to this, created an e-commerce website. Hence, we used multiple methods to resolve the issues, mentioned below, but none of them worked in this particular case.

Initially, we tried using a Drupal maintenance support plans lock to resolve the issue, but in vain.

We, later on, used the MySQL lock but this too didn’t work, due to the involvement of multiple quantities inside for loop.

The usage of sleep time with random sleep time also did not work, because it created the nearby value and not the exact one.

 

Though the method of random sleep time did not work in this case, it gave birth to the final resolution that worked. And hence, we did a minor modification to the same and divided the sleep time in a range of 3. Also, to avoid the possibility of any further clash, we adopted a table of 100.

 

The Final Resolution:

After trying out a handful of methods, we finally came up with a method that did work out in our favor. Let us share what steps did finally help us in addressing the problem of concurrent shopping that we faced:

A table consisting of 1 to 100 numbers was taken, with the sleep time by a range of 3.

Later, a random number was picked and a flag value for the same was set

Then, a greater number from those numbers with the range of 3 was picked

 

Below is the table that was created to bring out the final solution:

,

,

‘Flag’ was used to 0 by default, which will be automatically set to 1 every time the number is in use

 

How it works:

At the beginning of the transaction, the max sleep_time will be checked where flag=1

The sleep_time for the first user will be 0

After this, a random number from max sleep_time is selected with a range of 3

The first user’s range is 1-3

In the case of the second user, one number will be skipped after the max time and will be started after that number

In case a user gets the max sleep_time in 3 then the range for the random number will be 5-7

If the second user gets the random number as 6 then the random number range for the third user will be 8-10

The flag value will be updated as 1 for this random number

In the end, the flag value of the transaction will be updated with 0

 

The Final Say:

“All is well, that ends well.” And that’s exactly we have to say for this particular project. Yes, though we had coded and created many e-commerce websites before, this was the first time that we picked up a project to create a Drupal maintenance support plans 8 website with an online lottery system. And believe us, it was a monumental success for us and satisfying project for the client.


Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

AddWeb Solution: Building a Drupal maintenance support plans 8 Website with a Lottery Purchase System

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.