<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: /\\: Fabien PORTES</title>
    <description>The latest articles on DEV Community by /\\: Fabien PORTES (@fabienportes).</description>
    <link>https://dev.to/fabienportes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F821889%2F85b09061-b3de-4ef9-89b7-c5e24643d904.jpg</url>
      <title>DEV Community: /\\: Fabien PORTES</title>
      <link>https://dev.to/fabienportes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fabienportes"/>
    <language>en</language>
    <item>
      <title>What is DataOps and how to make it real with Dataform ?</title>
      <dc:creator>/\\: Fabien PORTES</dc:creator>
      <pubDate>Thu, 07 Dec 2023 16:48:06 +0000</pubDate>
      <link>https://dev.to/stack-labs/what-is-dataops-and-how-to-make-it-real-with-dataform--em4</link>
      <guid>https://dev.to/stack-labs/what-is-dataops-and-how-to-make-it-real-with-dataform--em4</guid>
      <description>&lt;p&gt;The software development world has advanced CI/CD tools, enabling efficient software delivery. The data world is catching up adopting CI/CD practices for successful data platforms. With automation and cloud technologies, data teams can automate data processes and ensure reliability and scalability.&lt;/p&gt;

&lt;p&gt;This is where DataOps starts. DataOps is a set of practices to improve quality, speed, and collaboration and promote a culture of continuous improvement between people working on data analytics.&lt;/p&gt;

&lt;p&gt;By converging software development and data practices, organizations maximize the potential of their data assets for informed decision-making. First part of the article will relate each step of a devops CI/CD to a step of a Data Ops CI/CD. The second part will show how Dataform can help for each of these steps.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the expectations of a DataOps CI/CD ?
&lt;/h1&gt;

&lt;p&gt;As for software development projects, a data project needs a CI/CD chain that will ensure the modifications to the code base will be automatically tested and deployed. The code base here is the logic written in SQL that transforms raw data into curated consumable data.&lt;br&gt;
The software development world can help us to identify the key features of a successful data CICD.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Compilation
&lt;/h2&gt;

&lt;p&gt;In the software development world, the compilation is used to build an executable package and ensure there are no syntax errors in the language used. There still can be some runtime errors but at least the code follows the language rules. For an interpreted language we can make an analogy with the language parser used by the linter.&lt;/p&gt;

&lt;p&gt;Similarly, in the context of a data project, this step focuses on validating the written SQL transformations. In the case of a sequence of transformations, it becomes crucial to verify that the resulting directed acyclic graph (DAG) generated by these transformations is valid. This verification can be conducted during the compilation step, as well as with the aid of a linter integrated into your preferred code editor.&lt;br&gt;
By employing a compilation step and leveraging a linter, the following benefits can be obtained:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Language compliance: The compilation step ensures that the SQL transformations conform to the syntax and rules specified by the database management system or query language.
Syntax validation: The linter performs static analysis on the SQL code, highlighting potential syntax errors, typos, or incorrect usage of language constructs. It helps identify issues early in the development process, promoting clean and error-free code.&lt;/li&gt;
&lt;li&gt;Structural integrity: In the case of a chain of transformations, verifying the resulting DAG's validity is crucial. By confirming that the graph is acyclic, developers can ensure that data flows correctly through the transformations without encountering circular dependencies or infinite loops.&lt;/li&gt;
&lt;li&gt;IDE integration: IDEs equipped with linters offer real-time feedback and suggestions while writing SQL code, enabling developers to spot and rectify errors immediately. This streamlines the development workflow and enhances code quality.
By combining compilation checks and leveraging linters, developers can improve the reliability and correctness of their SQL transformations in data projects. This proactive approach helps catch errors early, promotes adherence to language rules, and ensures the integrity of the transformation process within the overall project.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  2. Unit Testing
&lt;/h2&gt;

&lt;p&gt;Unit testing in computer science is a software testing technique used to verify the correctness and functionality of individual units or components of a software application. A unit refers to the smallest testable part of a program, such as a function or a method. The purpose of unit testing is to isolate and test each unit in isolation, ensuring that it behaves as expected and meets the specified requirements.&lt;br&gt;
In a data project, unit testing involves verifying the accuracy and functionality of a SQL transformation that generates outputs based on input data. It is beneficial to utilize mock data during unit testing to ensure consistent and expected results are obtained with each test run.&lt;br&gt;
During unit testing of a SQL transformation, mock input data can be employed to simulate various scenarios and validate the behavior of the transformation. By providing predetermined input data, developers can assess whether the transformation produces the anticipated output(s) as defined by the test cases.&lt;br&gt;
This will ensure&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;early bug detections in the SQL query in case the logic is wildly changed&lt;/li&gt;
&lt;li&gt;code maintainability: unit test are a way to document code and provide insights on the logic implemented&lt;/li&gt;
&lt;li&gt;modularity: unit testing encourages modular design emphasizing the individual units. You might write simpler and more modular SQL queries if you write unit tests for them
faster feedback loop: unit tests are easily executable and fast, providing immediate feedback of the correctness of a unit.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  3. Deployment
&lt;/h2&gt;

&lt;p&gt;In software development once the tests pass and the code analysis is satisfactory, the deployment step is triggered. The artifacts are deployed to the target environment, which can include development, staging, or production environments, depending on the deployment strategy.&lt;br&gt;
In a data project, deployment can be seen as the step where the SQL queries are run on the target environment. The compiled direct acyclic graph is actually run on the environment to produce the data objects defined.&lt;br&gt;
The deployment step in a data project plays a pivotal role in transforming raw data into meaningful and usable insights. By executing SQL queries on the target environment and running the compiled DAG, data objects are generated, paving the way for further analysis, reporting, or utilization within the project.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Integration test
&lt;/h2&gt;

&lt;p&gt;Integration testing, in the context of software development, is a testing technique that focuses on verifying the interactions and cooperation between different components or modules of a system. Integration tests aim to identify issues that may arise when multiple components are integrated and working together as a whole.&lt;br&gt;
Integration tests play a crucial role in ensuring the accuracy and reliability of the data project by validating the integrity and consistency of the transformed data. By examining the output tables resulting from the executed DAG, these tests assess whether the data conforms to the expected format, structure, and content.&lt;br&gt;
The key aspects to consider when conducting integration tests in a data project are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Real data evaluation: Integration tests involve analyzing the transformed data with real-world characteristics.&lt;/li&gt;
&lt;li&gt;DAG transformation verification: The integration tests focus on verifying the proper execution of the DAG of transformations. By evaluating the resulting tables, developers can identify any unexpected or incorrect data manipulation that may occur during the transformation process.&lt;/li&gt;
&lt;li&gt;Anomaly detection: Integration tests aim to uncover any anomalies or inconsistencies in the transformed data. This includes detecting missing data, data corruption, data loss, or any deviations from the expected outcomes.&lt;/li&gt;
&lt;li&gt;Validation against requirements: Integration tests assess whether the transformed data aligns with the specified requirements and business rules. This ensures that the data project delivers the expected results and meets the defined criteria for success.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To effectively perform integration tests in a data project, it is crucial to develop comprehensive test cases that cover various scenarios, including edge cases and critical data paths. These tests should be automated to enable frequent execution and ensure consistency in the evaluation process.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Software&lt;/th&gt;
&lt;th&gt;Data&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Compilation&lt;/td&gt;
&lt;td&gt;Syntax, typing validation &lt;br&gt; Artefact generation&lt;/td&gt;
&lt;td&gt;DAG generation and validation&lt;br&gt; SQL syntax validation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unit Tests&lt;/td&gt;
&lt;td&gt;Code functionality testing&lt;/td&gt;
&lt;td&gt;Query logic testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Artefacts deployment&lt;/td&gt;
&lt;td&gt;DAG execution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration Test&lt;/td&gt;
&lt;td&gt;System testing&lt;/td&gt;
&lt;td&gt;Data Testing&lt;br&gt; Functional testing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h1&gt;
  
  
  How to make DataOps with Dataform ?
&lt;/h1&gt;

&lt;p&gt;To meet the industrial requirements of DataOps, a continuous integration and continuous development chain must be established based on the cool features of Dataform. Dataform is a service for data analysts to develop, test, version control, and schedule complex SQL workflows for data transformation in BigQuery.&lt;/p&gt;

&lt;p&gt;Let's explore how DataOps can be achieved with Dataform based on the DataOps expectations of the previous paragraph.&lt;/p&gt;
&lt;h1&gt;
  
  
  1. Compile the changes
&lt;/h1&gt;

&lt;p&gt;You can compile your project using the Dataform CLI or APIs through the web user interface. The compilation process checks that the project is valid by verifying the following points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are the dependencies used existing?&lt;/li&gt;
&lt;li&gt;Are the config blocks correct?&lt;/li&gt;
&lt;li&gt;Is the templating used valid?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The output of the compilation is a DAG of the list of actions to be run, corresponding to the tables to be created and the operations to be performed on your data warehouse. This output can be displayed as JSON through the CLI.&lt;br&gt;
Below is a truncated output example defining a source table and a downstream one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "tables": [
        {
            "type": "table",
            "target": {
                "schema": "demo",
                "name": "source_table",
                "database": "demo_db"
            },
            "query": "SELECT 1 AS demo",
            "disabled": false,
            "fileName": "definitions/demo/demo_source.sqlx",
            "dependencyTargets": [],
            "enumType": "TABLE"
        },
        {
            "type": "table",
            "target": {
                "schema": "demo",
                "name": "downstream",
                "database": "demo_db"
            },
            "query": "SELECT * FROM source_table",
            "disabled": false,
            "fileName": "definitions/demo/downstream.sqlx",
            "dependencyTargets": [
                {
                    "schema": "demo",
                    "name": "source_table",
                    "database": "demo_db"
                }
            ],
            "enumType": "TABLE"
        }
    ],
    "projectConfig": {...},
    "graphErrors": {...},
    "declarations": {...},
    "targets": {...}
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  2. Run unit tests
&lt;/h1&gt;

&lt;p&gt;Using the test feature of Dataform, unit tests can be run against queries to validate SQL code logic. It will ensure the logic of SQL queries is fulfilled. Indeed for a given select statement you can mock the from clause with fake data and also mock the expected result of the query with these fake data. If the query logic is changed in a way that the mocked output data doesn’t match with the query run on the mocked input data, an error is raised.&lt;br&gt;
Unit tests give you confidence that your code produces the output data you expect. In case the test is failing an error is thrown and you can prevent merge of the changes to your code base.&lt;br&gt;
Below is an example of testing &lt;em&gt;downstream&lt;/em&gt; dataset defined on the previous example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;config {
  type: "test",
  dataset: "downstream"
}

input "ages" {
  SELECT 1 AS demo
}

SELECT 1 AS demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  3. Run the changes
&lt;/h1&gt;

&lt;p&gt;You can run your project using the Dataform CLI or APIs through the web user interface. Running a project is actually running the DAG of the actions generated at the compilation step. The actions can be creations of tables and views as well as feeding tables with the logic implemented.&lt;br&gt;
You can also specify a specific action to be run or a list of actions that match specific tags. This is very useful to schedule different parts of the project at different frequencies.&lt;/p&gt;
&lt;h1&gt;
  
  
  4. Run the integration tests
&lt;/h1&gt;

&lt;p&gt;The Dataform assertions can be used to run integration tests once your project has been run. With assertions test you can validate the content of the data and throw an error in case data quality is not matching your expectations.&lt;br&gt;
Assertions is a SQL query that should not return any row. You can see it as a query that is looking for errors in the data. For instance the following query creates an assertion that checks if the id column does not contain null values.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SELECT id FROM ref("table_1") WHERE id is not null&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;It also has table_1 as a dependency. So once the table_1 is built the assertion will run and check for errors in the data. If errors are found the assertion will fail and raise an error. This way you can ensure data quality of your data platform.&lt;br&gt;
Assertions can also be manually configured as dependencies of the DAG of the queries to be run so that you can interrupt the project run on case assertions are not fulfilled.&lt;br&gt;
Below is an example of adding simple assertions to the previous defined downstream table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;config {
  type: "table",
  assertions: {
    uniqueKey: ["demo"],
    nonNull: ["demo"],
    rowConditions: [
      'demo is null or demo &amp;gt; 0'
    ]
  }
SELECT 1 AS demo
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;All of the features proposed by Dataform integrate well with a CI/CD tool chain as typical steps can be performed to validate and deploy changes to the SQL code base. This brings data engineering to a level of industrialisation on par with the software development world.&lt;/p&gt;

&lt;p&gt;Follow up my next article that will talk about a concrete industrialisation example of dataform !&lt;/p&gt;

&lt;p&gt;Thanks for reading! I'm Fabien, data engineer at Stack Labs.&lt;br&gt;
If you want to discover the &lt;a href="https://cloud.stack-labs.com/cloud-data-platform" rel="noopener noreferrer"&gt;Stack Labs Data Platform&lt;/a&gt; or join an enthousiast &lt;a href="https://www.welcometothejungle.com/fr/companies/stack-labs" rel="noopener noreferrer"&gt;Data Engineering team&lt;/a&gt;, please contact us.&lt;/p&gt;

</description>
      <category>data</category>
      <category>dataops</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>10 principles for your event driven architecture</title>
      <dc:creator>/\\: Fabien PORTES</dc:creator>
      <pubDate>Wed, 07 Jun 2023 21:04:13 +0000</pubDate>
      <link>https://dev.to/stack-labs/serverless-day-10-principles-for-your-event-driven-architecture-2lb7</link>
      <guid>https://dev.to/stack-labs/serverless-day-10-principles-for-your-event-driven-architecture-2lb7</guid>
      <description>&lt;p&gt;Today I had the opportunity to assist at the Serverless day event in Paris. This event is dedicated to fostering a community around serverless technologies. There have been many conferences especially about AWS lambdas optimization and architecture and event driven architectures. These topics are indeed key in the serverless world.&lt;/p&gt;

&lt;p&gt;One conference particularly held my attention. Luc VAN DONKERSGOED, AWS Hero gave us 10 principles to avoid chaos in a serverless event driven architecture journey. I will summarize them in this article to make you find peace of mind in case you are working on a microservices event driven architecture.&lt;/p&gt;

&lt;p&gt;The principles are divided in 3 categories.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event design
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Use Json, not text, yaml, Avro or Protobuf
&lt;/h3&gt;

&lt;p&gt;Using json as a unique message format is the way to go in the event driven architecture paradigm because json is evolutive. Your events payload is likely to evolve and json can support you in this evolution with the introduction of new keys without breaking changes.&lt;/p&gt;

&lt;p&gt;Json is also extensively and natively supported by most of the services and libraries you can work with.&lt;/p&gt;

&lt;p&gt;The benefits of compression from an Avro or Protobuf format is not worth it as it will require some extended decompression steps. Yaml is also not recommended because it is made for humans not for machines and usually needs a specific parser to be decoded.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use event enveloppe for metadata
&lt;/h3&gt;

&lt;p&gt;Your event will benefit from transporting metadata related to it, like a unique identifier, time at which it was generated etc… These metadata should be part of the json payload in a dedicated entry. The payload itself should appear in the data entry so that the payload looks like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "metadata": {
        "event_id": "uuid",
        "event_time": "Timestamp"
    },
    "data": {
        "height_kg": 12,
        "width_cm": 14
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Metadata will help in the observability of your microservices architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use unique event id
&lt;/h3&gt;

&lt;p&gt;You should embed in the metadata of your event payload a unique id of your event. You can easily generate a uuid to do so. Unique identifier of your event is crucial to trace events and make observability of your solution real.&lt;/p&gt;

&lt;p&gt;By following these 3 first principles you can design event payload in a way that will let you make them evolve easily. Now we need to evolve and communicate within our microservices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Communicate and evolve
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Use schemas and contract
&lt;/h3&gt;

&lt;p&gt;The first step to enable serene communication between your microservices is to use a contract between your microservices. These will make a consumer services not to know anything about the producer service but only know the contract that bound the producer to its output. This will ensure decoupling of producer and consumer service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maintain backward compatibility
&lt;/h3&gt;

&lt;p&gt;Once you define a contract between your microservices, you should include in your metadata entry the version of the event schema. In case of a breaking change, the event version will evolve and the consumers of these events will know what version of the schema to use to adapt to it. This will ensure you can maintain backward compatibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maintain schema registry
&lt;/h3&gt;

&lt;p&gt;For a consumer to retrieve the schema of an event, we need a central place to store the schema of your events. This is the responsibility of the schema registry, a single source of truth of all the schemas of the events generated by your microservices.&lt;/p&gt;

&lt;p&gt;You can use json schema to declare the schema of your event version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use an event broker as a transportation layer
&lt;/h3&gt;

&lt;p&gt;This is the key piece to decouple your microservices. Once you have a schema registry to store the contract between your microservices, you will want to use an event broker to completely decouple them. The event broker will receive the events of the producers and forward them to the consumers. In case of a failure of a consumer the event broker will act as a buffer for the events and the consumer will treat the events queue once it is back alive.&lt;/p&gt;

&lt;p&gt;There is now no more interaction microservice to microservice but just producers that push events to the event broker and consumers that read events from the event broker. We now need some principles to integrate and support our event driven architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrate and support
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Use event supporting APIs
&lt;/h3&gt;

&lt;p&gt;As your architecture evolves you will need to add entries to your data payload of your event. For example a consumer can need the color of a car while another needs the brand and another one the price. It can be tempting to add all of these information to your event payload but at some point the payload will get too big.&lt;/p&gt;

&lt;p&gt;Instead you should make the producer expose a ressource APIs to get more information about the resource of an event. The event will hold the identifier of the ressource and you will query the producer to know more about the resource attributes. This way you can keep your payload size relatively small.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the storage first pattern
&lt;/h3&gt;

&lt;p&gt;In order to avoid unpredictable latency of microservices, you should use the storage-first pattern. A consumer should first store the message, acknowledge the reception of the message and then process it from the storage. This way your microservices are even more loosely decoupled.&lt;/p&gt;

&lt;p&gt;In addition, as your events hold a unique identifier and you store them, you can ensure the single processing of a unique event. Indeed you can check when an event arrives if it is already stored and if so implement the desired logic. This principle can also help make your architecture idempotent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trace your events
&lt;/h3&gt;

&lt;p&gt;Last principle is about tracing your event for the observability of your microservices. You can include in the metadata section a unique trace id and span id that will help you build a monitoring system that can follow the trace of individual steps of a request. The trace id will identify the request while the span id identifies the steps. This information can be cascading in the event metadata section of the events.&lt;/p&gt;

&lt;p&gt;I thank Luc VAN DONKERSGOED and I hope these principles will help you find peace of mind in case you're in the process of building an event driven architecture with microservices. If not, you can ask me for further guidance !&lt;/p&gt;

&lt;p&gt;Thanks for reading! I'm Fabien, data engineer at Stack Labs.&lt;br&gt;
If you want to discover the &lt;a href="https://cloud.stack-labs.com/cloud-data-platform" rel="noopener noreferrer"&gt;Stack Labs Data Platform&lt;/a&gt; or join an enthousiast &lt;a href="https://www.welcometothejungle.com/fr/companies/stack-labs" rel="noopener noreferrer"&gt;Data Engineering team&lt;/a&gt;, please contact us.&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>eventdriven</category>
      <category>microservices</category>
      <category>architecture</category>
    </item>
    <item>
      <title>DLDB.IO: google analytics alternative, GDPR compliant by design</title>
      <dc:creator>/\\: Fabien PORTES</dc:creator>
      <pubDate>Tue, 13 Dec 2022 13:56:57 +0000</pubDate>
      <link>https://dev.to/stack-labs/dldbio-google-analytics-alternative-gdpr-compliant-by-design-1a06</link>
      <guid>https://dev.to/stack-labs/dldbio-google-analytics-alternative-gdpr-compliant-by-design-1a06</guid>
      <description>&lt;p&gt;Analytics solutions are used by enterprises to better understand their clients and refine their business.&lt;br&gt;
Let’s say I have a business proposing an application developed to control the engine of e-bikes and to provide insights on the users’ rides. The usual analytic solution collects data about the users and its position and then performs analytics on them. For example, I could know what are the best places to install a new charging station. I would just have to query my data looking for places where the e-bike users end up with less than 5% of battery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current way of doing analytics
&lt;/h2&gt;

&lt;p&gt;The use case mentioned above seems naive but it requires three steps.&lt;br&gt;
First, I need to collect from the application some unique ID like my users’ device and their geolocation. It would help me to perform further analytics on the data like looking for the most popular places where e-bikes batteries are under 5%. These data are personal as they can be used to identify individuals using the app. For example, we can get places of living from the data. In Europe, due to GDPR, it means I need to retrieve the end user's consent to collect and process such data. I must also process them in Europe.&lt;br&gt;
Secondly, we need a central place to store this data and a place that scales well with the number of users and granularity of the collected data.&lt;br&gt;
Finally, the computational power must scale with the data volumetry collected.&lt;/p&gt;

&lt;p&gt;The figure below describes how we usually do analytics.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qxjsv6nipolo1kx0hht.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qxjsv6nipolo1kx0hht.jpeg" alt="Traditional analytics solution architecture" width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, in Europe, the GDPR requirements are to be handled by the juridic department of the business. The collection and processing of data is provided by cloud platforms. Then solutions to do analytics exist and the question is about how much will it cost ?&lt;/p&gt;

&lt;p&gt;Now imagine that you can perform analytics in a much simpler way, without needing the previous requirements i.e. you don’t need the user consent because you do not collect personal data and you do not face scalability issues for storage and processing.&lt;/p&gt;

&lt;p&gt;This is the main topic of this article. We discuss an alternative solution : DLDB.io !&lt;/p&gt;

&lt;h2&gt;
  
  
  DLDB.io : new way of doing analytics
&lt;/h2&gt;

&lt;p&gt;DLDB.IO provides an SDK (IOS, Android, flutter, react-native, unity) that stores geolocation and users’ data on the end user terminal. To do analytics, this data is processed by the terminal to answer queries sent by the Analytics engine. The results of the query sent by the terminal are already aggregated and cannot allow identification of the users.&lt;br&gt;
More precisely queries sent by the analytics engine have a lifespan. The terminal will pull the query once it is online and the application is used. If the terminal receives the query during the query lifespan the result will be collected and used by the analytics engine.&lt;/p&gt;

&lt;p&gt;The image below describes how DLDB.io does analytics.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozjt8ga4tcrt7wsi8vqx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozjt8ga4tcrt7wsi8vqx.jpeg" alt="DLDB.IO analytics solution architecture" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of DLDB.io analytics solution
&lt;/h3&gt;

&lt;p&gt;The benefits are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GDPR compliance by design:

&lt;ul&gt;
&lt;li&gt;Users’ data are not collected on the cloud. It stays on the end user terminal which means there is no risk to bad usage of the data due to data dissemination. Indeed bad usage is more likely to happen when data is collected and copied multiple times.&lt;/li&gt;
&lt;li&gt;No user’s consent is needed to collect data as data is not collected (thanks captain obvious!)
Right to be forgotten: users’ data is easy to delete because it is stored only on the user’s terminal and is easy to delete.&lt;/li&gt;
&lt;li&gt;A registry of queries performed on users’ data is available on the terminal.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Scalability

&lt;ul&gt;
&lt;li&gt;The storage is mainly handled by the end user device. A massive storage solution is not needed.&lt;/li&gt;
&lt;li&gt;The processing is partly deported to the end user’s device. Data sent to the analytics engine is pre-aggregated and cleaned.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;All of these benefits are making DLDB.io a great solution for analytics. The distributed computing performed by the end user terminal is an application of edge computing which is very innovative in the analytics field.&lt;br&gt;
Now if we look deeper on how analytics works with this solution we can find some limitations despite everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitations of DLDB.io analytics solution
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The most obvious limitation: if the device is not available during the lifespan of the query, the Analytics engine will not get a result on the query for this device. Yet we can assume that for a fleet of terminals we can get the results of enough terminals to make the query result statistically valid even if we do not get results from all the terminals.&lt;/li&gt;
&lt;li&gt;The lifespan of a query depends on the use rate of the application. If the application is used a lot, the query lifespan can be low whereas if the application is used once a day the query lifespan will be around a day. This is limiting the freshness of the data on which we wan’t to perform the query.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, I bet that this analytics solution is going in the flow of history because the regulations are becoming more constraining which represents a risk for businesses doing analytics. The DLDB.io solution mitigates the risk. Also the volume of data collected by current analytics solutions is increasing and the edge computing solution might reduce the cost of storage and processing of this data.  Indeed, we can imagine that the distributed processing on the end users terminal is less greedy in CO2 than a single big query. This is good for the planet!&lt;/p&gt;

&lt;p&gt;If you are interested you can request a beta invite and get support from the &lt;a href="//dldb.io"&gt;DLDB.io&lt;/a&gt; team.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>webdev</category>
      <category>edgecomputing</category>
    </item>
  </channel>
</rss>
