I am not sure whether it is really feasible to implement this (or at least make it work reasonably fast & accurate), but here is an idea for an iPhone app I would definitely buy:
can [:read_about], User do
user.public?
end
can [:remove], [Comment, Post], &if_matching(:created_by)
|user| block parameter definition?) about its publicity. Hm. can [:read_about], User, :if => proc {|user| user.public? } # or
can [:read_about], User, :if => :public?
can [:remove], [Comment, Post], :if => proc {|posted|
posted.created_by == User.current } # or
can [:remove], [Comment, Post], :if => matching(:created_by)
def matching(attribute)
proc {|obj| obj.send(attribute) == User.current }
end
proc construct which is less likely a subject to a non-immediate execution (well, at least I feel it this way)
I must confess. We've committed a serious sin. We haven't had a single commit in StrokeDB repository for almost two months. Sorry.
So... one may wonder whether StrokeDB is still alive. Well, yes it is. Though we have significant changes in our plan and approach.
As for now, we consider existing StrokeDB as a first prototype — it has both cool things and a lot of crappy code. So most probably the existing version will perish.
However, we are learning lessons of that awesome development cycle and trying to produce something more clean, both conceptually and code-wise. One of the versions we've started working on, is Oleg's strokedb-core, an attempt to minimize StrokeDB's essential core functionality and therefore get a way more modular and simpler thing.
That said, I am still trying to assemble my thoughts about my initial StrokeDB experience and come out with cures for some problems. That might mean yet another "rewrite" branch I can start anytime soon in order to consolidate my updated vision.
Another change we're working on is getting rid of our custom storages and usage of more proven things, like TokyoCabinet. As far as you can understand that leads to elimination of skiplist and therefore less code. Which is pretty good anyway.
So, to recap, our plan is to:
Unfortunately, the deadline date is open. We have no idea when it will be done.
I have a bit busy summer and I still can't work full-time on StrokeDB (and will not be able for a substantial period, unfortunately), but be assured, I am definitely not going to throw this stuff away. Neither does Oleg.
Stay tuned! :)
Leaving my hangover apart, I want to talk about some recent "realization" I had. I am not sure it is necessarily a good idea, but it might be worth some investigation. So here we go.
In those ORMs I know (I do not pretend to know all of them, and I had an extensive experience only with few of them, mostly in Ruby) your way to operate with your objects' persistency is basically a read-edit-save loop (RESL). There is nothing bad about this way, especially given that you have no built-in versioning in typical relational databases and ORMs.
But as you may know, we at idbns team are experimenting with some weird ideas and prototypes (like StrokeDB) and one of the things we definitely love about our approach to data management is a built-in versioning.
At this moment, StrokeDB implements this RESL thing, too. It is a quite common approach, but it isn't any fun. It does work with versioning pretty well — it just increments document version once you save — nothing really tricky.
But there is one thing. My own viewpoint that I've developed within past few years is that your persistency mechanism should not let you "separate" your objects from your programming environment. So why the hell should I remind my programming environment to persist object's change every time I modify it? Wouldn't it be nice to persist data transparently?
May be. There is nothing new about this idea, but as far as I understand, there is not much public use of it in the industry.
Let's try to see where will it lead us to. Given we have built-in versioning, every change (like slot's value change) will cause versions change quite frequently, and, what is more important, these versions will be pretty much pointless. You will have a great history of every single change, but you wouldn't be able to say "and here we did that" for any more-than-one-slot update.
Unless you describe it explicitly. What if we'll make a record for every "business operation", something like a document that says:
It seems that having such kind of an explicit records will also allow us to run some kind of smart and safe compaction on a database.
I am not sure about the whole idea, but it still sounds interesting for me. What do you think?
That's probably just a matter of being new here, but I am really impressed — it is really a nice and well-balanced city where I do really feel comfortable.
Let's see what I will be thinking about it in a month ;)
Seagull decided to support my radio:
Hey, I am kind of back from nowhere.
This blog is undergoing major cleanup — I will try to re-publish select articles to save some bits of history from 2006 to 2008.
By the way, my time is PST these days and I live in Vancouver’s downtown until September — so if anybody wants to meet — drop me a comment or email.
I’ve been trying to formulate what StrokeDB is recently. And here is my summary: StrokeDB is not a database; it is a programming environment on top of Ruby (until we’ll have it ported to other languages). And here are my thoughts about “database” concept.
Do we really need “databases”? Well, I mean, we surely need some toolset to be able to store and retrieve data, but who said we need it in a form of pure datasets to be stored and retrieved? Who said that there should be a database server to interact with? Who said we might need special domain languages designed to manipulate arbitrary data?
What we really need is a persistence-aware programming environment, aren’t we? We just need to be able to store and retrieve data no matter how its persistence handled internally. There is nothing new about it, actually — MUMPS and GemStone/S (or even PL/SQL) were around for decades. What we really might need is to be able to create your-application-data-domain specific languages without any hassles — since we need to manipulate application’s data, not just any data (like you basically do with SQL).
It is quite popular in Rails world to say that we need a stupid database, just a kind of storage and let Ruby do the rest. Basically, they have a point. They use RDBMS as a data storage layer and their database is actually smart, because what is really important for data handling is actually implemented in Ruby. It is still usually limited by RDBMS design constraints, though.
My point is that your data should be as close to your main programming environment as it is possible. Your structures should be as native as it is possible — and they should be handled within the same environment. That’s reminds things like PL/SQL. Basically, PL/SQL is not THAT bad, but the thing with it is that usually you was using not ONLY PL/SQL, but, say, some Java code to interoperate with Oracle database.
Your application itself IS a smart database. So, I’d say we’re in the beginning of the long way “back to the future” — persistence-aware programming environments, not just databases.
Viva smart databases!
P.S. I am going to blog about data organization concepts within such environments soon — that’s an interesting topic to talk about and it is surely more concrete than this one :)
P.P.S. This article got 17 comments initially, so to not to lose them after my major blog cleanup, you can enjoy comments at google's cached version
Recent Comments