Reputation: 6839
I created a database that have following table for user activities:
user_id | INTEGER | user being notified
actor_id | INTEGER | user performing the action
activity_type | STRING | classname/type of the object being notified
activity_id | INTEGER | id of the object being notified
context_type | STRING | classname/type of the object's parent
context_id | INTEGER | id of the object's parent
read/view_at | DATETIME | timestamp of when user saw it
I don't know if this design is good in terms of performances. So I want to test it somehow. I can populate database with a lot of data and open page where I need to get data from this table but I don't know if this is relevant test.
Is there a good way to see how this design will perform when there are 10.000
users and 50.000.000
records in feed table?
I don't know if this can help but this I am using MS SQL Server
Upvotes: 3
Views: 20312
Reputation: 29649
If performance is critical, it's something you need to build into your development pipeline.
What I've done on performance-critical projects:
Upvotes: 2
Reputation: 5369
Regarding performance, no assumptions are safe. You should follow these steps:
Define performance goals, regarding load and response time. You should identify the accepted response times for specific data load.
Define resources. Not every machine configuration will behave the same. You should build a Virtual Machine with the target configuration.
Execute load testing. You could do it by using tools like SQL Server load generator.
Hope this helps!
Upvotes: 0
Reputation: 52157
This has worked for me so far:
As you can see, the database design is not just about fulfilling business requirements. Indeed, understanding how clients intend to access the data is integral part of the design process.
In other words, what is traditionally though of as "logical design" is not enough - there needs to be a "two-way street" between logical and physical design.
Is there a good way to see how this design will perform when there are 10.000 users and 50.000.000 records in feed table?
That sentence doesn't contain enough information to be answered.
First tell use how you intend to access the data, then perhaps we can help you (re)design the database to support that particular access pattern efficiently.
1 For example, if "loading a page" is critical for the user experience (which it usually is), make a list of queries that will typically be executed during that process.
2 Which includes "physical" techniques such as indexing, clustering, partitioning etc., but can also include some aspects that are traditionally though of as "logical" design, such as the design of keys and relationships. If you understand the underlying data structures that the typical DBMS uses, you'll be able to predict the performance consequences of most of your design decisions. Use The Index, Luke! is an excellent introduction on the topic.
Upvotes: 1