Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_wordproof_timestamp is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
SQLite: cos'è e perché convince anche per i progetti professionali

SQLite: cos'è e perché convince anche per i progetti professionali

Come funziona SQLite, il database utilizzato in centinaia di progetti. Soluzione compatta, integrata, completa, flessibile e versatile.
SQLite: cos'è e perché convince anche per i progetti professionali

Quando si parla di database relazionali e non si sentono sempre i soliti “nomi noti”. SQLite è un motore di database relazionale leggero e integrato, caratterizzato da una struttura autonoma, senza server, che consente di archiviare e gestire i dati in un unico file. È uno dei database più diffusi al mondo ed è ampiamente utilizzato “dietro le quinte” in applicazioni di vario genere, come software desktop, nelle app per i dispositivi mobili, nei browser Web e molti altri contesti.

Le principali caratteristiche di SQLite

L’architettura serverless fa sì che SQLite operi come una libreria software che viene incorporata direttamente nell’applicazione. Non richiede un processo server dedicato, ma opera direttamente sul dispositivo, leggendo e scrivendo i dati nel database. I file SQLite contengono tutto il necessario: tabelle, indici e dati associati.

Ovviamente, per via della sua natura, SQLite è in generale meno adatto per scenari ad alta concorrenza e per la gestione di volumi di dati pesanti.

Quando è nato SQLite e perché

SQLite è nato nel 2000 per opera di D. Richard Hipp. Hipp ha creato SQLite come progetto personale: l’obiettivo era quello di mettere a punto una soluzione semplice e veloce per l’archiviazione e la gestione dei dati in applicazioni che richiedono un database incorporato, senza chiamare in causa l’utilizzo di un server dedicato. Nel corso degli anni, SQLite ha riscosso un enorme successo ed è utilizzato in una vasta gamma di applicazioni e di sistemi operativi.

I vantaggi di un database incorporabile nelle applicazioni, nel 2023

Mettendo bene in evidenza quanto SQLite sia una soluzione utile e versatile anche oggi, lo sviluppatore Josef Erben, specializzatosi nello sviluppo con Django, React, Next, TypeScript, Python e OCaml, si è concentrato su alcune caratteristiche particolarmente apprezzabili del DBMS SQL.

Documentazione eccellente

“La prima cosa che ho imparato ad apprezzare di SQLite è la sua documentazione. Mi sentivo come se potessi capire lo strumento nel giro di poche ore“, osserva Erben. “Ed è molto onesta su ciò che SQLite può fare in quali circostanze. E, aspetto ancora più importante, cosa non può fare“.

Le prestazioni di SQLite in memoria non sono propriamente entusiasmanti. Erben racconta di aver provato l’inserimento e il successivo aggiornamento di 1.000, 10.000 e 100.000 righe. Sempre con risultati non propriamente convincenti. Ma questa è solo una tessera del puzzle.

Performance convincenti

Per il resto, SQLite appare estremamente veloce e performante: Erben ha dapprima effettuato una misurazione utilizzando le JavaScript Map ovvero una collezione di coppie chiave-valore, in cui ogni elemento è memorizzato come una mappatura tra una chiave unica e un valore corrispondente. Effettuando l’inserimento e il successivo aggiornamento di alcune entità gestite come blob JSON usando dapprima le JavaScript Map e poi facendo un confronto con la gestione di un database SQLite in-memory, è emerso che JavaScript Map è solo 1-2 ordini di grandezza più veloce. “Un risultato eccellente. Mi aspettavo che SQLite fosse almeno 1000 volte più lento di una struttura dati creata per inserire e recuperare cose utilizzando una chiave. E ciò anche grazie all’intercessione del motore V8“, aggiunge il programmatore.

Concorrenza

Infine, SQLite non supporta davvero la concorrenza: può esserci sempre un solo processo di scrittura attivo. Utilizzando una configurazione come quella proposta da Erber, tuttavia, SQLite appare piuttosto “simultaneo”.

“In una delle mie app Django ho 24 processi impostati come worker in background che scrivono nel database SQLite 4-5 volte al minuto e 2 web worker con 1-2 scritture al secondo. In totale ci sono 26 processi potenzialmente in scrittura contemporaneamente“, racconta ancora Erber. Eppure, “il driver SQLite segnala un blocco a livello di database sì e no una volta alla settimana“.

Ti consigliamo anche

Link copiato negli appunti