What is a data-centric application and is there any difference with an object-oriented application model ?
OOP can be used to create a data centric application. Some of the large multi-tier architectures which people think of when they say OOP architecture implement business logic in code and just store the data in the database.
A data-centric approach is when you systematically change or enhance your datasets to improve the performance of the model. This means that contrary to the model-centric approach, this time the model is fixed, and you only improve the data. Enhancing the dataset can have different meanings.
As we talked about in our last article, being data-driven is a mindset that involves making strategic decisions based on data and insights. In one way, data centricity is a mindset, but really, it's architecture. Data-centric organizations see data as a fixed, immovable asset.
Data-centric computing is an approach that merges innovative hardware and software to treat data, not applications, as the permanent source of value. Data-centric computing aims to rethink both hardware and software to extract as much value as possible from existing and new data sources.
A data centric design is one where the application behavior is encapsulated by data. A simple example. Consider the following OOP class:
class Car {
void move(x, y);
private:
int x, y;
}
This is an OOP representation of a car. Invoking the 'move' method will trigger the car to start moving. In other words, any side effects are triggered by invoking the class methods.
Here's the same class, but data centric:
class Car {
int x, y;
}
In order to get this car moving, I would "simply" change the values of x and y. In most programming languages changing members won't allow for the execution of logic, which is why data centricity often requires a framework.
In such a framework, logic is ran upon the C, U and D of CRUD. Such a framework will provide the appropriate facilities to enable code insertion at any of these events, for example:
Data centric design has many implications. For example, since an application state is effectively represented by its data, you can automatically persist the application. A well-written data centric application can be stored, stopped and restored from a database, and continue like it was never gone.
Data centric designs are a good match for traditional 3 tier web architectures. Web applications are typically driven by the contents of the backend database. That is why, when you close and reopen a dynamic webpage, it still looks the same (provided the data didn't change).
The two concepts are somewhat orthogonal, a Data Centric Application is one where the database plays a key role, where properties in the database may influence the code paths running in your application and where the code is more generic and all/most business logic is defined through database relations and constraints. OOP can be used to create a data centric application.
Some of the large multi-tier architectures which people think of when they say OOP architecture implement business logic in code and just store the data in the database. However, it would be wrong to think Object Oriented design necessarily has to be a large business logic ridden system.
Say you have to implement message passing between two systems. One way (although a bad way) is to have each of the systems write the messages to the database and the other system read from the database every so often to pick up messages. This would be a data centric approach as there is very little code needed other than reading and writing data.
The same system could be implemented by having the systems open a socket connection to each other and send messages directly. In this way there is more code and less database access. This is the non-datacentric approach. Either of these could be implemented using OOP concepts.
Another example from my work we implement servers for games, one type of server handles multi-player game play so user presses the button and spaceship fires missile at other player. This server is not datacentric it is event based. Another server stores the users high scores, friend lists etc this server is thin wrapper over the database which stores the score and lists.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With