Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data Driven vs Event Driven model/architecture?

I heard the terms Data Driven and Event Driven model from different folks in past. I did google but these terms are still vague to me as both of them looks similar to me

Data driven programming is a programming model where the data itself controls the flow of the program ( not the program logic) where in case of Event driven programming , it is the event not the data itself controls the flow of the program.

Per mine understanding event is also the data . For example in employee based web application - If user clicks the create employee button, here event is create employee(which is also kind of data only) and data is employee related information.

Now at server first it will be event which will decide what will be flow of program and then data(employee related information) will also control the flow of execution like if permanent employee different method will be executed and if temporary it will be different

So is not every thing a data driven architecture ? If no what is the difference between them ? Any web based example will help

like image 306
emilly Avatar asked Feb 11 '17 10:02

emilly


People also ask

What is the difference between data driven and event-driven?

What Is the Difference between Data-Driven and Event-Driven Programming? In data-driven programming, the data triggers the flow of the program. On the other hand, the event-triggered programming model executes steps depending on events.

How is event-driven architecture different?

Event-driven architectures are push-based, so everything happens on-demand as the event presents itself in the router. This way, you're not paying for continuous polling to check for an event. This means less network bandwidth consumption, less CPU utilization, less idle fleet capacity, and less SSL/TLS handshakes.

What are event-driven architecture models?

Event-driven architecture is a software architecture and model for application design. With an event-driven system, the capture, communication, processing, and persistence of events are the core structure of the solution. This differs from a traditional request-driven model.

What is the difference between a request driven and event-driven software architecture?

In request-response architecture, an application's components communicate via API calls. The client sends a request and expects a response before performing the next task. In event-driven architecture, the client generates an event and can immediately move on to its next task.


2 Answers

The explanation above is very apt. To supplement the above answer, in Data Driven Architecture the business can feed in the logic directly in the data sheet thereby making it very easy to control the logic in the downstream components. Feeding is generally done using user friendly tools. Generally a product Master File is maintained which consists of the data variables and those are updated depending on the business requirement. It is so much easy for business to do this and a huge cost savings compared to event driven where every small change in business requirement resulted in huge cost to develop-test-deploy the piece of software.

like image 107
Nachiket Ingaleshwar Avatar answered Sep 28 '22 09:09

Nachiket Ingaleshwar


data itself controls the flow of the program ( not the program logic)

I guess you are not completely understand what is “flow” in this context. Flow is logic itself. For example, if you are executing some method that does A, then B, then C to it's arguments, logic would be “Apply A, B, C” and flow would be the same if actions A, B, C are extracted to separate methods. So, flow and logic are synonyms.

Data driven programming means that some general code exists. It does not contain any business logic, it does not control flow. It's just a tool to read and process data and output result. What controls flow and logic is data itself. So, if you want to change business logic (literally change result of your program), you change data, not code.
And your code is, well, it is a kind of pipeline that executes commands depending on input data. You can think of such code as of eval function in javascript.

In Event driven programming logic is controlled by events. And that means that data is only data, and all business rules are placed in code. Event would carry some data, and logic could be changed depending on event's data, but the difference here is where these changing logic rules are placed — in data or in code; and in case of EDP, the logic is in code.

Also, take a look at this question, some answers could shed some light on the subject.

like image 23
cassandrad Avatar answered Sep 28 '22 08:09

cassandrad