Archived

This forum has been archived. Please start a new discussion on GitHub.

Is it possible to use mysql in Freeze?

Since ICE is GPL licensed, in theory the code can be modified, however, like to find out if it's even doable to replace berkeley DB by mysql?

Comments

  • bernard
    bernard Jupiter, FL
    "Porting" Freeze to another database is certainly doable, but not straightforward. Why do you ask?

    If you just want to use Ice and mysql together, you can do it, no need to write a Freeze layer. The IceUtil::Cache (C++) / IceUtil.Cache (Java) classes can help you write a very efficient Ice Servant Locator on top of any database (the Freeze Evictor uses these classes).

    Do you want to isolate your code from the underlying database system?

    Or do you want to store all your data, including the IcePack and IceStorm databases, in mysql?

    Cheers,
    Bernard
  • Mysql will be the only choice in my application, assume everything that ice will use for persistent will be using mysql, including icePack and iceStore. If the database layer is flexible already then no need for modifying ice core, is this correct?
  • bernard
    bernard Jupiter, FL
    Well, for your own application, you can use any database with Ice without modifying any Ice code.

    If you use IcePack and IceStorm, it is not possible to change the kind of database they use without modifying Ice code (not the Ice core, but still Ice code). But why would you care where IcePack and IceStorm store their data? Berkeley DB is an embedded database (linked-in each process: no separate daemon) that requires no administration.

    Bernard
  • Bernard, your comment make sense. It should not matter where the icePack and iceStorm manage their operating data, as long as I don't have to install another database instance on the same server since we already have mysql. But the application data which transmitted between clients and server will be stored in mysql tables, sounds like this is totally doable with ice freeze layer.
  • Bernard,

    Do you mean that to make an object persistent FREEZE is not the only way. I can save the data of an object to any DB, when the client requests that object, load the data of an object from DB and then construct that object and then returns it to client by Servant Locator interface.

    Is that right ?

    If that is true, why needs FREEZE ?
  • bernard
    bernard Jupiter, FL
    This is correct, you can implement your own servant locator that stores and retrieves data from your favorite database system.

    Freeze provides such a servant locator (the Freeze Evictor) implemented using Berkeley DB; it also provides C++ and Java-like Maps using Berkeley DB (Freeze dictionaries).

    Cheers,
    Bernard
  • Hi Bernard:
    bernard wrote:
    This is correct, you can implement your own servant locator that stores and retrieves data from your favorite database system.

    Cheers,
    Bernard

    How can I do this? Or which toolkit can do this in Ice?
  • benoit
    benoit Rennes, France
    I recommend reading the section 30.6 of the Ice manual, it explains how to use and implement servant locators.

    Benoit.