Building a real-time distributed database for the browser. This presentation was held on a Python meetup in Budapest. I talked about the initial idea of ubikDB, what are my results so far, and how I plan to continue.
2024: Domino Containers - The Next Step. News from the Domino Container commu...
ubikDB intro: Building a real-time distributed database for the browser
1. ubikDB: an introduction
Building a real time distributed database
for the browser
2014-02-26, budapest_py
Balázs Reé
ree@greenfinity.hu
@reebalazs
Python, JavaScript web development
with open source
2. Ubik is a book of Philip K. Dick.
Ubik is an universal product.
!
shared database = persistency + notifications
syncing JSON data in the browser
real-time, responsive applications
3. Data and event flow
•
it’s a sync solution
•
networking through http
•
•
•
‘service’ could be a web
application
Database adapters
Simplest: volatile mem
storage
Clients
Server
service
JSON
DB adapters
mem
MVC…
…
JSON
MVC…
7. Implementation choices
•
2013 Pyramid sprint
in Halle (a.k.a “Wasp
Base”)
•
Substance-D
•
syncing client data
with socket.io (via
http)
•
server connects to
database adapters
to existing DB
Clients
Server
web app
JSON
DB adapters
mem
ZODB
http,
socket.io
Pyramid (Substance-D)
gevent-socketio
gunicorn
JSON
socket.io-client
AngularJS
8. Url mapping between
ubikDB and ZODB
•
both ZODB and ubikDB has traversal based url
mapping
•
/my_folder_1/my_document_1
•
/my_folder_1/my_document_1/@title
•
/my_folder_1/my_document_1/@body
•
/my_folder_1/my_document_1/@
•
/my_folder_1/my_document_1/@/into/a/deep/structure
beginning of a story, how did I start and what decisions I have taken
PKD 1928 - 1982. A scanner darkly, Blade Runner, Total Recall. (szarnyas fejv, emlekmas)
Ubik is about shifting realities. (pronounce U-bik)
universality: no more REST, … it encapsulates a very generic part
ubikDB is not really a DB :)
Because I am thinking in connecting to web apps…
Example: binding an input field to the title, 2 way binding all the way
commercial
is this possible - realistic - and worth to do?
We have no $$$ but we are smart.
And there are simple use cases.
Also: it can be actually improved! api is single purpose + more possibilities because we can run our own server
I’m not really implementing a DB, but more a syncing solution
Substance-D: a framework for writing a Content Management Famework. It is based on Pyramid and has ZODB as batteries.