After doing some browsing of the code, it appears that the SQL queries are spread out in many of the files in program/lib/Roundcube.  There is a fair amount of aggregation going on in the SQL queries themselves which would mean a lot of work developing data models to capture all the ways that data is being retrieved so we can pre aggregate those data sets.  Considering that roundcube next is on the horizon I believe it would be more applicable to incorporate Cassandra storage in that platform.  It would be considerably easier to implement if all of the backend data storage was done in a denormalized fashion, including the SQL backend, and doing aggregations on the server side.  That way a data structure could be easily placed on both SQL and NoSQL without much fuss.  By pushing the complexity of joining/grouping/ordering data into the server you could build a very basic set of table structures and expose that data as an internal set of functions.  What used to be a single query might turn into two or three simultaneous queries to multiple tables for pre aggregated data, and the server would then join/group/order the information before returning the data to whatever function called it.  This also makes it simpler to extend the data model by adding new tables to capture new functionality without needing painful database migrations to alter existing tables (most of the time).  


On Apr 28, 2015, at 9:25 AM, Thomas Bruederli <thomas@roundcube.net> wrote:

On Tue, Apr 28, 2015 at 3:30 PM, Michael Andrews <list@airstreamcomm.net> wrote:
Looks fairly straightforward.  The reason I am choosing to start now is the
folks at Datastax have finally released their own supported PHP driver
https://github.com/datastax/php-driver.  Depending on how many JOINs, or
aggregation functions are implemented in the SQL it will make for an
interesting data model in C*.  If anyone has some thoughts on how the
current data is structured in SQL and how it might commute to a denormalized
data model I would very much appreciate your input.

There's a schema published at
http://trac.roundcube.net/wiki/Dev_Docs#DatabaseSchema
Might not be 100% up-to-date but sums it up. Joins are mainly used in
address book queries (with groups). See
https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_contacts.php#L213
and https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_contacts.php#L303
for examples.


~Thomas


On Apr 28, 2015, at 1:36 AM, A.L.E.C <alec@alec.pl> wrote:

On 04/27/2015 06:18 PM, Michael Andrews wrote:

I have been wanting for sometime to implement a Cassandra backend for
Roundcube


Take a look at rcube_db and rcube_db_* classes. In general you need to
create rcube_db_cassandra class that overwrites some of rcube_db methods.

If you use a PHP driver that supports CQL it should be quite
straightforward. There are a few
http://planetcassandra.org/client-drivers-tools/#PHP. Some are PDO
drivers which would make the work even simpler.

--
Aleksander 'A.L.E.C' Machniak
Kolab Groupware Developer        [http://kolab.org]
Roundcube Webmail Developer  [http://roundcube.net]
---------------------------------------------------
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
_______________________________________________
Roundcube Development discussion mailing list
dev@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/dev



_______________________________________________
Roundcube Development discussion mailing list
dev@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/dev
_______________________________________________
Roundcube Development discussion mailing list
dev@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/dev