<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nicola Lamonaca on Medium]]></title>
        <description><![CDATA[Stories by Nicola Lamonaca on Medium]]></description>
        <link>https://medium.com/@nicola.lamonaca?source=rss-87b05ba2c7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YtUpURRZvUG2teHn_p5xAA.jpeg</url>
            <title>Stories by Nicola Lamonaca on Medium</title>
            <link>https://medium.com/@nicola.lamonaca?source=rss-87b05ba2c7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 08:59:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nicola.lamonaca/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Analysis of ETH/BTC Exchange Strategy to Maximize Future BTC Returns]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/coinmonks/an-analysis-of-eth-btc-exchange-strategy-to-maximize-future-btc-returns-nicola-lamonaca-on-medium-65b1915a1ccf?source=rss-87b05ba2c7------2"><img src="https://cdn-images-1.medium.com/max/1024/1*44py9fRiRwR1Gp7_aD40QA.png" width="1024"></a></p><p class="medium-feed-snippet">The current ETH/BTC ratio of 0.0245 represents a historically low valuation. As such, many investors are wondering whether exchanging BTC&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/coinmonks/an-analysis-of-eth-btc-exchange-strategy-to-maximize-future-btc-returns-nicola-lamonaca-on-medium-65b1915a1ccf?source=rss-87b05ba2c7------2">Continue reading on Coinmonks »</a></p></div>]]></description>
            <link>https://medium.com/coinmonks/an-analysis-of-eth-btc-exchange-strategy-to-maximize-future-btc-returns-nicola-lamonaca-on-medium-65b1915a1ccf?source=rss-87b05ba2c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/65b1915a1ccf</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Nicola Lamonaca]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 00:19:10 GMT</pubDate>
            <atom:updated>2025-03-05T10:34:51.251Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[E così, vorresti indovinare una chiave privata valida di Bitcoin?]]></title>
            <link>https://medium.com/@nicola.lamonaca/e-cos%C3%AC-vorresti-indovinare-una-chiave-privata-valida-di-bitcoin-e90acd33b344?source=rss-87b05ba2c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e90acd33b344</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Nicola Lamonaca]]></dc:creator>
            <pubDate>Sun, 01 Oct 2023 18:34:54 GMT</pubDate>
            <atom:updated>2025-06-26T10:20:31.866Z</atom:updated>
            <content:encoded><![CDATA[<h4>Se stai pensando che provare a indovinare una chiave privata valida di Bitcoin sia un ottimo modo per ingannare il lento scorrere della domenica pomeriggio e provare a diventare un milionario per caso, questo articolo potrebbe sconvolgerti l’esistenza.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OdIRvLYw1nFcVdjO8SLBgQ.png" /></figure><p>English version of the article <a href="https://medium.com/@nicola.lamonaca/so-you-want-to-guess-a-valid-bitcoin-private-key-b0f134883077">here</a>.</p><h3>Cos’è una chiave privata?</h3><p>Una chiave privata non è altro che un numero intero a 256 bit. Spesso, per comodità, si preferisce il più conciso formato esadecimale, composto da una sequenza di 64 caratteri, costituiti dalle cifre da 0 a 9 e dai caratteri da ‘a’ ad ‘f’. Per fare un esempio, la sequenza:</p><p><strong>66d891b6fddc51e50d1ef6a00be4e2ca934b96df5ca0883f7cc0ce4fd6921e31</strong></p><p>è una chiave privata Bitcoin in formato esadecimale. Tale chiave privata (generata a caso) è tutto ciò che serve per poter <strong>spendere i propri bitcoin</strong>.</p><h3>La delicatezza della chiave privata</h3><p>Come si può intuire, il problema della generazione di una chiave privata valida assume una notevole rilevanza dal punto di vista della sicurezza: chiunque possieda una chiave privata valida potrebbe disporre a proprio piacimento dei fondi (Unspent Transaction Outputs o UTXOs) che essa controlla. Ciò vale naturalmente anche per un malintenzionato che riuscisse ad <strong>intercettare </strong>o <strong>indovinare </strong>una chiave privata che dovesse controllare un saldo non nullo, poiché esso diventerebbe immediatamente spendibile sotto gli occhi impotenti del legittimo proprietario.</p><p>Intercettare e indovinare una chiave privata sono due facce dello stesso rischio: mentre nel primo caso vengono in soccorso le buone pratiche di custodia sicura delle chiavi private, di cui non parleremo qui, poiché ne ho parlato approfonditamente nel mio libro <a href="https://www.amazon.it/Bitcoin-criptovalute-road-Nicola-Lamonaca/dp/B0C6BZG81D/ref=sr_1_1?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&amp;crid=PDN8IHSNR8AJ&amp;keywords=bitcoin+e+criptovalute+on+the+road&amp;qid=1696184761&amp;sprefix=bitcoin+e+criptovalute+on+th%2Caps%2C1676&amp;sr=8-1"><strong>Bitcoin e criptovalute on the road</strong></a>, nel secondo caso ci viene in aiuto tutta la bellezza e l’eleganza della matematica, come stiamo per scoprire.</p><h3>La matematica ci viene in soccorso</h3><p><strong>La probabilità di indovinare una chiave privata valida di Bitcoin è di 1 su 2²⁵⁶</strong>. Detto così, potrebbe sembrare un compito tutto sommato semplice. Ma potresti rimanere molto sorpreso nell&#39;apprendere quanto velleitario sia un simile tentativo.</p><p>Per darti la possibilità di visualizzare quanto minuscola sia tale probabilità, partiamo da un oggetto di tutti i giorni che tutti noi conosciamo molto bene: <strong>un semplice mazzo di 52 carte da poker</strong>. Supponi di voler mischiare un mazzo di carte da poker in una maniera un po’ inconsueta: prendi una carta a caso dalle 52 a disposizione e la adagi sul tavolo, poi ne prendi un’altra a caso dalle 51 rimanenti e la poggi sulla prima, poi una terza dalle 50 che rimangono, e così via.</p><p>Poiché ad ogni carta estratta ne rimane una in meno da poter estrarre dal mazzo, un mazzo di 52 carte ha 52 × 51 × 50 × … × 1 = 52! (52 fattoriale) combinazioni possibili, un numero pari a <strong>8,0658 × 10⁶⁷</strong>. Si tratta di un numero davvero enorme: si pensi che l’età dell’Universo è stimata essere attorno a 4,32 <strong>× </strong>10¹⁷ secondi (circa 13,9 miliardi di anni). In altre parole, la sequenza di carte che avremo ottenuto dopo aver terminato di mischiare il mazzo sarà unica in tutta la storia dell’universo e lo rimarrà ancora a lungo!</p><h3>Facciamo un esercizio mentale</h3><p>A vederlo così, nessuna mente umana può realmente comprendere quanto sia grande questo numero. Ti ivito allora a fare un esercizio mentale¹: immagina di avere un timer impostato per un conto alla rovescia a partire proprio da questo numero di secondi: <strong>8,0658 × 10⁶⁷</strong>. A questo punto, nella speranza di veder arrivare il timer a 0, ti sposti all&#39;Equatore e fai un passo. Dopodiché, aspetti un miliardo di anni, e fai un altro passo. Altro miliardo di anni, altro passo, finché non avrai compiuto un primo giro della Terra. Terminato il giro, preleva una goccia d&#39;acqua dall&#39;Oceano Pacifico e riversala in un secchiello rosso sufficientemente capiente. Altro giro dell&#39;Equatore (mi raccomando ad attendere un miliardo di anni tra un passo e il successivo, non barare!), altra goccia nel secchio. E così via, finché non avrai svuotato l&#39;intero Oceano Pacifico (707 milioni di km³ d&#39;acqua). Fatto ciò, metti da parte un foglio di carta. Alla fine, risvuota il secchio pieno nuovamente nel Pacifico.</p><p>Adesso riprendi con un secondo giro dell&#39;Equatore, sempre attendendo un miliardo di anni tra un passo e il successivo. Terminato il giro, preleva una goccia dal Pacifico e prosegui con un nuovo giro dell’Equatore, finché non avrai prosciugato nuovamente tutto l’Oceano Pacifico fino all’ultima goccia. Adesso, prendi un secondo foglio di carta e mettilo sopra al primo; infine, risvuota nuovamente il secchio pieno nel Pacifico.</p><p>Continua questo processo finché la pila di fogli non avrà raggiunto il Sole.</p><p>Secondo te, a questo punto, quanti secondi rimanenti segnerà il timer? Probabilmente penserai che non manchi ormai molto. Ebbene, a questo punto, <strong>sul timer rimarrebbero ancora 8,0632 × 10⁶⁷ secondi</strong>! Le 3 cifre più a sinistra non sono nemmeno cambiate. Ora capisci anche perché in origine abbiam dovuto utilizzare ben 4 cifre decimali per esprimere il numero 52! Per arrivare ad appena un terzo del conteggio alla rovescia, dovremmo creare non una, bensì <strong>mille pile di fogli dalla Terra fino al Sole</strong>.</p><h3>Come trascorrere i rimanenti due terzi del tempo?</h3><p>Dopo tutto questo giro, mescola il tuo mazzo di carte e serviti 5 carte a caso ogni miliardo di anni. Quando ti capiterà di fare scala reale (A, K, Q, J e 10, tutti dello stesso seme), evento che occorre all&#39;incirca 1 ogni 650.000 mani, compra un biglietto della lotteria. Se il biglietto è quello che sbanca il jackpot, prendi un granello di sabbia e lancialo nel Grand Canyon. Quando avrai riempito il Grand Canyon fino all&#39;orlo, estrai 600 granelli (circa 30gr) di roccia calcarea dal Monte Everest. Quando avrai livellato l’Everest, svuota il Grand Canyon e ricomincia. Per 256 volte. Solo a questo punto, il timer segnerà zero secondi rimanenti.</p><h3>Ti sembra fattibile?</h3><p>A questo punto, riavvolgiamo il nastro, a quando stavi ancora cercando di svuotare l’Oceano Pacifico per la prima volta. Potresti rimanere sorpreso (semmai ti fosse rimasto ancora un briciolo di sorpresa leggendo questo articolo), ma, probabilmente, tutte le stelle dell’Universo si saranno ormai spente prima ancora che tu fossi riuscito a riversare l’equivalente di una manciata di piscine all’interno del tuo secchiello rosso.</p><p>Ora, in tutto ciò, tieni a mente che 8,0658 <strong>× </strong>10⁶⁷ è circa <strong>30 volte più piccolo</strong> del nostro 2²⁵⁶.</p><p>In altre parole: se fossi riuscito a generare una chiave privata al secondo per tutto il tempo necessario a livellare il Monte Everest per la 256-esima volta, avresti generato solo un trentesimo delle possibili chiavi private di Bitcoin. Ma non abbiamo considerato il tempo necessario a verificare se ciascuna chiave privata generata sia valida, ovvero che possa effettivamente controllare dei fondi.</p><h3>Quanta potenza di calcolo è necessaria?</h3><p>A questo punto, potresti pensare:</p><blockquote>va bene, ma se ho una potenza di calcolo sufficiente, magari riesco ad accorciare questo tempo di vari ordini di grandezza.</blockquote><p>Ok, proviamo.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F870046809%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F870046809&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F1731904797-b2c21b1d5cce5fed75a2f9545c4034735fcad87b950fada2a7a30160a06e2359-d_295x166&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=vimeo" width="576" height="1024" frameborder="0" scrolling="no"><a href="https://medium.com/media/752d1880eb193345421731e7ff129acc/href">https://medium.com/media/752d1880eb193345421731e7ff129acc/href</a></iframe><p>2²⁵⁶ può essere scomposto come 2³² × 2³² × … 2³², cioè 2³² moltiplicato per se stesso per 8 volte. Ciascun termine 2³² è circa uguale a 4 miliardi. Una moderna GPU riesce facilmente a eseguire 1 miliardo di calcoli al secondo. Immaginiamo quindi di impacchettare una macchina con 4 chip grafici, ciascuno capace di eseguire 1 miliardo di calcoli al secondo². Fin qui nessun problema, ma questo è solo uno degli otto livelli di moltiplicazione. Ne rimangono solo altri sette.</p><p>Per eseguire il secondo livello di calcoli, avremmo bisogno di 4 miliardi di tali macchine. E già a questo punto le cose cominciano ad essere leggermente complicate. Si stima che perfino Google abbia tra 1 e 9 milioni di server all’interno dei propri data centers. Possiamo quindi assumere che occorrano un migliaio di Google per completare il secondo livello di calcoli.</p><p>Ora dobbiamo eseguire il terzo livello di moltiplicazioni. La Terra ha circa 8 miliardi di persone, quindi immaginiamo di dare a circa metà della popolazione terrestre la capacità di calcolo di 1000 Google, o se preferiamo, di consegnare a ciascun terrestre la capacità di calcolo di 500 Google e che ciascuno esegua indipendentemente 2³² × 2³² calcoli al secondo. Ma la strada è ancora lunga.</p><p>Per eseguire il quarto livello di moltiplicazioni, ci servono 4 miliardi di Terre così equipaggiate. Si stima che la Via Lattea contenga tra i 100 e i 400 miliardi di stelle, perciò possiamo immaginare che l’1% delle stelle della nostra galassia contenga una copia della Terra in cui ciascuno degli 8 miliardi di abitanti abbia a disposizione la potenza di calcolo di 500 Google. Siamo appena a metà della sequenza.</p><p>Per il quinto livello di moltiplicazioni, dobbiamo immaginare 4 miliardi di siffatte galassie, o, se preferiamo, 40 milioni di galassie in cui ogni singola stella esistente abbia attorno a sé la propria Terra così come l’abbiamo descritta. Un immenso supercomputer capace di 2¹⁶⁰ calcoli al secondo.</p><p>Per eseguire il sesto livello di calcoli, dovremmo avere a disposizione… 4 miliardi di tali supercomputer.</p><p>Salendo al settimo livello, lasciamo che tale enorme cluster di supercomputer calcoli continuamente chiavi private di Bitcoin per 4 miliardi di secondi, pari a circa 127 anni.</p><p>Ebbene, date tutte queste premesse, l’ottavo livello ci dice che la probabilità che una sola di quell’enorme numero di chiavi private generate sia una chiave privata valida è di 1 su 4 miliardi.</p><p><strong>Vuoi davvero provarci?</strong></p><p>¹ <em>Tale esercizio mentale è stato proposto in origine da Scott Cszepiel.</em></p><p>² <em>Esistono macchine specializzate, note come ASIC, capaci di eseguire centinaia di bilioni (1 bilione = 1000 miliardi) di calcoli al secondo, ma il concetto di fondo non cambia.</em></p><p>Nel mio libro, <a href="https://www.amazon.it/Bitcoin-criptovalute-road-Nicola-Lamonaca/dp/B0C6BZG81D/ref=sr_1_1?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&amp;crid=PDN8IHSNR8AJ&amp;keywords=bitcoin+e+criptovalute+on+the+road&amp;qid=1696184761&amp;sprefix=bitcoin+e+criptovalute+on+th%2Caps%2C1676&amp;sr=8-1"><strong>Bitcoin e criptovalute on the road</strong></a> ho raccolto tutta la mia esperienza teorico-pratica per guidare i principianti nel mondo degli investimenti in Bitcoin e criptovalute, con sicurezza e consapevolezza.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*U3ZY0GzjMA3FwsU9zFgsgw.jpeg" /><figcaption><a href="https://www.amazon.it/Bitcoin-criptovalute-road-Nicola-Lamonaca/dp/B0C6BZG81D/ref=sr_1_1?__mk_it_IT=%C3%85M%C3%85%C5%BD%C3%95%C3%91&amp;crid=PDN8IHSNR8AJ&amp;keywords=bitcoin+e+criptovalute+on+the+road&amp;qid=1696184761&amp;sprefix=bitcoin+e+criptovalute+on+th%2Caps%2C1676&amp;sr=8-1"><strong>Bitcoin e criptovalute on the road</strong></a>, disponibile su Amazon, LaFeltrinelli, Mondadori e Rizzoli.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e90acd33b344" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So, you want to guess a valid Bitcoin private key?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/coinmonks/so-you-want-to-guess-a-valid-bitcoin-private-key-b0f134883077?source=rss-87b05ba2c7------2"><img src="https://cdn-images-1.medium.com/max/1024/1*ZWDlUDGkuk9hJAyV8Cer-A.png" width="1024"></a></p><p class="medium-feed-snippet">If you&#x2019;re thinking that trying to guess a valid Bitcoin private key is a great way to spend the time on a slow Sunday afternoon, this&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/coinmonks/so-you-want-to-guess-a-valid-bitcoin-private-key-b0f134883077?source=rss-87b05ba2c7------2">Continue reading on Coinmonks »</a></p></div>]]></description>
            <link>https://medium.com/coinmonks/so-you-want-to-guess-a-valid-bitcoin-private-key-b0f134883077?source=rss-87b05ba2c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0f134883077</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Nicola Lamonaca]]></dc:creator>
            <pubDate>Sun, 01 Oct 2023 17:59:01 GMT</pubDate>
            <atom:updated>2025-06-26T10:21:06.212Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Data Architecture to assist Geologists in Real-Time Operations]]></title>
            <link>https://medium.com/eni-digitalks/a-well-data-architecture-to-assist-real-time-operations-ad16d071f5e3?source=rss-87b05ba2c7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad16d071f5e3</guid>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[data-architecture]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Nicola Lamonaca]]></dc:creator>
            <pubDate>Tue, 20 Jun 2023 16:17:08 GMT</pubDate>
            <atom:updated>2023-07-03T12:26:28.969Z</atom:updated>
            <content:encoded><![CDATA[<p>Geologists use real-time well data to build predictive models during the drilling process. Recently, we’ve taken a crucial step by migrating our real-time Data Platform to <strong>Azure Databricks</strong> from the previous on-premise implementation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fH2ab9WAX_87JuBAdJk1MA.jpeg" /><figcaption><a href="https://unsplash.com/it/foto/5fNmWej4tAA">https://unsplash.com/it/foto/5fNmWej4tAA</a></figcaption></figure><p>This article has been written by <a href="https://medium.com/@nicola.lamonaca">Nicola Lamonaca</a> and Mattia Zeni, with the collaboration of Reishin Toolsi, Lorenzo Raimondi and Leonardo Biagiola.</p><h3>Introduction</h3><p>In Eni’s Natural Resource business operate the departments that handle the entire value chain related to the exploration, extraction, and distribution of hydrocarbons. Following a distributed data approach, but with the common goal of making certified and shareable data throughout the company, each business department implements its own data platform according to corporate standards. In particular, in the Exploration area, a new data architecture has been built, allowing to assist Real-Time Operations.</p><h4>The State of Energy</h4><p>The Energy industry is constantly innovating and looking for methods to improve the exploration, extraction, and distribution of the hydrocarbons and related products. While operational efficiency lies at its core, there is also a strong focus on safety, risk mitigation and cost reduction.</p><p>As the world’s energy demand increases and transitions to a mixed energy portfolio, the demands for sustainability are now at the top of those requirements. With the advancement in IoT technology, cloud adoption and new data-skilled Subject Matter Experts, energy companies are leveraging those to better understand the challenges and opportunities of Data and A.I in this field.</p><h3>The Challenge</h3><p>Data plays a crucial role in making exploration and drilling operations for Eni a success all over the world. Our geologists use real-time well data collected by sensors installed on drilling pipes to keep track and to build predictive models of key properties during the drilling process.</p><p>Among the different challenges of working in this scenario, the most important one that we face daily is the lack of adherence to a common data standard. The oil &amp; gas industry conveyed to standard for the exchange of subsurface data: the <a href="https://www.energistics.org/witsml-data-standards"><strong>WITSML Standard</strong></a><strong>. </strong>However, service companies hardly implement it consistently, making available data sometimes hard to use. The complexity of operations on rigs does not always make it possible to strictly adhere to the WITSML standard at the data source.</p><p>For these reasons, we decided to build a <strong>data platform</strong> supporting data collection in the context of drilling operations, which could take care of all the steps needed to pre-process data correctly, clearly adding complex data transformation and management logic, before data could be of any use by downstream systems. Such a platform had not only to collect, store and distribute data to models and dashboards, but also transform it in the correct form whenever needed, also allowing field experts, namely ops-geologists, to validate the data via a dedicated platform.</p><h3>The Workflow</h3><p>Data is delivered by a custom dispatcher component designed to connect to a WITSML Server on all oil rigs and send time-indexed and / or depth-indexed data to any supported applications. In our case, data is delivered to Azure ADLS Gen2 in the format of WITSML files, each accompanied by a JSON file for additional custom metadata.</p><p>Apache Spark is the main engine used to trigger the data ingestion process when the files are available on the cloud. Once new data has been ingested, a scheduled custom NLP algorithm tries to continually classify unknown incoming mnemonics with the help of a dictionary we have built in house. The same goes for units of measure, for example allowing us to treat <em>kgf</em>, <em>kg.f</em> or <em>kg_f </em>as the same unit of measure. In case of ambiguity, an expert could manually classify incoming data or units.</p><p>Upon classification, the platform has been designed to allow the creation of several projects: each project is a logic container for different ML models, experiments and countries of interest, and has a 1:1 mapping with the database containing all the data tables needed by those models. For each of these models, an operation geologist could then easily select the best mnemonics to use, knowing that under the hood the system is unifying and showing as single mnemonics potentially many of them. This creates a great advantage in the direction of continuously feeding quality and consistent data into the models without the team having to deal with long-lasting and tedious data cleaning and management tasks, which greatly increases productivity, as more time can be spent on extending the platform’s capabilities.</p><p>The visualizations generated from this data platform are used both on the oil rigs and in HQ, with operators exploring the curves enriched by the ML models as soon as they’re generated on a web application made in-house, which shows in real time how the drilling is progressing. Additionally, it is possible to explore historic data via the same application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*1KBUL0yKBZmG-yv27lPz8w.png" /><figcaption>Fig. 1: High level diagram of the data platform architecture</figcaption></figure><h3>Eni’s needs</h3><p>Thanks to the experience gained on the previous data platform, the following needs have emerged, as a response to the limits the old self-managed solution has shown:</p><ol><li><strong>Pay per use model and not peak capacity licensing: </strong>We needed to have optimized, flexible and predictable costs. We wanted to pay only for what we used, and not for machines staying idle waiting to handle a peak.</li><li><strong>High scalability: </strong>We needed the ability to scale up or down based on the demand, to handle high loads in the system. If more data needs to be processed, the system should be able to handle it.</li><li><strong>High availability: </strong>The system shall be always online, 24/7, no downtime is accepted because we work in all time zones, around the clock.</li><li><strong>Top notch performance: </strong>Performances shall be high and consistent, also under heavy concurrency scenarios.</li><li><strong>Low end-to-end latency</strong>: The data is used by people on the field to monitor drilling operations and delays in processing the data in such scenarios can have big consequences. Ideally, the system shall be able to process data in a streaming fashion, reducing as much as possible (down to seconds) the time it takes from when the data is generated on the rig to when the processed and aggregated data is visualized in dashboards.</li><li><strong>Remove infrastructure management: </strong>The solution shall be as much as possible SaaS or PaaS, to optimize the use of the team to extract value out of the data, rather than working on keeping the system online.</li><li><strong>Strong security and compliance constraints: </strong>The data generated is considered highly sensible for the business, consequently the solution shall guarantee the highest standards in terms of security.</li><li><strong>Fine-grained governance on all assets: </strong>Due to the sensitivity of the data it is not only important to protect them from external attackers, but also to control who inside the company can do what on which part of the data.</li><li><strong>No vendor lock-in: </strong>Such a critical piece of infrastructure shall be developed on open source components and standards, so that there is no vendor lock-in.</li><li><strong>Integration with cloud tools:</strong> The solution shall be fully integrated with the Azure ecosystem so that it can leverage the huge number of tools and solutions it provides.</li><li><strong>Impact minimization on existing applications:</strong> The platform was previously built with other technologies and downstream systems such as custom web applications (BI workloads) and SAS (ML workloads) connected to it via JDBC. In the context of the migration to the Databricks Lakehouse, we don’t want such applications to be impacted, ideally only having to change the connection string.</li></ol><h3>How the Lakehouse Platform helped us managing these needs</h3><p>Once the needs were clear, we needed to identify a data management system able to ingest and process semi-structured streaming data on a low-cost storage solution, being able to apply ML algorithms at scale (both are key elements of data lakes) and transform it into structured data to make it available to the platform’s client applications, guaranteeing ACID transactions on the final tables with versioning and automatic performance optimizations (typical of data warehouses). After a weeks-long scouting process, we identified Databricks’ <a href="https://www.databricks.com/blog/2020/01/30/what-is-a-data-lakehouse.html">Data Lakehouse Platform</a> on Azure as the answer to such needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mKnKiMId7q-BioBnW5W54g.png" /><figcaption>Fig. 2: Azure Databricks reference architecture</figcaption></figure><p>The picture above shows a reference architecture for Azure Databricks and how it integrates with the native components of Azure in the cloud. Let’s now deep dive into the different aspects of the Lakehouse platform and how we used and leveraged them to achieve our business and technical needs.</p><h4>Ingest</h4><p><strong>Ingesting data in real-time</strong> is a key feature of our data platform. Reducing the time spent from when the data is generated on the rigs to when it is made available to the client applications is crucial for the success of the project. Databricks <a href="https://learn.microsoft.com/en-us/azure/databricks/ingestion/auto-loader/">Autoloader</a>, together with <a href="https://learn.microsoft.com/en-gb/azure/databricks/structured-streaming/">Apache Spark Structured Streaming</a> helps in this regard because it allows, in a few lines of code, to reliably process files in a streaming fashion. It abstracts away complex streaming concepts such as incremental processing, checkpointing, and watermarks so that you can build streaming applications and pipelines without learning any new concepts or tools.</p><p>In such complex scenarios it might occur that backfills need to be performed. Databricks helps also in this regard. In fact, Apache Spark unifies batch and streaming workloads in a single API. This facilitates the data processing step, without the need to develop two separate pipelines for batch and streaming.</p><p>Finally, the Lakehouse Platform has an internal scheduler called Databricks <a href="https://learn.microsoft.com/en-gb/azure/databricks/workflows/">Workflows</a>, that allows you to create and monitor recurring ingestion jobs. We used this solution to schedule internal jobs in the Databricks platform and used <a href="https://azure.microsoft.com/en-us/products/data-factory/">Azure Data Factory</a> to orchestrate external tasks. This is where the first party service nature of Azure Databricks really helps, with native integrations with the Azure stack.</p><h4>Store</h4><p>In Databricks the default storage format is <a href="https://delta.io/">Delta</a> Lake, an open-source storage framework that has multiple advantages in terms of reliability and performance, and stored on Azure Data Lake Storage (ADLS) in the WITSML file format introduced above.</p><p><strong>Performance:</strong> Delta Lake allows background file optimization through <a href="https://learn.microsoft.com/en-us/azure/databricks/delta/optimize">compaction</a> and <a href="https://learn.microsoft.com/en-us/azure/databricks/delta/data-skipping">Z-order</a> partitioning. This is absolutely important for streaming operations like ours. Since parquet files cannot be modified, for each micro-batch in input a new file is created. If not handled properly, many small files can cause huge performance degradations. Delta allows to <a href="https://learn.microsoft.com/en-us/azure/databricks/optimizations/auto-optimize">automatically compact</a> such small files in bigger ones. Additionally, the data can be co-located with partitioning and Z-ordering to increase query performance. During the development phase we tested both solutions, with unoptimized and optimized Delta files and the latter one achieved 5x better performance.</p><p><strong>Reliability:</strong> Delta lake provides <a href="https://learn.microsoft.com/en-us/azure/databricks/optimizations/isolation-level">snapshot isolation</a> which helps concurrent read/write operations and enables efficient insert, update, deletes, and rollback capabilities. This last one specifically is very important for machine learning workloads, where, in order to be able to reproduce the same results, you need to precisely know on which data the models were trained.</p><p>Furthermore, Delta is <strong>fully open-source</strong> and this is a very important aspect for us because we want to avoid vendor lock-in as much as possible. We store our data in our Azure Tenant in the Delta format, in our own storage accounts. We can decide how to encrypt such data, where to store it. We basically have full control.</p><p>Delta is really the key feature that made this use-case possible and the main feature of the success of the Lakehouse. It is the one that allows us to run SQL queries on top of the data directly, without the need to copy them in a Data Warehouse for the client systems, being able to satisfy one of the most important needs:<strong> low end-to-end latency</strong>.</p><h4>Process</h4><p>The approach to prefer an open source solution applies to the main processing engine in the Databricks Lakehouse Platform: <strong>Apache Spark</strong>, originally developed by Databricks and made available to the open source community. This is another great example of why we don’t feel locked-in.</p><p>While we used to rely on open source Apache Spark on the first place, we were able to get almost a 4x performance boost, going from 31 minutes on an example pipeline down to 9 minutes, by simply lifting and shifting the code to <a href="https://learn.microsoft.com/en-us/azure/databricks/runtime/photon"><strong>Databricks Photon</strong></a>, a much more performant and retro-compatible engine than open source Spark.</p><p>The billing model in the Lakehouse Platform is also totally flexible: we only pay for the minutes we use the computational units (clusters), based on their size, with no peak licensing costs.</p><h4>Govern</h4><p>A huge advantage of the Lakehouse platform is that it allows all stakeholders to work on the same platform seamlessly. You can work on both files and tables (to oversimplify it). In such scenarios it is crucial to have a unified governance model, which enforces access permissions on both files (<em>.json</em>, <em>.csv</em>, <em>.witsml</em>) and Delta tables. <a href="https://www.databricks.com/product/unity-catalog">Unity Catalog</a> is the answer to this need.</p><p>Unity Catalog is a single pane of glass to govern all data assets. This functionality is of pivotal importance in this use-case, where the data is considered highly sensitive by our business. Apart from encrypting the data in transit and at rest to avoid unintended external attackers to be able to use the data, we also need to control who internally in Eni (even legitimate users) can do what on the data, e.g., SELECT, MODIFY, etc. We can even decide to apply granular permissions at the COLUMN and ROW level for groups or individual users.</p><p>An interesting extension of Unity Catalog is the native data sharing solution called <a href="https://www.databricks.com/it/product/delta-sharing">Delta Sharing</a>, which allows users to safely share parts of the Delta Lake to entities external to Eni. Having to deal with subsidiaries all around the world, we are considering adopting Delta Sharing in this project, to enable new use-cases while being able to control which data they have access to.</p><h4>Serve</h4><p>We mentioned a lot of advantages that our data platform was able to leverage by using the Lakehouse platform, but maybe the most important one is related to serving the data. When we use the Lakehouse, we don’t need to copy the data to an external Data Warehouse to serve it, we can do it directly in Databricks, from the data stored in the Delta Lake, by using <a href="https://www.databricks.com/it/product/databricks-sql">Databricks SQL</a>.</p><p>The advantages here are multiple. First of all, we store huge amounts of historical data <strong>cheaply</strong> and we can efficiently query it without the need of having a complex and expensive ETL that aligns and copies the data to a Data Warehouse. This is super important for our use-case, because copying data takes time and we wanted the end-to-end latency to be as low as possible.</p><p>This solution is most often <a href="https://www.databricks.com/blog/2021/11/02/databricks-sets-official-data-warehousing-performance-record.html">more performant than a DWH, for sure cheaper</a>, being able to serve high concurrency requirements. This was our scenario. The data generated by the platform needs to be exposed 24/7 to client systems, where 50/100 users might query it simultaneously.</p><p>Since the Lakehouse uses standards such as JDBC/ODBC and ANSI SQL, we were able to easily connect our internal visualization dashboard, but in the future, we also might want to build additional dashboards on BI tools, such as PowerBI, to monitor the ETL operations.</p><h3>Conclusions</h3><p>During the last two years, the previous platform has been operating in production over a total of 70 development and exploration wells across 27 countries worldwide. Thanks to the migration to Azure Databricks and the level of integration it provides with the Azure ecosystem, we are now aiming at enabling our business to push these numbers higher year over year.</p><p>The Lakehouse paradigm has given us the <strong>flexibility </strong>we needed to adapt the computing resources to the drilling and software development workloads, resulting not only in increased <strong>reliability </strong>to support the peaks of load, but also in economic <strong>savings</strong>, scaling down or completely turning off some resources when not needed. Now, our different software development and data science teams can autonomously manage every component they are in charge of, and are able to troubleshoot all the issues anytime, even during weekends, thus keeping the response times and communication delays at a minimum, <strong>simplifying operations</strong> by orders of magnitude. Unity Catalog has filled the <strong>data access </strong>gap, providing a centralized and shared authorization hub. But the most important benefit is by far the system’s <strong>stability and availability</strong>, which will allow the development and management teams to focus less on the platform operation and more on the business challenges. The system can now take advantage of <strong>scalability</strong> in a completely managed environment, without needing any additional configuration. The old vendor’s painful and time-consuming <strong>license renewal</strong> process has now been replaced by a leaner pay-as-you model. The Lakehouse paradigm not only provided us a single platform to help solve our current and future data challenges, but it is also a unified environment to help us improve team <strong>collaboration</strong>, <strong>communication </strong>and <strong>productivity.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad16d071f5e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eni-digitalks/a-well-data-architecture-to-assist-real-time-operations-ad16d071f5e3">A Data Architecture to assist Geologists in Real-Time Operations</a> was originally published in <a href="https://medium.com/eni-digitalks">Eni digiTALKS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>