ruby on rails models - database

I am writting social network.
I have group's blog and user's blog, then I have group's photos and user's photos
How I must design models? all posts(photos) in one db table or in different?

It is preferable to have a single table only for photos, especially if you have multiple photos for each group or user. You could use Single Table Inheritance or Polymorphic Associations to store photos from groups and users in it. I would recommend to read some good books about the topic, Practical Rails Social Networking Sites and RailsSpace: Building a Social Networking Website with Ruby on Rails. Both are recommendable.

Related

Is this relevant to hash everything related to finance in a DB?

I'm working on an app with financial informations about users.
I'm wondering if the more secure way is to hash everything that is related to the users finance in the database and just decrypt everything in the application frontend or is it better to anonymise everything related to the user ?
Or are there other options I didn't think about ?
I have searched different solutions but I want to know what are the best practice with securing financial data.

Laravel Customers and Admins store in Userstable

I have a database design question. I am building a small customized shop with Laravel. I have the table users. In this table I store the customers but also the admins. With spatie I take over the role management. I want to implement two separate dashboards. A own customer dashboard and own admin dashboard.
For this case, is it a good idea to have customers and admins in one table? What is recommended practice? Thanks for reading!
I think that is question of personal preferences. Using a package like that you can maintain separation of responsibilities and permissions without any additional risk and, with an unique login procedure to maintain.
Some developers should prefer to create separate tables for that but I really can't see it as a great benefit.
Eventually you should tune your login redirects procedure to show the appropriate dashboard according to user profile

Handling Data for UI in a Microservice Architecture?

We´re planning to use the Microservice Architecture in our next application. I wanted to know if it´s a common practise to have a same domain entity for every related microservice. For example, there is a customer. A customer consists of multiple users and one company. They are existing in a customer service. Then there is a warehouse service. A warehouse can have different customers in different roles. So the warehosue entities holds keys to the customers.
In front of those two microservices there is an API gateway. Now when showing a screen with warehouses we need also the information about the customers from the customer service. So the API gateway could handle this, meaning fetch the warehouses and then the related customers. But then we connect two services via the API gateway. Is it a better way to hold the customers with specific attributes also in the warehouse service? But this is just necessary for view/UI specific use cases? Is this a correct way to bring "view logic" to the services?
You might implement this in different ways. The warehouse micro-service may consume data from the customer micro-service and enrich its response having everything in it for the presentation. Or the presentation may consist of several areas which are loaded from different micro-services each presenting its section.
Try to have as much microservice as you can based up single responsiblity system.
Create a API service and allow it to generate events which will be then consumed by other microservices and will provide results based on required parameters.
Now API can club the data and can respond back with the required format.
having multiple microservices will help you in scaling up and down , if you had only 2 microservices it is more or less like a monolithic services only.
Take the decision, considering future in mind.

I want to be able to store and retrieve my research articles. Any suggestions?

I am beginning to design an application that will allow me to upload and retrieve my research articles. I need the ability to attach information to each article such as APA citation, annotated bibliography and meta tags for search. Can this be accomplished with front-end development or only with a back-end database?

How are databases managed in social networking cites?

I am interested in understanding how the social networking sites like Facebook, Twitter, Google+ maintain their databases. In which format the data is stored in their database. I am completely new in this field and any description would be beneficial.
For Social networking sites. you can use Neo4j Graph DataBase. realiable for any social networking sites. i prefer for you bcz i used that.

Resources