SYNCING DIRECT WITH MARIADB OR POSTGRESQL

Discussions about CSEntry
Post Reply
munirmdee1
Posts: 83
Joined: August 17th, 2015, 9:32 am
Location: Dar es Salaam, Tanzania

SYNCING DIRECT WITH MARIADB OR POSTGRESQL

Post by munirmdee1 »

Hi CSPro Users,

I'm working with different surveys, then only way to Sync Data to the server are:
1. CSWEB
2. FTP
3. Local Folder
4. Bluetooth
5.....

But due to the current emerging technologies from new requirements from system users, we now need a way that we can synchronize direct with Postgresql or MariaDB direct without using the above mentioned methods.
The only way to get data someone must download first, in different formats, then you can upload them to those databases. The first methond (csweb) it does syncing with MAriaDB but you cant get the data direct from the MariaDB without Downloading it with CSPro first, now we need a feature that we can synchronize from devices direct to Postgresql or other Relational databases.

That will help us in many ways, first, if we develop our own dashboard which displays status and progress of a survey in real time. but now what we do is first downloading it with CSPro then export in either CSV or other format and then upload them to relational database, this doesn't give us a real time dashboard, and also it will help us from doing some works around to implement it, or using a lot of tools sideways just to archieve it.

Please can this be implemented so that we interact with relational databases in an easy way?

Thank you...
[color=#800000][size=85][i][b]Munir Mdee
Software Developer (Data Processing)
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com[/b][/i][/size][/color]
savy
Posts: 214
Joined: December 27th, 2012, 1:36 pm

Re: SYNCING DIRECT WITH MARIADB OR POSTGRESQL

Post by savy »

While cases in the database are stored in compressed JSON, you can use the blob breakout feature to breakout case data to relational tables. Please see the help documentation here.
https://www.csprousers.org/help/CSWeb/d ... tings.html
The relational table data can be used for reporting or exporting it to other databases. Hope this helps.
munirmdee1
Posts: 83
Joined: August 17th, 2015, 9:32 am
Location: Dar es Salaam, Tanzania

Re: SYNCING DIRECT WITH MARIADB OR POSTGRESQL

Post by munirmdee1 »

Yes Savy,

The solution you mentioned works, but only if synchronization is done with CSWEB, What I wish is, being able to synchronize with relational databases direct from the data entry apps.

For example, lets say I'm doing a households listing, what I need is, whenever Im synchronizing with csweb or FTP I need data should come direct from the listing device to the relational database, instead of data to go to csweb database first and then transferred to another databases by CRON Job.

Maybe I explain the approach im using, in cspro data entry application (capi), I wrote a function that takes and writes all the variables of the listed household into a jjson file (lets say household.json), and then I make a php API, which reads the content oof that json file, and insert into a relational database table. In short I write the household information in a json format and store then in a file, then a PHP API reads the content of a file and insert into a Table in a relational database. So that every time data is sent to a cspro csweb or ftp it also sent to a relational database, and the dash board is updated in real time.

This is what I mean, if it can be added to a cspro so that it will be easier to accomplish the task more easily.

Thanks
[color=#800000][size=85][i][b]Munir Mdee
Software Developer (Data Processing)
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com[/b][/i][/size][/color]
htuser
Posts: 691
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: SYNCING DIRECT WITH MARIADB OR POSTGRESQL

Post by htuser »

I was able to do something similar using the new network.fetch (https://www.csprousers.org/help/CSPro/C ... fetch.html) posting directly to a NodeJS REST API with PostgreSQL as backend.

PostgreSQL via PGRest (https://docs.postgrest.org/en/v14/) can directly support receiving data from CSEntry even without NodeJS.
Best,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply