I wonder what you mean by "ZODB for JavaScript". To me, ZODB means:
- "Transparency", which means the ability to write persistent
applications with minimal intrusion:
- Dealing with more or less arbitrary object, not just "documents"
connected in webs that can be as complex as necessary.
- Implicit object loading through object access.
- Letting the system keep track of what has changed.
- True transactions that span multiple objects. This overlaps more
with RDBMSs than with most NoSQL databases.
- A replication-based caching model. A ZODB database connection is a
consistent replica of a database. It's not all loaded into memory,
but the bits in memory are consistent and remain so as of the
transaction start. Replicas are kept up to date via real-time
invalidations.
This model has strengths and weaknesses. If an application has a
working set that fits mostly in memory, and if write rates aren't
too high, then it's extremely efficient, at least it is once the
cache is populated.
OTOH, with high right rates and large numbers of clients, the
invalidation model may become too expensive. And some applications
have large working sets that don't benefit much from caching.
JavaScript presents some special challenges. The greatest, I suspect
is it's radically asynchronous nature. While JavaScript has
synchronous APIs, the trend is toward asynchronous APIs. This is
especially challenging for databases, and especially for providing
natural object access. When ZODB automatically loads an object on
access, that's synchronous. It's hard to see how it could be anything
else.
If you want to make your head hurt, try to figure out how transactions
work in IndexedDB. IndexedDB seems to be poorly baked and poorly
adopted and I suspect it's insanely asynchronous access model is some
of the reason why.
Asynchronous models make a lot of sense for some use cases. I often use
them, however, religiously applying them everywhere is foolish, IMO.
Jim
--
Jim Fulton
http://jimfulton.info