gunthercox / ChatterBot

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
https://chatterbot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
14.07k stars 4.44k forks source link

Use multiple databases #931

Closed Issen007 closed 6 years ago

Issen007 commented 7 years ago

As suggested, I open a new request for this. But it should be really nice to be able to have multiple databases connections to a single chatterbot. And in the chatterbot configuration area you should be able to tell it if you only should have Reaad-Only mode or read-write mode.

In this case you can then have a larger master databases where multiple chatterbots can be connected to, to be able to have a larger standard data. And a local attach database that has local knowledge such names of people, hardware and data that is only internal use and no use for any other people.

lesleslie commented 7 years ago

sqlalchemy does support multiple binds and allows for multiple database connections. I can't give you a time frame but I need to see how flask implements this anyway and I'll get back to you, unless of course someone is able to get to it before.

I'm pretty sure using multiple mongodbs wouldn't be that hard to implement either.

-- les

On Aug 14, 2017 12:20 AM, "Christian Petersson" notifications@github.com wrote:

As suggested, I open a new request for this. But it should be really nice to be able to have multiple databases connections to a single chatterbot. And in the chatterbot configuration area you should be able to tell it if you only should have Reaad-Only mode or read-write mode.

In this case you can then have a larger master databases where multiple chatterbots can be connected to, to be able to have a larger standard data. And a local attach database that has local knowledge such names of people, hardware and data that is only internal use and no use for any other people.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gunthercox/ChatterBot/issues/931, or mute the thread https://github.com/notifications/unsubscribe-auth/AOUGNx3sRmR7rg_lFQ3GHGswGPK8j0Ieks5sX_VFgaJpZM4O2BOW .

gunthercox commented 7 years ago

I'm wondering about the pros and cons of supporting this. If a particular database architecture (MongoDB, Sqlite, etc.) allows this than I'm all for it.

One possible issue I can foresee is the challenge of merging the results from multiple non-homogeneous database. For example, someone wants to use a Postgres database and a MongoDB database together for their data.

lesleslie commented 7 years ago

Yeah, i think this would have to be implemented using multiple mongos OR multiple sql's. I know the ability exists in sqlalchemy to mix and a match your sqldb's, but I just can't see trying to use a sql and a mongo.

-- les

On Aug 14, 2017 5:42 PM, "Gunther Cox" notifications@github.com wrote:

I'm wondering about the pros and cons of supporting this. If a particular database architecture (MongoDB, Sqlite, etc.) allows this than I'm all for it.

One possible issue I can foresee is the challenge of merging the results from multiple non-homogeneous database. For example, someone wants to use a Postgres database and a MongoDB database together for their data.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gunthercox/ChatterBot/issues/931#issuecomment-322347151, or mute the thread https://github.com/notifications/unsubscribe-auth/AOUGNzP3EglLkDLPt0uDKnEOEFhdiiOqks5sYOlhgaJpZM4O2BOW .

Issen007 commented 7 years ago

@lesleslie in our case we will probably mix between Centralize Postgress and local SQLite

gunthercox commented 6 years ago

I'm going to close this ticket off.

For any developers looking for information on this in the future, my recommendation at the present time is to seek solutions that will store your chat bot's conversational data in the same database. If a single database is insufficient on a hardware level, then there are architectures that can be used which implement multi-machine database storage. For grouping and/or categorizing statements in these setups I recommend adding fields to the existing data models or creating a "grouping" table with one-to-many references to the statements within each group.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.