Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ACID NoSQL Data Storage Solution[RELEASE]

Discussion in 'Assets and Asset Store' started by zhing, Apr 3, 2013.

  1. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    The UnDBreeze is a ACID NoSQL(embedded Key/Value storage) based data storage framework for Unity3D 4.x.

    It is based on my modified version DBreeze.
    DBreeze(http://dbreeze.codeplex.com/) is high performance of CRUD operations database, and supports transactional, ACID-compliant, multi-threaded.

    There are two ways to use this framework.
    Use the C# API, DataManager and DataStorage Unity3D components.
    Use the PlayMaker intergration UnDBreeze Actions.

    The UnDBreeze also support data encryption and data compression.
    The UnDBreeze is all platforms supported. Tested on PC, Mac, iOS and Android.:cool:

    The Asset Store: http://u3d.as/4oW
     
    Last edited: May 4, 2013
  2. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Great asset,

    can we have a look at the doc
    Also we are publishing to Unity Flash, does this work on Flash?

    Thanks.
     
  3. Alex-Chouls

    Alex-Chouls

    Joined:
    Mar 24, 2009
    Posts:
    2,652
    Last edited: Apr 5, 2013
  4. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    Sorry for the late reply.

    @rocki
    I haven't test it for Flash.
    But for the WebPlayer build. There is no IO.
    So database file couldn't be wrote to your disk.:neutral:

    The attachment is the Documents.
     

    Attached Files:

  5. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
  6. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
     
    Last edited: Apr 13, 2013
  7. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    @rocki

    I am really very sorry.
    Because of the limitation of the Unity3D WebPlayer and the dbreeze(which UnDBreeze is based on).
    I can't make it to work in the WebPlayer.:(

    So only PC standalone, Mac standalone, iOS and Android are supported.
     
  8. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Zhing,

    OK, but can you give more information what Dbreeze needs that makes the WebPlayer not work?
     
  9. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    @rocki

    There is only one way, WebPlayer can save database data.
    Send the data to the remote server by WWW POST request.
    But before do this, you must get the data as byte[].

    dbreeze can save the whole database to memory. But can't get the database as byte[].

    So, the WebPlayer require data as byte[] for sending with WWW POST. But dbreeze can't return the whole database as byte[].

    If you want to save your data to remote database. Maybe you can try MySQL as the storage solution.
     
  10. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Thanks Zhing for your reply,

    Let me see if I understand what you wrote correctly.

    1. Webplayer can only save data using WWW POST.
    2. WWW Post only works with Byte[].
    3. Dbreeze can save to memory but not Byte[].

    Result: Dbreeze cannot work in Webplayer, use something else in Webplayer that can send Byte[] to WWW Post and use MySQL on the Server.

    Question: Since Dbreeze can save to Memory, can I save what is in Memory to something else that can convert to Byte[] ? What is the format of the Dbreeze Data that is in Memory. ?
     
  11. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    @rocki

    You can check the dbreeze's source code at dbreeze.codeplex.com.
    In memory mode, dbreeze storage the whole database to multi MemoryStorage objects.
    If you could get all these MemoryStorage objects and convert them to byte[], then you can send it to your server.
    But it is a very difficult way. You need to change many code of dbreeze.

    If you want to try to do this. I can send you my modified version of dbreeze for Unity3D.
     
  12. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459

    Zhing,

    Is this the MemoryStorage.cs class you mean?

    http://dbreeze.codeplex.com/SourceC...ebd286b84800#DBreeze/Storage/MemoryStorage.cs

    It looks like this class is already storing in Byte.

    You can send the modified version Via PM in this forum

    Thanks.
     
  13. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    Sorry for the late.

    This the source code of dbreeze which UnDBreeze is based on.
     

    Attached Files:

  14. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Zhing,

    Is this your modifications or just the source code of dbreeze ? Please send me your modifications using Private Messaging of this forum.
     
  15. zhing

    zhing

    Joined:
    Jul 6, 2012
    Posts:
    19
    @rocki

    It is which UnDBreeze is currently based on.
     
  16. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Can I use this plugin to save/load image/audio data on IOS at runtime?

    Also, The asset store description needs a link to an example or a link here. I only found this through doing a google.
     
  17. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Hi Zhing, it's been a while.

    Did you get a chance to update this package to work for Unity3D WebPlayer ?

    Thanks.
     
  18. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    Hi,

    Error 5 The type or namespace name `JsonReaderSettings' could not be found. Are you missing a using directive or an assembly reference? Assets/Scene2d/UnDBreeze/Scripts/JsonFXSerializator.cs 27


    Error 4 The nested type `Serialization' does not exist in the type `Pathfinding' Assets/Scene2d/UnDBreeze/Scripts/JsonFXSerializator.cs 19

    Error 3 The imported type `Ionic.Zlib.CompressionLevel' is defined multiple times Assets/Scene2d/UnDBreeze/Scripts/DataManager.cs 45


    The most serious error is PathFinding. I use A* Pathfinder and the namespace collides between your product and A* Pathfinder.


    Also, any A* path-finding product on the asset store which descends from Pathfinder will get conflict.
     
  19. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    1. Can I have a refund. The product does not work.


    2. Where is the sources for the changes you made?
    It is MIT-licensed and the MIT sources are not present in the asset I brought.
    The DBreeze (freeware on codeplex) don't work on Unity3d because it uses Linq and NET30.


    I'm moving on and using SiaqoDB instead.
     
  20. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    I would also like to submit a request for a refund.

    The advertising and documentation shows "Supports for All Platforms", when I bought it, the Webplayer version doesn't work. When I asked about how to fix this, I was told that the source will be sent. So far, no source has been sent. Only the original opensource file is sent, but not the "Modified source". Basically my project is for WebPlayer and I cannot use this plugin at all. I have bought your other plugins and they work but this one I cannot use because it doesn't support all platforms and particularly doesn't support the WebPlayer.

    Please refund.

    Thanks.
     
  21. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    I managed to get the original DBreeze to work with Unity3D.


    I'll commit back to the original repository when done.
    The original version supports MonoMac, MonoPhone and MonoDroid.
     
  22. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Great News eskimojoe. Please let us know when its done.
    Very much appreciated it.
     
  23. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    @Rocki
    I'm thinking of doing that for SQLite as well as that other database system which you can store textures, sounds and terrain in encrypted format.


    They take an open-sourced BSD / MIT license codes and make small changes to SQLite to compile and work correctly on Android (the segfault error fix) Unity3d and sell it on the asset store, while the original sources is broken.


    Drop me a note, I cannot guarantee anything, but I can try to get you started or if you can test the fixes I made for DBreeze. It's free of charge.
     
  24. uniphonic

    uniphonic

    Joined:
    Jun 24, 2012
    Posts:
    130
    What about saving it to PlayerPrefs? I understand PlayerPrefs still works on Web player.

    There is a free package in the Unity Asset Store called "Save Game-JSON+Binary", which sounds like it might be able to save a Memory version of a UnDBreeze database to PlayerPrefs? Anybody tried this?
     
  25. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Interesting option to save UnDBreeze database to PlayerPrefs.

    To be fair, this is something that Zhing should be investigating as he sold this package saying that it supports Web player. Only after buying it did he tell us that it doesn't work with WebPlayer and we should go use something else.
     
  26. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    I did further checks on the DBreeze on the original repository. The code uses Json for serializing and unserializing. The original used NewtonSoft, the likely replacement is either LitJson or Bson (binary Json) or Json.net.


    I did a couple of tests on iOS and WebPlayer. I think you should look at a Json server (on the server - e.g., MongoDb, PHP streaming Json streams) and on iOS I was not able to get it to work due to iOS / AOT errors.


    Choices will be very limited. NDatabase, FileDB and others use reflection and IL emitting to generate classes to load save data structures. This does not play well with Unity/iOS and Unity/WebPlayer.


    The suggestions are:
    - UnitySerializer (Recommended).
    - Protocol Buffers (Recommended).
    - LitJson has bson (binary streaming)
    - Json server on server,
    - Json, XML streaming / loading.
    - Siaqdb,


    For saving/loading PlayerPrefs look at UnitySerializer - http://whydoidoit.com/unityserializer/


    Good luck.
     
  27. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440
    Hi Rocki,

    1. If you have issues with UnitySerializer on iPad1, you can ask the person who did it.

    You have to register the classes and follow the instructions.
    http://whydoidoit.com/2012/04/18/fa...s-and-method-invocation-with-aot-compilation/


    2. Are you using Application.DataPath to load/save data?

    3. If you still cannot use UnitySerializer, you might want to look at the last remaining options. ProtocolBuffers and last, Json.


    4. If you don't understand the setup instructions for configuring ProtocolBuffers, look at the last choice, LitJson. This seems to be the only cross-platform thing that works well on all platforms. :(
     
  28. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Hi Eskimojoe,

    Thanks for all the suggestions, I had a look into Application.DataPath and IOS compilation for IOS.
    Still need a more stable solution. Investigating ProtocolBuffers and LitJson.

    Mucho Thanks for all your recommendations.


    btw, Do you think it's possible to fix Acid NoSQL problem of not working on Webplayer by using either ProtocolBuffers or LitJson to serialize the data coming out of Acid NoSQl and storing this data in the PlayerPrefs. Then when Acid wants the data, it can be de-serialized from PlayerPrefs and given back to Acid NoSQL.
     
    Last edited: Jun 26, 2013
  29. eskimojoe

    eskimojoe

    Joined:
    Jun 4, 2012
    Posts:
    1,440

    From the original sources, no. There is so many AOT errors in the Unity WebPlayer when I tried to move it over. That's not even counting the reduction of feature-sets and functionality from the original product that has to be removed in-order to get it to compile.


    What is your server-back end? We wrote a huge massive downloader and uploader class in ASP.NET for the Json streaming of certain files. But later we moved to server-side solution.


    Did you try ElectroTank or Photon?
     
  30. HoMeBoYErik

    HoMeBoYErik

    Joined:
    Mar 12, 2014
    Posts:
    23
    I would like to report a bug with Acid NoSQL Data Storage: beginning with Unity 4.5.5 version the script fail to create the database files in ~/Library/Caches folder. I can initialize the DataStorage with 4.5.4. If the Storage is already created the 4.5.5 works correctly, so I think that Unity changed the way to write files to Cache and the script now fails. Please if you have any bug fix report it here.