开发者

schema free data store design

I am looking ways to implement schema free data store design. However, usually the term schema-free is used in the context of NoSQL school. I am not interested in the scalability advantage of NoSQL. One example is the friendfeed way (as explained in Bret Taylor's blog). Can you point me some other resources or design examples/case studies where the primary aim 开发者_开发技巧is to have a flexible/schema-free design (I am even ok with sacrificing performance for this) ?


I'm not 100% sure about your use case, could you share some more info about what you are trying to do? When you say you are not interested in "NoSQL" does that mean you have to implement everything on top of a relational database? (Which one?)

There are a couple of approaches to make relational schemas more flexible:

  • EAV / Entity-Attribute-Value designs, where one table stores common info about all "entities" / objects in the system, one table contains info about the attributes these entities can have and one table which stores (entity_id, attribute_id, value). See http://en.wikipedia.org/wiki/Entity-attribute-value_model for example.

  • "skinny tables", where you have wide tables with one column per column type (one varchar column, one blob column, one int column etc.) and then only fill the columns that match the type of value you want to store. This makes sense when you only want to store different types of values rather than changing you attributes on the fly. Can be used to store the attributes in an EAV schema.

  • Storing "triple" data: the semantic web people have spent quite a bit of time investigating how to best store RDF data, consisting of subject-relationship-object triples. There are "real" RDF stores with their own query language, but some of these can use a relational DB as the storage backend. If this sounds like the way to go, have a look here: http://www.w3.org/2003/01/21-RDF-RDB-access/ - a simple Google query for "storing rdf in a relational database" should point you to several Triplestore implementations that effectively map into relational DBs.

Hope this helps!


You may want to take a look at Berkeley DB. It provides a schema-less simple key-value API (ala NoSQL) and is a library that links directly into your application. The nice thing about Berkeley DB is that you can have your cake and eat it too. It provides the simple, flexible, embeddable data storage that developers are looking for, but it's very fast, scalable and reliable as well.

In addition to the base key/value pair API, Berkeley DB offers two other developer-friendly APIs: the Java Collections API and the Direct Persistence Layer API (a POJO-like persistence API).

Most BDB application developers use the API that fits most naturally with how the application represents the data. C and C++ structures are usually stored as simple, opaque key/value pairs, where as Java collections obviously match up well with that API and Java classes match up well with the DPL API.

Good luck with your search.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜