Solved

eCommerce Website System Design

Posted on 2013-05-09
9
341 Views
Last Modified: 2013-05-19
My Requirement is purely this I need to create an infrastructure design which could be utilised to support the new website. The design should detail the number of servers, their memory and CPU configuration, the role of the server in the context of its delivery and the Operating Systems and applications which would need to be deployed. Any additional directly supporting
infrastructure such as firewalls should also be included.
List any assumptions which you have made.

I would like some direction on what Technical Experts out there think the best system setup would be.

Your thoughts please

Context
A customer is developing a new eCommerce website to allow for the business to better
sell its products to its UK customers. Development of the site is well underway and Java with
JSF and Servlets has been chosen as the most appropriate language and framework to meet
business requirements, in addition MySQL 5.6 will be used as the supporting database.

Non Functional Requirements
The development teams and business have the following requirements from the design of the
infrastructure which supports the site.

Site Volumetrics
The business is not able to provide a clear steer on the number of visitors or page
impressions likely to hit the site but the infrastructure supporting the application must be able
to scale quickly.

It is expected that the number of customers shopping via the site will grow by 4 times over
the next 3 years.

Database Size
Using the current number of customers, products and recently raised orders as a reference it
is expected that the database will grow to approximately 100GB in the first year.

Image Store
The site will provide product images and instructional videos requiring approximately 100GB
of storage in the first year.

Availability
The business has stressed the criticality of the website and demands that there is no single
point of failure from an infrastructure point of view.
0
Comment
Question by:Robert_Rayworth
  • 4
  • 4
9 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39154067
This question is beyond the scope of a Q&A forum.
Furthermore this sounds very much like an exam question.
0
 
LVL 26

Expert Comment

by:dpearson
ID: 39154470
The design doesn't really need to be very complicated - you'll want a pair of firewalls, at least 2 web servers and at least 2 database servers.  (The 2nd servers in each layer provide some level of redundancy - for more redundancy/performance you just increase the number of servers in each layer).

Since the design is Java + MySQL the OS will be a flavor of Linux.  You wouldn't want to run on Windows Server with those language choices.

Given the nature of the question there's really no way to answer things like "CPU and Memory choices".  You could guess, but there's almost nothing in the question to indicate the rate of requests per second - which is what you'd really need to know to estimate the servers.

Saying the database will grow to 100GB in a year means almost nothing - that could be done with virtually no load on the database or with massive database load, depending on the application (how many items are being sold and how rapidly is the information about them changing etc.)

These days if you want to have "rapid scalability" you're probably thinking something cloud based - like Amazon's EC2.

Good luck,

Doug
0
 

Author Comment

by:Robert_Rayworth
ID: 39166652
Hi Doug
Sorry for the late reply been very busy.
The scenario is for a customer I am dealing with and was looking to bounce ideas of someone else. It doesn't help that there are no real figures for utilisation etc...
I was thinking a pair of Cisco ASA5510's in high availability mode. Possibility of some Load balancers maybe.
What would be your choice of operating system being Linux? Centos Redhat and why?
Would you go for a 64bit version?
Also whats your reason for not using a Windows you mention you wouldn't want to run it on a Windows Server with those language choices. Whats your reason why?? interested to know.
What OS would you use for hosting the MySQL database would you have it as a cluster or would you setup it up to replicate in some other way.
For rapid scalability I was thinking possibly VMware but also was interested in Amazons cloud based solutions.
What is the database limit for MySQL 5.6?
Could the images of the products be kept within the database or would you recommend something else.
I am picking your brains because typically when asking my account manager he wants me to invest in some major hardware. I am not always confident I get the best return on investment and wanted to know my options.
Any direction or assistance is greatly appreciated.
0
 
LVL 26

Expert Comment

by:dpearson
ID: 39166709
Keep in mind that I'm a software engineer, not a sys admin but here's the choices I'd recommend:

What would be your choice of operating system being Linux? Centos Redhat and why?
We use CentOS.  It's a solid, stable choice and easy to find engineers who are familiar with it for support.

Would you go for a 64bit version?
That's a must these days.  4GB of RAM (the 32-bit limit) is nothing in the modern world.

Also whats your reason for not using a Windows you mention you wouldn't want to run it on a Windows Server with those language choices
Simplest reason is cost.  There's no reason to pay for a Windows box when you'd gain nothing from it for Java + MySQL.  Plus those are much more extensively used and tested on Linux that Windows these days.  If you said C# and SQL Server...well then it would be Windows :)

What OS would you use for hosting the MySQL database would you have it as a cluster or would you setup it up to replicate in some other way.
We use CentOS for all boxes including database just becomes uniformity simplifies things.
We don't set it up as a formal MySQL cluster because that's not a MySQL strength - we just do multi-master replication (A replicates to B and B replicates to A for each pair of servers).

For rapid scalability I was thinking possibly VMware but also was interested in Amazons cloud based solutions.
Both are fine - just depends on how much hardware you have access to directly and how quickly you think you'll scale.  We actually *don't* use Amazon because we didn't like the I/O throughput (although they've been working on that) but we also don't need to scale that quickly.

What is the database limit for MySQL 5.6?
That I don't know.

Could the images of the products be kept within the database or would you recommend something else.
They could be, but storing images in a SQL database seems inefficient.  Generally easier to just put the images somewhere else (e.g. in Amazon S3 or just on your web server) and store the path in the database.

Good luck,

Doug
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Robert_Rayworth
ID: 39169882
Hi Doug
Thanks ever so much for your input.
A few last things to clarify.
With the web servers how would you load balance them I was thinking of using a pair of Jet nexus boxes. Do you think this is over kill what would your approach be?

Hardware wise what would be your choice of spec in regards (Web Servers) of CPU and Memory and with that choice in your professional experience how many active connections could it support and service. Would higher CPU and Memory give me better return of investment. This is assuming I am using Centos 64bit. Also what would you spec for the MySQL boxes.

Would your design have a setup using a SAN to store all the images, videos and other data generated?

Hence why I was thinking having VM's so if they required more resources its easier to increase and limits my down time.
0
 
LVL 26

Expert Comment

by:dpearson
ID: 39170397
With the web servers how would you load balance them I was thinking of using a pair of Jet nexus boxes. Do you think this is over kill what would your approach be?

We started out just using round robin DNS for load balancing - since that costs nothing.  It's easy to start there and then actual load balancers later if you find you need them and by then you'll know your traffic patterns and can buy the right boxes.

Hardware wise what would be your choice of spec in regards (Web Servers) of CPU and Memory
Web servers are usually easy because they are simple to scale.  They (should) be storing no data, so they just provide computation, which is the simple part of the system to expand - just add another box into the server pool and you get a linear increase in capacity.  So given that we've been running low end boxes (Xeon 2GHz processor, 16GB RAM) and 2 web servers like that can handle thousands of requests per minute.  We use a CDN to keep down load on the web servers, keep costs low (it's cheaper than our data center bandwidth costs) and boost global performance.  So if you do that you can even millions of requests per minute to your users - but because that doesn't come back to your origin servers.

Also what would you spec for the MySQL boxes.
This is where you will spend your money.  Databases unlike web servers can't be scaled out linearly by just adding more of them - at least not unless you design your software carefully.  If they're VMs that helps in turns of flexibility over time - but generally costs significantly in terms of I/O throughput (i.e. MySQL on a VM may only get half the performance of MySQL on the native hardware) so you can flexibility but it costs more.  Specs here are much harder to just guess at.  We run beefy database servers with 96GB of RAM and 24 high speed hard drives.  But our load won't be your load.

Would your design have a setup using a SAN to store all the images, videos and other data generated?
We looked at SANs but they're crazy expensive for the storage you get.  In the end we started with just a simple NFS file server and decided later on that was a big mistake and moved all image storage to Amazon's S3.  It's vastly cheaper and scales much better than buying your own SAN.

Hope that helps,

Doug
0
 

Author Comment

by:Robert_Rayworth
ID: 39176169
Last question promise please could you just clarify a few points your raised

1. You mentioned using round robin DNS for load balancing please could you explain exactly what you mean by this I think I catch your drift just wanted to be double sure.

2. The MySQL box from your technical design am I right in thinking you have 2x of them. Each replicating the data over to the other. If this is the case is the replication real time do you suffer any latency? If the primary MySQL box was to die how do you approach the task of the web servers seeing the other secondary MYSQL box. I am trying to eradicate the single point of failure issue.

3. Do you have any diagrams you wouldn't mind sharing of your typical setup
0
 
LVL 26

Accepted Solution

by:
dpearson earned 500 total points
ID: 39179840
1. You mentioned using round robin DNS for load balancing please could you explain exactly what you mean by this I think I catch your drift just wanted to be double sure.

You just setup multiple ips for the same domain name - so DNS then selects among the servers.   It's not as good as a full load balancer since it won't consider how loaded your servers are, but it's simple to implement and gets you started.  A slightly smarter model is mapping DNS to external, public names (e.g. www.mysite.com -> myweb1.mysite.com and myweb2.mysite.com and then you map those to a specific IP.  That way if myweb1 fails, you can map both myweb1 and myweb2 to the same IP (that of the second web server)).

2. The MySQL box from your technical design am I right in thinking you have 2x of them. Each replicating the data over to the other. If this is the case is the replication real time do you suffer any latency? If the primary MySQL box was to die how do you approach the task of the web servers seeing the other secondary MYSQL box. I am trying to eradicate the single point of failure issue.

Yes that's right, server A replicates to server B and vice versa.  A simpler arrangement is just to have the replication be one way (A->B) but doing it in both directions means we can apply slow patches live (we break replication, patch B, perhaps taking an hour or more while it continues to receive updates from A and then switch to B being the read master.  Then we restart replication and now A gets the patch, but it's no longer the master for reads, so it can take its time applying the patch).  The switching and failover support is all done by remapping the IPs for the server.  E.g. You can have prime.database -> A's IP and secondary.database -> B's IP.  The code all reads/writes from prime.database.  If A fails, you remap the IPs so now
prime.database->B and secondary.database->A (which is now offline).
Ideally that remapping is done by a monitoring script - so if A fails at 3am, the traffic just switches over automatically.

3. Do you have any diagrams you wouldn't mind sharing of your typical setup
Sorry - we don't draw many pictures.  We just talk over the designs and settle on what we think is correct :)

Doug
0
 

Author Closing Comment

by:Robert_Rayworth
ID: 39180011
Very helpful and long explanations as to why items are setup like they are
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now