Skip to content

hyperscale.at

Service-orientation-as-a-Service, SOA, PaaS, IaaS, and Economies of Autoscale

Archive

Category: database architecture and data modeling

Social networking software such as Diaspora‘s Aspects and now also Google+ Circles is becoming aware of users’ social contexts. Contextually-aware social networks understand, adapt to, and ideally leverage the information which humans use to relate to one another. Because humans often interact via ad-hoc channels of communication, it’s often valuable for software to adapt to these dynamic channels which have been recently created or destroyed between communicating humans. By abstracting application logic and narrowing the scope of data queries, software controllers can present more relevant views to a user based on dynamic user input or system intelligence. Often, for mobile users, social contexts are geographically based. Without requiring manual user input, software can behave more intelligently in cases where the geographic context narrows or broadens the scope of a dataset.

Is Context King?

A global positioning system in a networked mobile device can provide a narrower data scope (based on coordinate tracking) to an event handler or software controller which queries a cache of temporal data or even a larger set of persistent data. When focused views of user defined human-relational data sets intersect dynamic geospacial coordinates, systems can more efficiently learn how to provide more relevant information about changing social contexts. Moreover, this process can be done with less manual input by users. As a mobile user moves through geographic space, his or her social context may change based on the absence or presence of other people. As distributed systems and social networks become more aware of frequently changing, subtle, geographic social contexts… it becomes increasingly possible (assuming the information is shared with users) for users to find places and people based on their interests. From a social perspective, it’s really quite empowering to have this much abstraction between a venue and a place. There are a lot of “cloud” companies around these days, but in order to really specialize in abstraction one must understand what becomes the focus instead of that which we abstract. The focus is where the actual power (value) comes from. In this case the power is in the ability to become less reliant upon physical, geographic constraints and more focused on social interests (whether more or less sophisticated) and more focused on relateable interactions.

For example, if Barack Obama is in town, perhaps I’d like to invite him as a guest to an upcoming local or regional event. If not, perhaps I’d like the system to invite the next person who might be interested (in this example… Tom Anderson, my first Myspace friend). The system can know (often based on what’s probably voluntary user input) that Rick Perry isn’t as interested in this particular event (perry-wink)… even though both Rick Perry and Barack Obama may exist in the same or similar regional space at the same time. But fortunately I still have my friend Tom. The converging technologies (big/aggregate data abstraction, mobile computing, geospacial contextualization, and social contextualization) are not so new when standing alone, but when integrated support a trend of social sophistication which is more agnostic of physical infrastructure and places where it exists. If I had to summarize this sophistication in one word it would probably be “freedom.”

Skeptics might argue that they don’t like the idea of software or systems knowing more about them. Skeptics might also argue that they don’t like knowing << unpleasant fact(s) >>. Often, an unpleasantness (fear) is associated with aggregation of knowledge within a technological or otherwise sophisticated framework. You could call it a “fear of singularity” or “fear of robots taking children somewhere else” … but this year and probably next year I’m likely to be more afraid of ignorance than artificial, collective, or social intelligence. Knowledge is power, computers are tools, and the more they know about us the more we can know about ourselves. Privacy is important and made possible if encryption and private ownership of data is made possible. You are free to navigate your social context. Is your data? Is “your” data your data?

Peep the Context
Peep the Context.

Usually I design web application databases for MySQL, but the methods listed here are compatible with Oracle or any relational database management system. I’m not going to guide you through your own design process, but here are the basic database design principles you will need to know as you optimize your database for social applications:

- Use unsigned numeric integers (properly scaled for the size of your tables) without leading zeros.

- Start out with third normal form (3NF). Use associative tables to eliminate redundancy at first.

- Avoid storing files in the database. Use numeric filenames to associate data records with the file system.

- If necessary, use table caching and views to optimize performance based on use patterns. This should be done in conjunction with software app testing.

- If you need to shorten URIs passed between APIs or URLs for the user, make a relationship table referencing the longer URI with a shorter handle. Use numeric handles for small data sets or alpha numeric for larger data sets.

- For time related queries, associate the numeric primary key of long tables with relevant timestamps (hourly, daily, weekly, monthly or  other time intervals that your social web application would query.) This will reduce query time for long tables.