ZODB running on iOS

147 views
Skip to first unread message

Bruce Cropley

unread,
Apr 26, 2014, 7:37:11 AM4/26/14
to kivy-...@googlegroups.com
Hi all

I have managed to get ZODB running on iOS (and it was fairly easy to get it working on OS X for dev.)
It required building a static library for the python extensions.
I'd like to contribute it to the community, but I'm not sure where to put it: the Garden, Plyer, or as a branch of kivy-ios. If and when I get to other platforms, I plan to get it working there too. Suggestions?

Thanks,
Bruce

theb...@gmail.com

unread,
Jun 11, 2014, 12:34:36 PM6/11/14
to kivy-...@googlegroups.com
Hello Bruce,

Sorry for the late response, I have just started to looking into Kivy.

As the line above suggest, i am not trying to answer your question :-).
But I am interesting in running the ZODB on ios ( and android ).

Did you find a place to publish you code??

If I can not help with the porting the ZODB, at least I can do some testing... :-)


Best Regards

Brian

Bruce Cropley

unread,
Jun 14, 2014, 1:47:52 AM6/14/14
to kivy-...@googlegroups.com
Hi Brian

I haven't yet got it into a neat state - at the moment it is just a group of changes that I have made to the kivy-ios deployment source. 
Have you used ZODB before? If not, there are some gotchas that I can warn you about.

Pros:
- Very fast
- I haven't hit a bug in it yet
- DBs are easily transportable to iOS (though I haven't yet worked out how to get them directly into user_data_dir, so I've been copying it via the XCode build)
- You can store arbitrary networks of your persistent data

Cons:
- Any persistent mutable object usually needs to derive from Persistent.
- You need to use PersistentList([]) and PersistentMapping({}) instead of [] and {} (I use an alias for each of these)
- The DB needs to be packed, or it can get very big.
- Packing on iOS is slow, and it can be a bottleneck. (e.g. 3s for 7MB DB on an iPad Air)
- The DB needs to be built/stored in App.user_data_dir in order for it to be written to.
- "Schema migration" is painful.
- Building it for iOS has been non-trivial

I'm often on the #kivy IRC group on freenode.
I have some questions for you about how you intend to use it: how much data do you want to store etc.

Good luck,
Bruce :)

Bruce Cropley

unread,
Jun 14, 2014, 2:10:31 AM6/14/14
to kivy-...@googlegroups.com
Sorry, just checked this, should have been:

- Packing on iOS is slow, and it can be a bottleneck. (e.g. 6s for 7MB DB on an iPad Air)

...and it is blocking, so it can be frustrating.

theb...@gmail.com

unread,
Jun 16, 2014, 4:17:59 PM6/16/14
to kivy-...@googlegroups.com
Hi Brian

I haven't yet got it into a neat state - at the moment it is just a group of changes that I have made to the kivy-ios deployment source. 
Have you used ZODB before?

I'm often on the #kivy IRC group on freenode.
I have some questions for you about how you intend to use it: how much data do you want to store etc.


Hey Bruce,

thanks for your response.

I am quite comfortable with the ZODB. It has been the main data storage for some of the systems I have worked on.

My challenge is to make an app that works offline, and syncronizes with a dataserver when comming online again.
( when online, it updates both the local and the dataserver db's, in a optimistic may )

The dataservers db is currently ZODB, so I already have the data model.
If I can use the ZODB on the apps, it will make my world a little more beautiful.

Having a - what to call it - " a distributed system, with some maybe offline units ", means a lot of transactions will finally be denied.
Sometimes the best solution, is to simply drop the db on the app, and read a current snapshot from the dataserver, to build a new db.
So, I guess that the slow packing will not be a problem in my case. Maybe I will even never pack..( if I do, the users will be used to waiting times :-) ).
 
Data can be filtered for each user/app,  so in my case, it will probably never be more than 15 mb...

Right now I have my fingers and head full of Kivy juice, IOS Icecream, and Android Jelly Beans, but I will soon try to catch you on freenode...



Thanks

Brian
 


Bruce Cropley

unread,
Jun 19, 2014, 5:05:49 AM6/19/14
to kivy-...@googlegroups.com
> I am quite comfortable with the ZODB. It has been the main data storage for some of the systems I have worked on.

Great, you can probably give me some tips too then :)

> My challenge is to make an app that works offline, and syncronizes with a dataserver when comming online again.

Wow, that's ambitious! I haven't even done any network coding on iOS yet, let alone remote synchronisation. I suggest you do some tests of the technologies you're planning to use before getting too deep into it - developing for iOS can be very frustrating in my experience.

> ( when online, it updates both the local and the dataserver db's, in a optimistic may )

> The dataservers db is currently ZODB, so I already have the data model. 
> If I can use the ZODB on the apps, it will make my world a little more beautiful. 

It shouldn't be too hard to get that part working.

> Having a - what to call it - " a distributed system, with some maybe offline units ", means a lot of transactions will finally be denied. 
> Sometimes the best solution, is to simply drop the db on the app, and read a current snapshot from the dataserver, to build a new db.
> So, I guess that the slow packing will not be a problem in my case. Maybe I will even never pack..( if I do, the users will be used to waiting times :-) ).

Well I'd guess with a DB of around 15MB packing is unlikely to take more than 20s (that's very rough guestimation), so training the users isn't going to be *too* hard.

>   Data can be filtered for each user/app,  so in my case, it will probably never be more than 15 mb... 
>   Right now I have my fingers and head full of Kivy juice, IOS Icecream, and Android Jelly Beans, but I will soon try to catch you on freenode...

OK. Enjoy :)

>   Thanks
>   Brian

Bruce

Toni Bagur

unread,
Aug 25, 2014, 5:29:16 PM8/25/14
to kivy-...@googlegroups.com
Hi Brian,

Are you still working in this app? I have very close requirements(offline + datasyncronitzation) and I think that we could collaborate. Do you think it so? Do you have any repo in which I can have a look?

Regards,
Toni

Amirouche Boubekki

unread,
Aug 27, 2014, 2:51:54 PM8/27/14
to kivy-...@googlegroups.com
2014-06-11 18:34 GMT+02:00 <theb...@gmail.com>:
Hello Bruce,

Sorry for the late response, I have just started to looking into Kivy.

As the line above suggest, i am not trying to answer your question :-).
But I am interesting in running the ZODB on ios ( and android ).

Sounds like not a best idea, at least because it is not already doable. Getting a file based database that support transaction for a single writer sounds easier to me.

That's said getting to know how to package stuff of iOS or Android might be helpful in the future, especially if you improve the documentation of the related tools.
 

Did you find a place to publish you code??

If I can not help with the porting the ZODB, at least I can do some testing... :-)


Best Regards

Brian


Den lørdag den 26. april 2014 08.37.11 UTC-3 skrev Bruce Cropley:
Hi all

I have managed to get ZODB running on iOS (and it was fairly easy to get it working on OS X for dev.)
It required building a static library for the python extensions.
I'd like to contribute it to the community, but I'm not sure where to put it: the Garden, Plyer, or as a branch of kivy-ios. If and when I get to other platforms, I plan to get it working there too. Suggestions?

Thanks,
Bruce

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Lozinski

unread,
Sep 30, 2015, 5:01:57 AM9/30/15
to Kivy users support
 I created a tree of links related to teh ZODB at:

There is also a link to this discussion at:

Please let me know if there is anything else I should link to.

Regards
Chris
Twitter.com/zodb4
Twitter.com/blogory
Titter.com/grokzope


Reply all
Reply to author
Forward
0 new messages