Architecture and Database Design Challenges

Ritwick Raj
AnitaB.org Open Source
2 min readJun 22, 2020

People often take it easy when it comes to beginning any project in general, be it android or web. The first step which arises while beginning any new project is designing the database. Designing the database may seem a very easy and normal task to do when working on personal projects. But when it comes to real world complex projects, database designs are really complex and difficult to design.

This was something I faced and worked in reality in my third week of GSoC under AnitaB.org on the Systers Portal. I had to work on the task of removing a data model and all its links with other data models and make it work. What seemed to be an easy task took a difficult turn when I started working on it.

Changing the Model and Permissions

Each model has a set of Groups and Permissions associated with it. And when we delete a model, all its related permissions get deleted as well. So removing the model causes all the permissions applied to users and groups to throw errors. Also, any foreign key or any kind of relation with other models also throw errors and disturb the regularity of the database.

So what I did to overcome this error was to initially remove all permissions related to that model from all fields and then remove all foreign key relations as well. This was all the work required on models side.

As far as the permissions were concerned I kept adding them to different models when and as they were needed and made the required changes at all places.

Views and Urls

Next in line is the views. There were views related to the model I had removed. So I definitely had to remove them. But there were also relation between the model removed and other models, which used the removed model “meetup location” as a context object. So I worked on removing all kinds of relations with the meetup location. The next step was to make all necessary changes to the Urls and Slugs so that they don’t throw any error.

Templates

The final piece of the puzzle were the templates. Redefining the template permissions and removing and changing views were a time-consuming part. Also, hyperlinks which used the no more present slugs had to be removed.

Groups

New Groups had to be created as the existing groups and permissions made no sense. So it was a pretty tough time at that as well, as I had to redefine permissions in views as well as templates and models.

I finally somehow managed to make the changes. The upcoming week brings up challenges for the preexisting test cases which would fail. I hope I am able to go through this task successfully :)

Happy Reading!!!

--

--