You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Andreas Pieber <an...@gmail.com> on 2011/01/21 17:32:05 UTC
Karaf database"ing"
To avoid hooking jamies thread here an answer one point to karafman's point in a
different thread:
I would like to have default option for databasing :) BUT, I don't like that
karaf uses jdbc directly. Since most of my projects are based on aries-jpa it
would be cool to somehow integrate this into the JPA infrastructure. I'm not
completely sure how this could be done (requrired bundles, startup order, ...)
but it would be quite cool to not e.g. autogenerate the schema for the tables.
Any ideas according to this topic?
kind regards,
andreas
On Fri, Jan 21, 2011 at 07:48:42AM -0800, karafman wrote:
>
> We should also ask:
>
> What would the impact of making Karaf a JDK 1.6 compiled application be to
> your project:
> 1) major
> 2) minor
> 3) none
>
> Also, how do you guys feel about giving users the option of data-basing
> configuration files out-of-the-box?
>
>
>
> -----
> Karafman
> Slayer of the JEE
> Pounder of the Perl Programmer
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-Apache-Karaf-user-survey-as-part-of-3-x-roadmap-planning-tp2297953p2302610.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
Re: Karaf database"ing"
Posted by Guillaume Nodet <gn...@gmail.com>.
This discussion seems to be like it's going into way too much specific
details as how you want to deploy your karaf environments. There are
so many possible requirements and possible solutions that I don't
think it's wise to mandate any of those.
For example, using an embedded database for storing configuration does
not make much sense to me, as if it's only available to one karaf
instance, properties are way easier to deal with imho, so unless you
have a real database somewhere available, I don't see much value. As
for the nosql stuff, I don't think we should go that direction as it
imposes lots of constraints onto how/where you deploy your server.
I agree we could have a wiki page explaining how to set up various
things, but I'm not really sure we can go much further without
becoming too specific.
On Tue, Jan 25, 2011 at 21:44, karafman <mv...@comcast.net> wrote:
>
> Thanks for re-addressing this.
>
> Some other items to consider are:
> 1) Do we use a lightweight database inside of Karaf to initially hold
> configuration information and if so, which one? The selection criteria
> should be that the database have a small footprint, and its license should
> be the same as the Karaf license. If we go this route, we will want to
> mandate the database, schema, etc. Also, do we want an internal database to
> be relational or nosql? Nosql would definately provide a lightweight
> database as we would only be fetching name-value pairs, but would make it
> less accessable to users as there are more users familiar with relational
> aspects than nosql.
> 2) At what point should Karaf go to the database for information? Should the
> trigger be the existance (or non-existance) of the ./etc directory?
> 3) How do we put configurations into the database? For example, if someone
> wants to use an external database to hold thier configurations, do we create
> a config:database command that allows them to enter connection information,
> schema, table name, etc at runtime?
> 4) How much do we want to leverage the internal database? For example, do
> we want to push all the ./etc configurations into the internal database and
> then have the configAdmin service read from that?
> 5) What changes need to be made to the configAdmin service to preserve
> Karaf's dynamic configuration feature when using a backend database?
> 6) What changes would need to be made to the console to allow the editing of
> configurations stored in an external database from within Karaf? Are any
> changes necessary, can we assume the user will be using a tool from their
> database to make changes to configurations?
>
> In my original proposal I suggested an all-or-nothing approach which may not
> be what everone would like. In that proposal I suggested using a small OSGi
> friendly database (like H2) inside of Karaf. On startup if the ./etc file
> was missing, Karaf would attempt to load configurations from the database.
> If the internal database were empty, Karaf would prompt the user to indicate
> the location of ./etc configurations (assuming they are in files somewhere),
> load them into the internal database, and then continue starting up the
> system. If the user wanted to use an external database already populated
> with configurations, Karaf would allow them to enter the database connection
> information on startup, put it into the internal database, and would use
> that connection information to obtain configurations from the external
> database. Karaf would also need to initially look for the existance of
> connection information in the internal database. The database schema would
> be very simple: numeric key | configuration property name | configuration
> property value.
>
> I agree with Guillaume that we should not mandate the use of an ORM like
> JPA, as this would unnecessarily complicate the implementation.
>
> Regarding Guillaume's suggested implementations:
> Implementing a backend for felix configAdmin would be a difficult thing to
> do. After looking at the configAdmin code, this would by no be means
> simple.
>
> Writing a bundle that polls the db and pushes data into config admin seems
> like the better approach; however, this would need to regularly poll the
> database to allow dynamic configurations to be possible.
>
> -----
> Karafman
> Slayer of the JEE
> Pounder of the Perl Programmer
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-database-ing-tp2302963p2333955.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: Karaf database"ing"
Posted by karafman <mv...@comcast.net>.
Thanks for re-addressing this.
Some other items to consider are:
1) Do we use a lightweight database inside of Karaf to initially hold
configuration information and if so, which one? The selection criteria
should be that the database have a small footprint, and its license should
be the same as the Karaf license. If we go this route, we will want to
mandate the database, schema, etc. Also, do we want an internal database to
be relational or nosql? Nosql would definately provide a lightweight
database as we would only be fetching name-value pairs, but would make it
less accessable to users as there are more users familiar with relational
aspects than nosql.
2) At what point should Karaf go to the database for information? Should the
trigger be the existance (or non-existance) of the ./etc directory?
3) How do we put configurations into the database? For example, if someone
wants to use an external database to hold thier configurations, do we create
a config:database command that allows them to enter connection information,
schema, table name, etc at runtime?
4) How much do we want to leverage the internal database? For example, do
we want to push all the ./etc configurations into the internal database and
then have the configAdmin service read from that?
5) What changes need to be made to the configAdmin service to preserve
Karaf's dynamic configuration feature when using a backend database?
6) What changes would need to be made to the console to allow the editing of
configurations stored in an external database from within Karaf? Are any
changes necessary, can we assume the user will be using a tool from their
database to make changes to configurations?
In my original proposal I suggested an all-or-nothing approach which may not
be what everone would like. In that proposal I suggested using a small OSGi
friendly database (like H2) inside of Karaf. On startup if the ./etc file
was missing, Karaf would attempt to load configurations from the database.
If the internal database were empty, Karaf would prompt the user to indicate
the location of ./etc configurations (assuming they are in files somewhere),
load them into the internal database, and then continue starting up the
system. If the user wanted to use an external database already populated
with configurations, Karaf would allow them to enter the database connection
information on startup, put it into the internal database, and would use
that connection information to obtain configurations from the external
database. Karaf would also need to initially look for the existance of
connection information in the internal database. The database schema would
be very simple: numeric key | configuration property name | configuration
property value.
I agree with Guillaume that we should not mandate the use of an ORM like
JPA, as this would unnecessarily complicate the implementation.
Regarding Guillaume's suggested implementations:
Implementing a backend for felix configAdmin would be a difficult thing to
do. After looking at the configAdmin code, this would by no be means
simple.
Writing a bundle that polls the db and pushes data into config admin seems
like the better approach; however, this would need to regularly poll the
database to allow dynamic configurations to be possible.
-----
Karafman
Slayer of the JEE
Pounder of the Perl Programmer
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-database-ing-tp2302963p2333955.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
Re: Karaf database"ing"
Posted by Guillaume Nodet <gn...@gmail.com>.
Unless I misunderstood, the idea is just to have the configurations
stored in a DB right ?
If so the scope is limited to ConfigAdmin and there are two ways to
solve the problem:
* implement a back-end for the Felix ConfigAdmin (the service will
read the data once when starting and store any change back in the DB)
* write a bundle that polls the DB and push data into ConfigAdmin
My experience tells me that the second way is better, but I wouldn't
mandate JPA for such a simple thing imho, as the schema is very simple
and the bundle would only have to read, so it's basically a single
SELECT operation.
On Fri, Jan 21, 2011 at 17:32, Andreas Pieber <an...@gmail.com> wrote:
> To avoid hooking jamies thread here an answer one point to karafman's point in a
> different thread:
>
> I would like to have default option for databasing :) BUT, I don't like that
> karaf uses jdbc directly. Since most of my projects are based on aries-jpa it
> would be cool to somehow integrate this into the JPA infrastructure. I'm not
> completely sure how this could be done (requrired bundles, startup order, ...)
> but it would be quite cool to not e.g. autogenerate the schema for the tables.
>
> Any ideas according to this topic?
>
> kind regards,
> andreas
>
> On Fri, Jan 21, 2011 at 07:48:42AM -0800, karafman wrote:
>>
>> We should also ask:
>>
>> What would the impact of making Karaf a JDK 1.6 compiled application be to
>> your project:
>> 1) major
>> 2) minor
>> 3) none
>>
>> Also, how do you guys feel about giving users the option of data-basing
>> configuration files out-of-the-box?
>>
>>
>>
>> -----
>> Karafman
>> Slayer of the JEE
>> Pounder of the Perl Programmer
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/DISCUSS-Apache-Karaf-user-survey-as-part-of-3-x-roadmap-planning-tp2297953p2302610.html
>> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: [KARAF-418] - brainstorming ticket opened for: Re: Karaf database"ing"
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
FYI,
I've just created a brainstorm wiki page to gather open discussions:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=25199824
Feel free to add topics.
I'm gonna add content to open topics.
Regards
JB
On 01/26/2011 12:05 AM, karafman wrote:
>
> There is now a JIRA "brainstorming" ticket open to discuss this. I'll copy
> and paste this thread into that ticket.
>
> -----
> Karafman
> Slayer of the JEE
> Pounder of the Perl Programmer
>
[KARAF-418] - brainstorming ticket opened for: Re: Karaf
database"ing"
Posted by karafman <mv...@comcast.net>.
There is now a JIRA "brainstorming" ticket open to discuss this. I'll copy
and paste this thread into that ticket.
-----
Karafman
Slayer of the JEE
Pounder of the Perl Programmer
--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-database-ing-tp2302963p2335011.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.