Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Is silverstripe suitable for large CRM system


Go to End


10 Posts   4626 Views

Avatar
Optic Blaze

Community Member, 190 Posts

21 August 2013 at 9:15am

Hi all,

I have been working with Silverstripe for three years now and love it. I have a client that has an existing CRM system that we are looking to rebuild. The code is a bit antiquated and still makes use of custom PHP and not a framework.

The problem is that the customer table has 50 000 records and the job notes table has about 360 000 records in that table. This accounts for about 3 year's data. Is Silverstripe a viable option to use for this purpose. I know SS can be a bit resource intensive at times and i am scared that if we build the application in SS that we will struggle with a slow system.

Your comments/ advice would be appreciated.

Thanks

Avatar
Mo

Community Member, 541 Posts

22 August 2013 at 11:04pm

I would say it could handle it, but the crunch will probably be the complexity of the data you are trying to work with.

I have found model admin (if you are planning on using that) is quite good at breaking down the records into managable chunks and using ajax to limit the hit on database.

If you are going to need to either

A: Write your own interface to manage the data (IE not use model admin).
B: Extend model admin / gridfield heavily.

I think your biggest problems will most likely be how complex your data model is and the interfaces you write to manage it.

If just using Stock SS Model Admin and Gridfield, I cant really see why you would have performance issues (unless you are running on archaic hardware).

Saying all that, if it was me, I think i would try and roll out a basic modeladmin interface that provides a basic system to view and manage your records. Depending on your current database tables, hopefully it shouldn't take very long to setup and will give you an actual instance you can profile and see if it is fit for purpose.

Hopefully that makes sense.

Mo

Avatar
Optic Blaze

Community Member, 190 Posts

23 August 2013 at 8:44am

Thanks Mo,

That is what i needed. I was thinking of using Model Admin for a large part of the 'setup tables' because i like the scaffolding that it uses that makes a the CRUD operations much quicker to set up.

Most of the other stuff will have to run in the front end though because i want to limit access to the admin side. I was more concerned that SS's abstraction layer (i think i got that right ...the special bits of ss code like <% control %> etc) would cause the application to become slow if it had to deal with alot of records.

What you mentioned below sounds encouraging and i think i am going to take your advice and roll out with a basic system to see how well SS handles the large volume of records.

Thanks for the advice.

Avatar
Mo

Community Member, 541 Posts

28 August 2013 at 7:07am

I have actually found in SS3, the front end templating system is quite fast and responsive.

The dev's made a lot of optimisations to the caching engine in SS3 and you now have some control over caching from inside your templates. There is some more info on this in the docs: http://doc.silverstripe.com/framework/en/reference/partial-caching

You can also look at running a caching engine over the top of Silverstripe to improve performance, but I have not really found I need to do that yet.

Also, if you are pulling in a lot of records into your front end templates, using pagination would probably help keep the database transaction cost down (viewing 100 records at a time is a lot less costly than viewing 10,000 in one hit).

Cheers,

Mo

Avatar
Optic Blaze

Community Member, 190 Posts

28 August 2013 at 7:21am

Thanks,

That is helpful. Have you had any experience with using ajax on the front end. Each customer has a physical address that needs to be completed since work needs to be booked out to be done at the residence.

I found with the old system that it worked well if i had all the suburbs in a searchable format for data integrity purposes. The challenge is that there are over 15 000 suburbs that i got from the Post Office database. So i need something that is searchable in the front end when the customer's details are captured for the first time.

In the old system i made use of fancybox to create a pop-up with searchable form. Then when the user selected the address it then copied the suburb ID into the customer address form which was then saved.

Thanks

Avatar
Optic Blaze

Community Member, 190 Posts

4 October 2013 at 11:04am

Ok, have been working on it and it is going well. ModelAdmin has been able to provide many of the features that i need, but now i need to start using routing and that is getting a bit more complex.

I have set up a controller under mysite/controllers called customer.php (mysite/controllers/customer.php) with a corresponding model under mysite/models/customer.php.

mysite/models/customer.php looks like this:
--------------------------------------------------------

class Customer extends DataObject {

public static $db = array(
'SiteRand'=> 'Varchar(20)',
'Name'=>'Varchar(255)',
'Surname'=>'Varchar(255)',
'DateJoined'=>'Date',
'Tel1'=>'Varchar(10)',
'Tel2'=>'Varchar(10)',
'Tel3'=>'Varchar(10)',
'Email1'=>'Varchar(255)',
'Email2'=>'Varchar(255)',
'Fax'=>'Varchar(6)',
'IDNumber'=>'Varchar(20)',
'Address'=>'Varchar(255)',
'IsActive'=>'Boolean'
);

public static $has_one = array(
'PostalCodes'=>'PostalCode'
);

mysite/controllers/customer.php looks like this:
----------------------------------------------------------

class Customer_Controller extends Controller {

public static $allowed_actions = array ('CustomerForm','customer');

public function init() {
parent::init();
}

//RENDER THIS CONTROLLER WITH 'PAGE' TEMPLATE
public function index() {
return $this->renderWith("Page");
}

//CREATE CUSTOMER FORM
public function CustomerForm() {
return BootstrapForm::create(
$this,
"CustomerForm",
FieldList::create(
HiddenField::create("SiteRand","", date("YmdHis")."-".rand(99,10000)),
TextField::create("Name","Name")
->addExtraClass("required"),
TextField::create("Surname","Surname")
->addExtraClass('required'),
NumericField::create("IDNumber","ID Number")
->setMaxLength('13'),
NumericField::create("Tel1","Phone number 1")
->addExtraClass("required")
->setMaxLength('10'),
NumericField::create("Tel2","Phone number 2")
->setMaxLength('10'),
NumericField::create("Tel3","Phone number 3")
->setMaxLength('10'),
EmailField::create("Email1","Email address 1"),
EmailField::create("Email2","Email address 2"),
DateField::create("DateJoined","Date Added")
->setConfig('showcalendar', true)
->addExtraClass('datepicker')
->setValue (date('Y/m/d'))
->setConfig('min', '2013-01-01'),
CheckboxField::create("IsActive","Is client active?", "True"),
TextareaField::create("Address","Physical Address")
->setAttribute('maxlength',200),
ChosenDropdownField::create("PostalCodesID", "Postal Addres")
->setSource(PostalCode::get()->map('ID','Suburb'))
->setEmptyString('--Please Select--')),
FieldList::create(
FormAction::create("AddCustomer","Add customer")
->setStyle("success")
),
RequiredFields::create(array("Name","Surname","Tel1", "Address", ))
)
->setLayout("horizontal");
}

// ADD CUSTOMER TO DATABASE
public static function AddCustomer($data, $form) {
$submission = new Customer();
$form->saveInto($submission);
$submission->write();
Controller::curr()->redirectBack();
}

}

--------------------------------------------------------------------------
i have updated my page.ss template with $CustomerForm but when i go to

www.mysite/customer...... nothing renders? Any ideas?

Avatar
Mo

Community Member, 541 Posts

9 October 2013 at 3:03am

Edited: 09/10/2013 3:05am

If you are using just the framework (no CMS), you need to write some routing rules, so Silverstripe knows how to direct URL's.

You can do this in mysite/_config/routes.yml (assuming you are using SS3.0.x).

Probably would need to look something like:

---
Name: CustomerRoutes
After: framework/routes#rootroutes
---
Director:
    rules:
      'customer/$Action/$ID/$Quantity': 'Customer_Controller'
---

EDIT: For some reason, the forum is stripping out the spacing from the above YML, so look here to see how it should be formatted: http://docs.silverstripe.com/framework/en/3.0/topics/controller#routing

The last line assumes you are accessing Customer_Controller from the url "http://www.siteurl.com/customer"

If you are using the CMS (I don't think you are, but thought I would mention it), then your customer controller needs to extend "Page_Controller" and your Customer model needs to extend "Page" (rather than DataObject) and you will then need to add a "Customer" to the list of pages in the CMS.

There is some further info here which might prove of some use: http://docs.silverstripe.com/framework/en/3.0/topics/controller

Hopefully that makes some sense?

Mo

Avatar
Optic Blaze

Community Member, 190 Posts

9 October 2013 at 3:45am

Thanks MO, tried it out and it worked well.

- Extended Data Object for the Customer class
- Extended Page_Controller for the Controller class

Go to Top