Package: pg2elastic
⚡ pg2elasticEnhanced PostgreSQL to Elasticsearch Data Synchronization📚 DescriptionWelcome to pg2elastic, a fork of the officialpgsyncpackage, designed to provide seamless and
efficient data synchronization between PostgreSQL databases and Elasticsearch clusters.
Building upon the solid foundation of pgsync, pg2elastic inherits all of its powerful capabilities and takes them a step
further.Key Features:High-Performance Sync: pg2elastic inherits the robust data synchronization engine from pgsync, ensuring lightning-fast
and reliable transfers.Real-time Indexing: Seamlessly mirror your PostgreSQL data into Elasticsearch indices, keeping them in sync in
real-time.Schema Mapping: Easily define and customize the mapping of PostgreSQL schemas to Elasticsearch indexes, giving you
full control over the data structure.Efficient Data Types Handling: pg2elastic effortlessly handles data type conversions, ensuring accurate representation
across platforms.Continuous Enhancements: We are committed to actively maintaining and enhancing pg2elastic, incorporating the latest
advancements in both PostgreSQL and Elasticsearch technologies.Whether you're working on a data-driven application or performing complex data analysis, pg2elastic empowers you with
a streamlined and feature-rich solution for harmonizing your PostgreSQL and Elasticsearch ecosystems.🛠️ PrerequisitesPGSync Requirements✨ Key EnhancementsLoguru, Better Logging ModuleFixesThe actual numerical value of 1000000 becomes 1e when attempted to be converted to a float, leading to a crash during the conversion process.A fix was implemented to change 1e to 1e6, preventing the conversion to float from causing the process to crash.The process crashes when custom field types are use in the database, and the returned field type is in the format abc.xyz.A fix was implemented, and the regular expression for LOGICAL_SLOT_SUFFIX was modified.The process crashes when a partition notification is receivedA fix was implemented, and partitions are tracked in lib's materialized, lib's trigger is updated to include partition's parent tableChild records that are inserted are not updating the parent documentA fix was implemented, which synchronizes main document in case a child record is createdEnvironment VariablesPG_SCHEMAEnvironment variable to enhance performance by eliminating the need to scan all schemasREDIS_USERNAMEEnvironment variable to specify redis usernameREDIS_PASSWORDEnvironment variable to specify redis passwordREDIS_ENDPOINTEnvironment variable to specify redis connection endpoint, defaults tolocalhostREDIS_SSLEnvironment variable to specify if redis connection should use ssl, defaults totrueREDIS_CLUSTEREnvironment variable to specify if redis connection is clustered, defaults totrueREDIS_CHECKPOINTEnvironment variable to specify if redis will be used to save restore checkpoints, defaults totrueSKIP_BOOTSTRAPEnvironment variable to specify if boostrap command should be skipped, defaults totrue.Use this env variable if bootstrap command was already run, and you have your bootstrap command stuck in a shell
script.Set to false in cause there are new indexes or schema changes🚀 DeploymentManual DeploymentHow to runpg2elasticand initialize it.Create a .env file using thecp .env.sample .envcommand and replace the existing environment variables with
personal configuration settings.Download dependencies usingpython setup.py developStart the app by usingpg2elasticfile command from bin folder, usingpython3 pg2elastic --schema yourschema.jsonIf you do not run the full setup, you will get errors when running this package.✅ Testing$exportPG_SCHEMA=$flake8pg2elastictests
$pythonsetup.pytest🔊 LogsThis project comes with alogurumodule for logging, the configurations
for loguru can be found inpg2elasticfile from bin folder.🚚 Deployment$pythonsetup.pysdistbdist_wheel
$twineuploaddist/*