Anahita 1.6 Alpha is ready

That’s right yesterday we officially welcomed the Alpha girl in the social networking universe and we are now aiming for the Embryo release. Anahita 1.6 is a transitional release which means as soon as the code base is stable it will be the 1.7 Birth release. Anahita 1.6 is not the 1.5 release with more features, in fact we have made changes and improvements at the DNA level where each improvement provide a world of new opportunities to the Anahita developers.

A summary of the changes are as following:

1. Entirely rewritten domain libraries: the domain libraries are where all the database communication for the Anahita Nodes-Graphs-Stories architecture happen.  This has resulted into significant speed improvement in the system. For those of you who are new to this project, Anahita is developed using a Domain Driven Design (DDD) approach.

2. Improved API for developing social apps: using the new API and framework libraries we now require writing less code to develop custom social applications. In fact our existing social apps written for the Anahita 1.6 codebase contain about 36~46% less code in them.

3. Shared Ownership of Media Nodes: in the Anahita 1.5, a medium node (topic, blog post, page, photo, album, story node, etc. ) can only have one owner who is either a person (Person Actor) or a group of people (Group Actor). Anahita 1.6 provides the option for a medium node to have more than one owners. This can be useful in many context and case scenarios. For example if a person has uploaded a photo or written a blog post, she can submit them to other groups, events, projects. Shared ownership can also be used for developing all types of public and private messaging features where a group of people involved in a conversation will have shared ownership of the original message.

4. Improved API to handle custom profile fields: we have taken out all the existing opensocial fields from the people profiles (except some of the basics such as name, description, and gender) and then provided a new API which allows social apps and plugins to inject custom profile fields.

5. Comments are now nodes too: comments are no longer meta information added to a node. This concept has further simplified our design. For example before we had to conduct search on medium nodes (topics, pages, etc. ) and their comments separately because finding a way to merge the search results was a painful task. Now we can conduct search on a single nodes table. Comments can also adopt nodes behaviour for example they can be voted up (Like, +1, Digg), tagged, or be associated with other nodes using graphs.

6. Voting API: so a node can be voted up or down. That is how features such as +1 or LIKE are developed. The API also provides the option to vote down. We aren’t using the vote down feature ourselves but the option is available for developers who’d like to use it for their own custom social apps.

Less Code is Better

Less code means ability to change, pivot, or adapt your business logic to keep up with the changes in the business ecosystem. It means ability to build forward faster than … you know … the other fellow!

Anahita provides simple that handles complexity. Social Networks are complex and developing social networks using conventional software development methods means spending days writing complex queries and dealing with all kinds of complex relationships that could happen between rows and tables. In Anahita you can save lots of time on writing and debugging queries the old fashion way.

For example:

Give me all the photos that I’ve left at least a comment on them within this social network

repos('site::com.photos.model.photo')->getQuery()->where('comments.author','=', $viwer);

or give me all my photos that at least one of my leaders have commented on

$viewer->photos->where('comments.author', 'IN', $viewer->leaders);

Or you can rewrite the same domain query as following

$viewer->photos->where(‘comments.author.followers.id’, ‘CONTAINS’, $viewer->id);

Which automagically constructs the following database query:

SELECT DISTINCT photo.mimetype , photo.id , photo.component , photo.filename , photo.hits , photo.vote_up_count , photo.vote_down_count , photo.voter_up_ids , photo.voter_down_ids , photo.access , photo.permissions , photo.shared_owner_ids , photo.shared_owner_count , photo.owner_id , photo.owner_type , photo.comment_status , photo.comment_count , photo.last_comment_on , photo.last_comment_by , photo.meta , photo.created_on , photo.modified_on , photo.created_by , photo.modified_by , photo.subscriber_count , photo.subscriber_ids , photo.name , photo.body , photo.alias , photo.type FROM jos_anahita_nodes AS `photo` INNER JOIN jos_anahita_nodes AS comments ON photo.id = comments.parent_id AND comments.type LIKE '|AnSeNode|AnSeComment|%' INNER JOIN jos_anahita_nodes AS author ON comments.created_by = author.id AND author.type LIKE '|AnSeNode|AnSeActor|AnSePerson|%' INNER JOIN jos_anahita_edges AS person_followers ON author.id = person_followers.node_b_id AND person_followers.type LIKE '|AnSeEdge|AnSeGraph|AnSeGraphFollow|%' WHERE (photo.type LIKE '|AnSeNode|AnSeMedium|ComPhotosModelPhoto|%') AND ( ( photo.owner_id = 1 AND photo.owner_type = 'lib.anahita.se.person') AND person_followers.node_a_id IN ( 1 ) )

We have been busy rewriting all the existing Anahita social apps using the 1.6 codebase and it has been a quite fun process because the new Anahita framework enables us to write way less code and the API is a lot more programmer friendly. The following numbers can give you an idea about number of lines of code which we didn’t have to write for the new release:

Anahita Libraries (16% less)

  • Total: 20,764 down to 17,440
  • Number of Files: 337 down to 332

Anahita Pages (42% less)

  • Total: 1090 down to 634
  • Number of Files: 40 down to 31
  • Total (without the views): 405 down to 140
  • Number of Files (without the views): 9 down to 4

Anahita Todos (46% less)

  • Total: 1910 down to 1033
  • Number of files: 63 down to 53
  • Total (without the views): 738 down to 197
  • Number of Files (without the views): 15 down to 7

Anahita Photos (36% less)

  • Total: 2006 down to 1277
  • Number of Files: 63 down to 47
  • Total (without the views): 777 to 471
  • Number of Files (without the views): 13 to 10

Here is a graphical presentation:

  • RED is 1.6 codebase
  • BLUE is 1.5 codebase

Comparing the size of Anahita 1.5 and 1.6 code size

Comparing the size of Anahita apps 1.5 and 1.6 code size

The Path to the Anahita 1.7 Birth Release

The goal of the Anahita 1.6 release is to rebuild the existing features of the Anahita 1.5 using the new codebase. That means all the existing social apps should also be rewritten for the 1.6 codebase. We have already done that for the Anahita Groups, Discussions, Photos, Pages, and Todos.

Once the 1.6 code reaches the Embryo release, we will be using it to power Anahitapolis for while to further polish the code and fix all the remaining issues. The stable code will be the Anahita 1.7 Birth release. From that point we will be delivering our new set of features and functionalities in multiple 1.7 Birth releases. To stay consistent with our Build First Brag Later approach we will be telling you more about the 1.7 new features once they are ready.

Receive more Anahita Love

If you are tired of using the wrong technology for your social world liberation plan:

and share this blog post with your other hackerpreneur friends

3 Replies to “Anahita 1.6 Alpha is ready”

  1. @Robin yes we will be dropping Joomla and use a modified version of NookuServer to build Anahita. It will probably happen in Anahita 1.7 or later. We don’t know when it will happen yet.

Comments are closed.