ZDatabase - Unity Database

Tired of those hard to use, long learning curve database packages for Unity? Need something quick and easy, that can store almost anything you can think of?

ZDatabase supports:

  • Saving strings, int, float, Guid, Vector2, Vector3, Vector4, and more
  • Read / Write functions that are easy to use. No pre-setup required
  • Works on all platforms (including Consoles!). PC, Android, iOS, Wii, XBox 360, and PS3
  • Encryption functions available as well. Every functions has an encrypted alternative as well. Encryption uses Rijndael 128 bit encryption

Demo scene included.

If you need any additional data types added, feel free to send a PM or post in the forum, and I will include in the next release.

Quite interested in this. I have a project which is going to have to do some data visualisation of integer data recorded every day for an Android and iOS app. I was wondering what sort of performance limitations i’m going to have when it comes to long term use…

e.g. how many records can it store and ‘SELECT * from recordedInts WHERE data > start and date < finish’ and whats sort of response times will say 1000 records take to pull out?

Sorry for the crappy SQL pseudo but its easier to convey my need.

Hello TechinalSam,

That is a very good question. I put together a quick test to demonstrate write / read speed. I had it insert 100,000 records, then read the first, middle, and last records.

Insert speed does decrease as the number of record increases. I noticed the insert speed decrease around 60K records. At this time, it was inserting 150 records in about 800ms.

I ran this test on an Android Samsung Galaxy S2 phone. Speed should be comparable on a iPhone 4S.

Total time to insert 100,000 records: 402,085ms (40.2 seconds)
Read time for first record: 0ms
Read time for 50,000th record: 15ms
Read time for 100,000th record: 33ms

The issue with the inserts is that the database has to be expanded to handle new records. All databases have to handle this, and I’ve done my best to optimize this for mobile devices.

I’m available if you have any further questions.

Works on web?

+1

Texture?

Yes, it works for web.

It does not currently support Texture, but I can add that if requested.

I’ve just uploaded a new version which supports Texture2D. It should be approved and in the asset store later today or tomorrow.

Does it support SQL syntax?
If it supports web player, where and how is the actual data stored?

I’m looking at this specifically for a web player solution.

ZDatabase uses functions for each data type. I’m attaching the current documentation, so you can see how it works.

1104180–41513–$ZDatabase Documentation.pdf (365 KB)

Ok I went through the documentation.
Aside from offering encryption, which is fairly trivial to implement, what does this package offer over simply using playerprefs to read and write data values?

The advantages are being able to quickly save / retrieve objects of different data types, without having to write your own custom serializers (since PlayerPrefs only gives you Int, Float, and String). The same advantages you will have with almost every PlayerPref alternative on the asset store.

If you need to use SQL statements, there are a few good embedded SQL databases on the asset store. I’m providing ZDatabase as an alternative to PlayerPrefs, and to make it easier for people to save/retrieve objects.

As I’ve already previously stated (and demonstrated above), if you need additional object types to be included, I’m happy to add them into new releases.

is this used for local database/remote database?

The database is stored on the same device as the game.

I just bought this thinking it was a full database but it looks like you can only store one field per record. Is that correct? Is there any way that I can store a bunch of fields in each record? (other that faking it by encoding it myself).

Can you give me an example of what you’re trying to do? Are you wanting to store an array / List to a field, or something else?

I’m happy to add additional functionality and/or data types to ZDatabase.

Seems quite cool for single player games - and its cheap. Might buy it to save some time of doing it all myself!

dumb question i iknow but work with javascript variables?

Yes, it works with JavaScript as well.

Looks really good. Does this also work with Flash .

Yes, ZDatabase does work with Flash as well :smile: