Monday, November 23, 2020

Data Lake e Data Warehouse.

 Data Lake is defined as the storage or repository of a large volume of data, it can be structured or semi-structured or unstructured.

It is the large central "body", which feeds the various functions that require data.

A good view of a data lake that I found is the one below:


 Interesting how Data Science, even though it is an exact science, it still requires a good capacity for abstraction, right? 😄


Okay, we have our definition of  Data Lake, so ... What is Data Warehouse? Isn't it the same thing?


No...


Data Warehouse, is where we will store structured data that has already been processed for a particular function. While at the Data Lake, we have all kinds of data (raw or not) available for use.

Look at this image, how cool!:



Visualizing things makes it easier to understand, right? By the way, later we will talk about Data Visualization, something very interesting!


That's it for today!


Thanks for the visit!

Monday, November 9, 2020

SQL & NoSQL

 Your company (or the company you work for) certainly has data available. For example:

- Sales amount

- Fixed and variable costs

- Customer data (name, contact, products purchased, purchase date, etc.).


What can we do with this data?

We can use BI (Business Intelligence) techniques to extract relevant information and answer important questions such as:

- Is the company financially healthy?

- Is the price of the products within the ideal range?

- Will customer X benefit from any product other than what he currently consumes?

- What is the sales trend for the coming years or months?

Among many other questions ...


The secret to extracting relevant information is asking the right questions.


Once you have defined what you want to know and with the data in hands, we start the Data Engineering processes.


Data Engineering is defined (in a very simplistic way) in turning "raw data" into information that is useful.


For that it is necessary to know how to Extract, Transform and last, but not least, Load this data in safe and easily accessible places. These procedures are known by the acronym ETL.


Before starting the data extraction we have to identify whether the database is Relational or Non-relational.



Relational Database

Briefly, the relational database stores the data in tables. There is an intuitive relationship between the data in the table and that between the tables themselves.

Let's look at an example:



In the example above, we see a table containing, on each line, information about one particular customer. This format allows queries that return answers to simpler questions such as:

Which customers have a Silver subscription? Which customer is located in Los Angeles? etc.


This type of database is also known as SQL, which stands for Structured Query Language. SQL is a language with which relational databases are programmed.

With specific commands it is possible to make queries, delete, update, edit and add new data.


Seems practical doesn't it?

But let's put this relational database to the test of day-to-day activities ...

What if we wanted to add a second phone number for a specific customer? For example, a cell phone number? We will also add the position of the people that we know what position they hold and the number of employees in each company (from which we have this information).



Notice that we don't know all cell phone number or their position and the number of employees from all companies served.


 This quickly causes the database become "bloated", with several empty spaces in different tables and makes the processes of query, extraction etc. extremely complex.😓



But calm down! Not everything is lost!


Let's take a look at the Non-Relational Database ...

The Non Relational Database,  stores data in an optimized way, not only im simples tables.

Also known as NoSQL, which stands for "Not Only SQL", it allows for slightly different queries.


There are four types of non-relational databases:


1. Document-oriented databases - also known as document storage, this database is designed to store, retrieve and manage document-oriented information. Document databases often combine each key with a complex data structure (called a document).


2. Key-value  - This is a database that uses different keys, where each key is associated with only one value in a collection. Think of it as a dictionary. This is one of the simplest database types among NoSQL databases.


3. Wide column  - this database uses tables, rows and columns, but unlike a relational database, the names and format of the columns can vary from line to line in the same table.


4. Charts - a chart database uses chart structures for semantic queries with "nodes", "borders" and "properties" to represent and store data.



"Okay, so what? How are we going to solve the problem of our bloated and inefficient database?"


One option is the document-oriented database. So a customer record can have how many phone number we want in a document with its particular features. Storage is optimized for every need. 😀


Cool huh?

Tuesday, November 3, 2020

Start Here!

 Welcome to the Practical Data blog!


Here you will find information about how you can use data analysis, processing, transformation techniques and tools to get useful information/insights.


The goal here is to be as practical as possible, so we will have content here that is formatted to be assimilated as easily as possible by beginners. However, if you have no knowledge of data in general, it is necessary to get informed a little before proceeding to the practical examples.

I recommend reading about it here.

The idea here is to popularize the great importance and potential of data in general . A fact that I believe is not generally known to people.


"But why should I care about data?"

 To answer that question, I recommend reading this article.


A brief presentation:


My name is Thiago Lyra Rocha, I am a data engineer at V4 Company and a Computer Science student at the University of London. I was a sales representative for 6 years and I fell in love with data science in general when looking for technological tools that could help my sales process.


I started to study the subject by myself through MOOC's (Massive Open Online Courses ). I noticed its importance and potential and I decided to shift my career from sales to data engineer.

My main skills are data cleaning/modeling, ETL, Cloud (mainly AWS including but not limited to S3, Redshift, Lambda, and Athena) SQL, Python, R and machine learning.

Thank you for your visit !

Creating a Connector between AWS and Microsoft SQL Server in Python

One of the challenges I came across recently was to create a connector that would collect specific columns in a csv at AWS and load to a tab...