syncany-team team mailing list archive
-
syncany-team team
-
Mailing list archive
-
Message #00666
Re: Database cont'd (JDBC/MySQL, for now)
Hello everyone,
I'm still working on the "sqlplayground" branch. I now switched to the
embedded HSQL database and it works quite good already. While I have not
yet adjusted the tests, the local database is now stored to a local HSQL
database, and read using SQL queries.
Here are a few links (in case you're interested):
- createtables.sql (database structure):
https://github.com/binwiederhier/syncany/blob/dae012381657ec1b514cf8eaaefbd0175bc2c994/syncany-lib/src/main/resources/createtables.sql
- WriteDatabaseDAO (all INSERTs):
https://github.com/binwiederhier/syncany/blob/dae012381657ec1b514cf8eaaefbd0175bc2c994/syncany-lib/src/main/java/org/syncany/database/WriteDatabaseDAO.java
- BasicDatabaseDAO (most SELECTs):
https://github.com/binwiederhier/syncany/blob/dae012381657ec1b514cf8eaaefbd0175bc2c994/syncany-lib/src/main/java/org/syncany/database/BasicDatabaseDAO.java
Not everything is implemented yet, but the normal cases already work.
The memory footprint stays small, even for large files, because not
everything is loaded into memory. It starts out with about 90 MB and grows
to 200 or so when indexing ("up" operation) -- this is due to HSQL memory
caching. The "down" operation is not so efficient yet. I'll have to work on
that.
Best
Philipp
On Mon, Dec 23, 2013 at 9:17 AM, Philipp Heckel <philipp.heckel@xxxxxxxxx>wrote:
> Hello again,
>
> I started fiddling around with a pure JDBC connection, with the ultimate
> goal to create a couple of DAOs to select an operation specific context
> rather than load the whole database.I used Fabrice's MySQL Workbench
> diagram as a basis.
>
> For now, I'm only writing everything to a MySQL database and can look at
> the data later. This is very helpful to see if the datamodel works and if
> we can efficiently query the database as needed.
>
> Here's the updated data model:
> https://github.com/binwiederhier/syncany/raw/a310f25a413e984a336943d18e5118c2663e5792/syncany-assets/documentation/MySQL%20Workbench%20Database%20Layout.pdf
>
> And here is demo data (created from the sqlplayground branch):
> http://syncany.org/files/syncany-131223-sqlplayground.sql.7z
>
> This is just FYI :-)
> Please let me know if you have any ideas or critique!
>
> Best
> Philipp
>
>
References