Post by Dakinariten » Mon Jan 17, 2022 8:46 pm

Hello,

I'm a 4th year CompSci student, and am seeking your help - for my final year project I am investigating leveraging containers to make an Opencart website more scalable (and highly available). One of my lecturers suggested implementing built-in MySQL scaling e.g. Master/Slave, however from research it seems that Opencart does not natively support the separation of read/write.

I did find a post on the Opencart 2.0 support about using MySQL proxy to overcome this, however I have no experience between Opencart 2 & 3, so have no idea if it is applicable.

For the container I am currently using Bitnami, however I will also be looking at a custom container image for comparison

I would appreciate any help in pointing me in the right direction, as my Google Fu has proved relatively fruitless thus-far
Last edited by Dakinariten on Wed Jan 19, 2022 9:50 pm, edited 1 time in total.

Newbie

Posts

Joined
Mon Jan 17, 2022 8:41 pm

Post by mikeinterserv » Mon Jan 17, 2022 11:52 pm

Dakinariten wrote:
Mon Jan 17, 2022 8:46 pm
One of my lecturers suggested implementing built-in MySQL scaling e.g. Master/Slave,
Yep - typical of overcomplicating a thing - well - because.
If you are building the next Amazon then continue, If not, you are looking at a myriad of complications that will increase the cost and maintenance of the project beyond economic viability in most instances.

You can have a look at this also.
https://cloud.google.com/architecture/e ... nvironment

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by paulfeakins » Tue Jan 18, 2022 10:18 pm

Dakinariten wrote:
Mon Jan 17, 2022 8:46 pm
One of my lecturers suggested implementing built-in MySQL scaling
Instead I'd suggest looking more in to caching as much as possible.

There are loads of cache plugins for OpenCart from Lightening to NitroPack Cache to LiteSpeed etc. (https://www.litespeedtech.com/products/ ... celeration)

The key would be only querying the database when absolutely necessary and serving everything else from pre-rendered pages.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by khnaz35 » Tue Jan 18, 2022 11:45 pm

Will suggest may be request your professor to make a solution and share with rest of us here 😀.

Let look at the OC with a new prospective.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by mikeinterserv » Tue Jan 18, 2022 11:53 pm

khnaz35 wrote:
Tue Jan 18, 2022 11:45 pm
Will suggest may be request your professor to make a solution and share with rest of us here 😀.

Let look at the OC with a new prospective.
Making this solution is NOT difficult - Its just NOT needed in 99% of cases.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by Dakinariten » Wed Jan 19, 2022 4:46 am

After hitting a brick wall with research, I reached out here (and via email to a couple of lecturers) hoping that I could find something to point me in the right direction.
My lecturer replied with "check out MySQL proxy called Amoeba", and then suggested I buy an off-the-shelf solution...so mikeinterserv hit the nail on the head (thank you for the link, btw)! Seems like it was filling air space, rather than being a helpful suggestion. To be honest, from looking into MySQL scaling, it did seem like a solid idea, however as you all mentioned, needless complication

Thank you all so much for the help. In my past experience, usually when you hit a road-block like this, it's usually from incorrect search terms (and not knowing the methods of implementation). That's what I was hoping was the case here, however given your reactions (and the general tone of the reply from the lecturer), it won't be necessary to implement - most likely enough to say why it wasn't implemented in the report.

PS: @paulfeakins - cheers for the link. I'll have a good look at optimising, and separating via caching instead. Thank you so much!

Newbie

Posts

Joined
Mon Jan 17, 2022 8:41 pm

Post by by mona » Wed Jan 19, 2022 6:04 am

If you question has been solved please be so kind as to add [SOLVED] to the title of our post.

Just to add .. caching is not scaling, caching is a last ‘desperate' resort for performance problems often causing more problems than it solves when applied to eCommerce (dynamic) sites and must be implemented with care.

OC does not separate DB reads and writes and this would be correct.

If you want to do DB scaling you would have to use Mysql proxy or Mysql router.
With proxy you can redirect specific queries to a specific DB server, with router you can merely obtain high availability.

But even if you separate DB instances for read and write and sync the DBs you would still have an application server as a bottleneck.
And putting all that on a single server even with multiple containers would not help much, your professor should probably know that.

For real application scaling you would require a load-balancer routing traffic to multiple application+db servers and have the db instances sync as master-master. That would however be a little too costly for your project.

To satisfy you professors, I suggest to search for mysql proxy and see how that can be set up, it is fairly straightforward.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by Dakinariten » Wed Jan 19, 2022 9:51 pm

by mona wrote:
Wed Jan 19, 2022 6:04 am

If you want to do DB scaling you would have to use Mysql proxy or Mysql router.
With proxy you can redirect specific queries to a specific DB server, with router you can merely obtain high availability.

But even if you separate DB instances for read and write and sync the DBs you would still have an application server as a bottleneck.
And putting all that on a single server even with multiple containers would not help much, your professor should probably know that.

For real application scaling you would require a load-balancer routing traffic to multiple application+db servers and have the db instances sync as master-master. That would however be a little too costly for your project.

To satisfy you professors, I suggest to search for mysql proxy and see how that can be set up, it is fairly straightforward.
Thank you for the pointer - I have updated the title, and I really cannot stress how much I appreciate the help from all of you

Newbie

Posts

Joined
Mon Jan 17, 2022 8:41 pm
Who is online

Users browsing this forum: No registered users and 102 guests