Best way to handle events in ecommerce store

553 views Asked by At

I have the ecommerce store.

I faced automatization problems as my business growing.

My website is written in PHP on Kohana Framework.

I want to automize many processes, but do not know where to dig deeper.

Example:

When order is recieved I want to fire the event "order.recieved". This event knows that my system needs to fire subevents and other actions:

  • to log inventrory changes asynchronously;
  • send to the procurement module out-of-stock products and their quantity;
  • to recreate sliced inventory table asynchronously;
  • send real-time message to crm system that order is recieved;
  • send sms to the client with message "We will call you soon";
  • etc.

Solutions I have in my head:

1) I think the simplest way is to rewrite my application on Laravel framework with it's event dispatcher.

Challenges:

  • I want use fifo (First In, First Out) for the inventory change;
  • I need digging to the code to know how many events I have in my system, when they are used,

2) Use AMQP Middleware like RabbitMQ.

Challenges:

  • I need digging to the code to know where exactly message is sent;
  • Maybe It can be solved with some event dispatcher, but ->;
  • Again, I need digging to the code to know how many events I have in my system, when they are used

Are php workers/consumers good to handle messages? Or I need to use python, nodejs?

Challenges:

  • I need to have many php workers/consumers. I think PHP is not good to handle this.

3) Use some webhooks management system.

4) Study more and use some bpm engine. Only one thing I know right now I can benefit using business rule engine for complex discounts.

What solution I need to take and get deeper with it?

0

There are 0 answers